Alex Rivera | Logout

How to get all executed SQL queries in ORACLE?

Asked 2012-01-10T12:26:34.590
9

Is possible to find out all SQL queries and their return code, which was executed in Oracle database? Specially I want to get all sql queries which has negative sql code (error).

Thank you for answer.

Edit
Report

1 Answer

0

Maybe you can execute your queries within a (anonymous) PL/SQL block, and then use the its exception handler to catch "negative" statements:

begin
  insert into a values (1, 4/0);
exception when others then
  ... error has happened,
  ... use 'sqlerrm' and 'sqlcode' 
  ... for further analysis
end;
answered 2012-01-10T18:57:42.420

Your Answer