1 Reply Latest reply: Jan 28, 2010 11:17 AM by 690504 RSS

    How to Control Error Generated from Oracle Data base....Solution Required

    747862
      Hello,

      I'm trying hard from last couple of days to solve my prob bu i cant able to do so...

      Actually the oracle data base generated error in his own language such as... "Oracle=0912 Value Not Null, Oracle= 0913 etc...

      i need to control the error in user friendly environment... i need to hold the data base error and write my own error in friendly way so the computer illetrate person can can understand that..


      need some solution or Code which i put in my *Process* validation.

      _That's the Code which is not working fine..._

      DECLARE
      P1_VAR1 varchar2(200);
      P1_VAR2 varchar2(200);
      no_valid_VAR1 EXCEPTION;
      PRAGMA EXCEPTION_INIT (no_valid_VAR1, -0123);
      no_valid_VAR2 EXCEPTION;
      PRAGMA EXCEPTION_INIT (no_valid_VAR2, -0456);

      BEGIN
      P1_result := :P1_var1 / :P1_var2;

      EXCEPTION
      WHEN no_valid_VAR1
      THEN
      HTP.p ( 'This is not a valid VAR1!'
      || CHR (10)
      || CHR (10)
      || 'Your current NUMBER format is wrong '
      );
      WHEN no_valid_var2
      THEN
      HTP.p ( 'This is not a valid VAR2!
      || CHR (10)
      || CHR (10)
      || 'Your current NUMBER format is wrong '
      );
      WHEN OTHERS
      THEN
      HTP.p (
      || CHR (10)
      || CHR (10)
      || 'CONTACT VENDOR '
      );
      END;