Skip to Main Content
  • Questions
  • How to read parameter values passed from java while calling a stored procedure.

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Krishnan.

Asked: June 11, 2021 - 3:24 am UTC

Last updated: June 14, 2021 - 12:34 pm UTC

Version: 19c

Viewed 1000+ times

You Asked

Hi Tom,

The web app we have uses java class to call stored procedures. User inputs are used to pass parameter values while calling the stored procedure. Is there a way in oracle that I get to know what parameter values are passed by querying some dbms table or the like? I need to know the parameters only when I encounter any error/exception, so I dont want to add a log of parameters inside all my procedures to record the parameters.

Please let me know if this is possible.

Thanks...

and Chris said...

Log them to a table in your code. There's no system tables or dbms packages that capture all this information.

You could use this utility to auto-generate the code for you to copy/paste into your procedures:

https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:9532095900346470307

Or you could use the open source Logger package. This has an append_param procedure to give a generic way to handle these. Again you'll have to put the calls to this in your code yourself:

https://github.com/OraOpenSource/Logger/blob/master/docs/Logger%20API.md

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library