cancel
Showing results for 
Search instead for 
Did you mean: 

Extract current Sql inside trigger

Former Member
0 Kudos
1,710

How to extract the current sql inside a trigger.

Sybase 9.

example: Capture the INSERT, UPDATE, DELETE statement.

Extract: INSERT INTO TITLE (ID, ORDER) VALUES (1, 12345).

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

Breck_Carter
Participant

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.

Accepted Solutions (0)

Answers (0)