The forum is currently being migrated to a new host. While the migration happens, the old server is still available. Once the new machine is ready, I will copy the database to the new machine. Feel free to ask and answer questions in the meantime.

How to extract the current sql inside a trigger.

Sybase 9.

example: Capture the INSERT, UPDATE, DELETE statement.


In higher versions there is the command CURRENT_SQL in Sybase 9 what would be the equivalent command?

asked 02 Dec '17, 10:54

Hudson%20Leite's gravatar image

Hudson Leite
accept rate: 0%


AFAIK SYS_CONTEXT('USERENV','CURRENT_SQL') is an Oracle feature which is only populated when you are using Oracle Fine Grained Auditing (FGA). There is no equivalent feature in SQL Anywhere 9.

The transaction log stores the SQL which caused triggers to fire, but that is not what you are asking for.

You can write code inside your trigger that can deduce what the triggering statement did: action (insert etc), columns, column values etc... but that's a lot of work to achieve what you are asking for.

(02 Dec '17, 14:16) Breck Carter
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 02 Dec '17, 10:54

question was seen: 726 times

last updated: 02 Dec '17, 14:16