Oracle Exceptions ??
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Oracle Exceptions ??

  1. #1
    Join Date
    Nov 2005
    Posts
    10

    Oracle Exceptions ??

    Gurus,

    Do you know if there is a way to make the Oracle driver more verbose on errors? Instead of saying "ORA-01722: invalid number", say "ORA-01722: invalid number: PHHCOMPRD.PHHCOM_RETAIL_INVENTORY.PONUM: value "'MyNameIsBillyBob'"

  2. #2
    Join Date
    Nov 2000
    Posts
    224
    The simple answer is No.

  3. #3
    Join Date
    Sep 2005
    Posts
    278
    You can achive in PL/SQL by defining your own excpetions as
    Code:
    declare
    invalid_num exception;
    pragma exception_init(invalid_num, -01722);
    ......
    begin
      numvar := 'MyNameIsBillyBob';
    exception
    when invalid_num then
           dbms_output.put_line('ORA-01722: PL/SQL: invalid number: variable numvar');
    end;

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    Code:
    declare
    invalid_num exception;
    pragma exception_init(invalid_num, -01722);
    ......
    begin
      numvar := 'MyNameIsBillyBob';
    exception
    when invalid_num then
           dbms_output.put_line('ORA-01722: PL/SQL: invalid number: variable '|| numvar);
    end;

    a slight correction

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width