Q
Problem solve Get help with specific problems with your technologies, process and projects.

Logging the sql_text on update/insert/delete in trigger

I have read your answer about logging the sql_text in triggers on error. I have the same problem, but I always have to log the sql_text on update/insert/delete in the trigger. Do you have any idea how I can get the sql_text that activates the trigger, without a where clause like 'ALTER%TABLE_NAME'?

I'm guessing you read the following: Logging the command that caused server error

I'm sorry to say that my answer hasn't changed since then.

There is no easy nor direct way that I know of to capture the SQL statement being issued in a trigger without doing some work in your application to cause the SQL to be retained somewhere you can readily access.

For More Information


Dig Deeper on Oracle and SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close