With the compound trigger, both the statement-level and row-level action can be put up in a single trigger.Plus there is an added advantage: it allows sharing of common state between all the trigger-points using variable.Thanks in Advance, bahaa CREATE TRIGGER trg_test BEFORE UPDATE OR INSERT OR DELETE ON test FOR EACH ROW BEGIN IF UPDATING THEN dbms_output.put_line('Updating'); ELSIF DELETING THEN dbms_output.put_line('Deleting'); ELSIF INSERTING THEN dbms_output.put_line('Inserting'); END IF; END; /Thank you for your replay, this trigger has another part like this: CREATE TRIGGER TRG_Forum Posts ON Forum Posts FOR INSERT, UPDATE, DELETE AS SET NOCOUNT ON IF UPDATE(nr Topic) OR (EXISTS(select 1 from deleted) AND NOT EXISTS(select 1 from inserted)) BEGIN -- PRINT 'column nr Topic affected by inserted, updated or delete' DECLARE @nr_topic int DECLARE @cnt int DECLARE @nr_lastpost int DECLARE cur_topics CURSOR FOR SELECT c. Nr IN ( SELECT nr Topic FROM inserted UNION SELECT nr Topic FROM deleted )................ Thanks In Advance, bahaa UNION is valid operator in PL/SQL (which trigger, actually, is).
if i knew that Oracle use :new.columnname,: Old.columnname to solve the temporary memory tables of Sql Server i would not send you the question ..Data manipulation language (DML) statements query and manipulate data in existing schema objects.These statements do not implicitly commit the current transaction. Manager’, ’8-aug-1998’,2000); If you want to add a new row by supplying values for some columns not all the columns then you have to mention the name of the columns in insert statements.Once a threshold is reached (say 1000 records), we flush the buffered data into audit table and reset the counter for further buffering.
And at last, as part of AFTER STATEMENT we flush any remaining data left in buffer. This would be a good starting point for your question (in sqlserver trigger I use inserted table/view for getting the row values, how to get these values in Oracle trigger?