Home » Developer & Programmer » Forms » ORA-03114 Error
ORA-03114 Error [message #87115] Tue, 07 December 2004 01:08
Ram Showri
Messages: 1
Registered: December 2004
Junior Member
Hi Friends!

I am getting some problem while I was logging into my application thru my customized LOGON form. I created a simple form with three text items(USER_NAME,PASS_WORD,DATA_BASE) and two buttons 'CONNECT' and 'EXIT'. I created one parameter ('CNT' Number type) also. My aim is to connect to the database if I successfully LOGIN. If not after three attempts it the application will be closed. The user can enter the username, password,connecting_string values in any way.  That means he can enter username&password at username only and database name place database name. He can also give username,password&database at username only.     (Eg. scott,tiger,orcl or scott/tiger,,orcl or scott/tiger@orcl).  So inorder to achieve this I used INSTR & SUBSTR functions.

I've written code at the 'CONNECT' button (when-button-pressed) as below.

DECLARE

               

                UN      VARCHAR2(50):= NULL;

                PW      VARCHAR2(50):= NULL;

                CN       VARCHAR2(50):= NULL;

                               

BEGIN

 

 LOGOUT;

 

 IF            :CON_BLK.USER_NAME IS NOT NULL AND

                :CON_BLK.PASS_WORD IS NOT NULL AND

                :CON_BLK.DATA_BASE IS NOT NULL THEN                                                     

 

                UN := :CON_BLK.USER_NAME;

                PW := :CON_BLK.PASS_WORD;

CN := :CON_BLK.DATA_BASE;

                LOGON(UN,PW||'@'||CN,FALSE);

 

ELSIF :CON_BLK.USER_NAME IS NOT NULL AND

           :CON_BLK.PASS_WORD IS NULL AND

           :CON_BLK.DATA_BASE IS NOT NULL THEN

 

           SELECT SUBSTR(:CON_BLK.USER_NAME, 1,

INSTR(:CON_BLK.USER_NAME,'/' ) - 1 )

                INTO UN FROM DUAL;   

           

           SELECT SUBSTR(:CON_BLK.USER_NAME,

           INSTR(:CON_BLK.USER_NAME,'/' ) + 1,

            LENGTH(:CON_BLK.USER_NAME))

            INTO PW FROM DUAL;

     

           CN := :CON_BLK.DATA_BASE;

                LOGON(UN,PW||'@'||CN,FALSE);

 

ELSIF :CON_BLK.USER_NAME IS NOT NULL AND

:CON_BLK.PASS_WORD IS NULL AND

                :CON_BLK.DATA_BASE IS NULL THEN

 

                 SELECT SUBSTR(:CON_BLK.USER_NAME, 1,

 INSTR(:CON_BLK.USER_NAME,'/' ) - 1 )

                 INTO UN FROM DUAL;   

                                                 

SELECT SUBSTR(:CON_BLK.USER_NAME,1+ INSTR(SUBSTR(:CON_BLK.USER_NAME,1,

INSTR(:CON_BLK.USER_NAME,'@')),'/',-1), INSTR(:CON_BLK.USER_NAME,'@') -

INSTR(SUBSTR(:CON_BLK.USER_NAME,1, INSTR(:CON_BLK.USER_NAME,'@')),'/',-1)-1)

                INTO PW FROM DUAL;

                                                 

SELECT SUBSTR(:CON_BLK.USER_NAME, INSTR(:CON_BLK.USER_NAME,'@' ) + 1, LENGTH(:CON_BLK.USER_NAME))

                INTO CN FROM DUAL;

 

                LOGON(UN,PW||'@'||CN,FALSE);

 

 END IF;

 

 IF            FORM_SUCCESS THEN

CALL_FORM('CON_MAIN');

                EXIT_FORM;

 ELSE

:PARAMETER.CNT := :PARAMETER.CNT + 1;

                IF :PARAMETER.CNT < 3 THEN

                      MESSAGE('Invalid User Name/Password/Database!!!');

                      CLEAR_FORM;

                      CLEAR_MESSAGE;          

                ELSE

                      MESSAGE('Exceeded maximum number of attempts, Please try later.');

                      EXIT_FORM;

                END IF;  

END IF;   

 

EXCEPTION

             WHEN OTHERS THEN

                                MESSAGE(SQLERRM);                          

                               

END;

But this code is working only when I give the username,password,database individually. But when I give username,password together or username,password,database together it's not working. It is showing me the error (ORA-03114) that it is not connected to Oracle.

Can anybody help me where I am making the mistake? I will be very glad if anyone help me in this issue.

Thanks,

Ram Showri

 

 

 
Previous Topic: How to attach menu module at runtime.
Next Topic: Sending Emails from Forms6i in web environment
Goto Forum:
  


Current Time: Thu Sep 19 07:22:46 CDT 2024