Oracle SQLCODE Function


/ Published in: SQL
Save to your folder(s)

A few examples of the SQLCODE function.


Copy this code and paste it in your HTML
  1. /*
  2. SQLCODE Examples
  3. */
  4.  
  5. EXCEPTION
  6. WHEN OTHERS THEN
  7. dbms_output.put_line('An error was encountered: '||SQLCODE||' - '||SQLERRM);
  8. END;
  9.  
  10.  
  11.  
  12. EXCEPTION
  13. WHEN OTHERS THEN
  14. raise_application_error(-20010, 'An error was encountered: '||SQLCODE||' - '||SQLERRM);
  15. END;
  16.  
  17.  
  18. EXCEPTION
  19. WHEN OTHERS THEN
  20. errorcode := SQLCODE;
  21. errormessage := SQLERRM;
  22.  
  23. INSERT INTO error_log (error_number, error_message, function_name)
  24. VALUES (errorcode, errormessage, 'thisFunction');
  25.  
  26. END;

URL: http://www.databasestar.com/oracle-sqlcode/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.