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
- Dozens more answers to tough Oracle questions from Karen Morton are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
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.