Hooks/Triggers in Informix.
Posted in 2000
Topics: Performance & Tuning, Triggers, Constraints & Referential Integrity
Hi; I'm researching databases internal triggers/hooks (like the ones "fired" in/from operating systems kernel). Is there any similar mechanism in databases (hooks) that "fires" hooks whenever a table or view is modified or accessed, or when some user actions or database system actions occur? I know that in databases there is a TRIGGERS mechanism that handles PART of the events in the database but, not all of them. For example triggers can't handle the statement of SELECT so it can't be hooked.Any other know mechanism? (maybe through the optimizer etc..) Thanks in advance Hussam Khateeb
Hossam Khateeb wrote:
> Hi;
> I'm researching databases internal triggers/hooks (like the ones
> "fired" in/from operating
> systems kernel). Is there any similar mechanism in databases (hooks)
> that "fires" hooks whenever
> a table or view is modified or accessed, or when some user actions or
> database system actions occur?
> I know that in databases there is a TRIGGERS mechanism that handles PART
> of the events in the
> database but, not all of them. For example triggers can't handle the
> statement of SELECT so it can't
> be hooked.Any other know mechanism? (maybe through the optimizer etc..)
IDS2000 does allow triggers to be placed on SELECT statements as well as
the more usual INSERT, DELETE and UPDATE statements. Examine the "SQL
Syntax" documentation at http://www.informix.com/answers/english/pids92.htm
for details.
Here's an example (from the manual)
CREATE TRIGGER mytrigSELECT OF cola ON mytab
REFERENCING OLD AS pre
FOR EACH ROW (INSERT INTO newtab('for each action'))
Cool, eh?
Rudy