Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

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?

asked 02 Dec '17, 10:54

Hudson%20Leite's gravatar image

Hudson Leite
16334
accept rate: 0%

1

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×180
×106

question asked: 02 Dec '17, 10:54

question was seen: 1,540 times

last updated: 02 Dec '17, 14:16