0 pts.
 Trigger or something like that for Select sentence
SQL
I need a trigger or something which will be launch when i open a table with a "select" sentence...i know that triggers per se only work with "update, insert or delete" (ddl or dml) but i want to know if i can do something that works like a trigger but only when i do a "select" command...i know also that i can write code on the client side to implement something seemless by i would like to build something on the server(DB) side... thanks in advance...

Software/Hardware used:
ASKED: September 20, 2006  6:38 PM
UPDATED: September 21, 2006  1:58 PM

Answer Wiki:
In Oracle you could activate auditing on that table. You will need to write some sort of cleardown and summary routine of the audit records. This needs to be run periodically to prevent excessive storage.
Last Wiki Answer Submitted:  September 21, 2006  7:08 am  by  Lukedavies   0 pts.
All Answer Wiki Contributors:  Lukedavies   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

You can use FGA (Fine Grained Auditing) to simulate SELECT triggers. Basically the FGA supplied package has what is called a handler_module which is a procedure that you can ask Oracle to execute whenever someone selects from a table.

So to simulate a SELECT trigger you set up auditing through this package and include the handler_module info to execute whatever it is you want executed when the “trigger” fires.

For more info refer to the documentation for :
FGA
dbms_fga
handler_module

 0 pts.

 

This is a URL that has an example on Fine Grained Auditing from Oracle Tech Network. It is a PDF chapter sample from an Oracle Press Book:

http://www.oracle.com/technology/books/pdfs/sample_31300.pdf

 0 pts.