I am trying to return an SQL query from a database call when the query is not running and the return pointer has a failure state. This query string will be used for logging purposes.
One way to do this is to save the variable containing the SQL query as a string, then wrap each query in the PL / SQL block with an exception handler and, if an exception occurs, return the query string with a status error for the user interface component.
Is there a better way to do this? Does the exception object support Oracle or any other package?
This question seems to be a duplicate for the thread: Get the Query / CommandText that caused the SQLException
However, I did not find a solution to the problem in this thread, and I would like to know if there are any new packages supported by Oracle that give us the query string that caused the exception.
source
share