3
votes

I have a package on my Oracle database, that I have compiled for debug and set breakpoints in. From SQL Developer I am then able to press ctrl+shift+F10 to run the debug and select which procedure I want to run. This all works fine.

Is it possible to catch any instances that run this package and hit my break point? For example, if a user in our C# application clicks a button, it calls a procedure in this package. I would like SQL Developer to break within the procedure and let me step through the package with the parameters supplied from the application.

2

2 Answers

2
votes

According to the SQL Developer Documentation, you should be able to debug a single session using Remote Debugging, but you'll have to change your client application so it calls the PL/SQL procedure to initialize debugging beforehand.

-1
votes

what are going to do???

instead of looking for how to catch instances that run this procedure, focus on how to catch the error throwen by your procedure by adding exception block to your procedure in your package.

for example add

...
exception
  when others then
   insert into error_table(userid, error) values 
   (SYS_CONTEXT  ('USERENV', 'TERMINAL') ,
    SQLCODE ||' ' || SQLERRM );
   commit;

so if any error occurred it will insert the exception will insert a record in error_table.

regards