Trigger or something like that for Select sentence

Tags:
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 but I would like to build something on the server(DB) side... pd. IBM Informix get something like this SELECT Statements That Execute Triggered Actions:

"CREATE TRIGGER hits_trig SELECT OF col_a ON tab_a REFERENCING OLD AS hit FOR EACH ROW (INSERT INTO hits_log VALUES (hit.col_a, CURRENT, USER));"


So I guess Oracle...maybe get something equal to it?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Forget triggers. You should consider architecting a Data Access layer in your system. Removing all embedded SQL from programs and replacing with a call to a service (for example, stored procedure) that returns a result set as well as performing your logging.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following