Oracle updating trigger

24-Jun-2020 08:03

oracle updating trigger-58

Cam chick sexy web

This should work for batch updates and inserts too.So, the after INSERT OR UPDATE should be a row level trigger...Now, when ever we have =3 rows PER CUSTOMER in this table(grab the latest 3 rows based on statement Date),my trigger should fire which executes a procedure which does calculations and dumps resultsin the OUTPUT table which is shown below with the one result for each customer Best Buy SQL select * from output; CUSTID CUSTNAME NETSALES_C NETSALES_2 NETSALES_3---------- -------------------- ---------- ---------- ---------- 1 best buy 2000 1000 1000Since I need to know how many rows are there in customer table for every customer being updated/insertedin the customer table, I have to use AFTER INSERT OR UPDATE ROW trigger..that gives me mutating trigger error.

table_name: It specifies the name of the table on which trigger operation is being performed.It facilitates you to change the trigger definition without using a DROP TRIGGER statement.trigger_name: It specifies the name of the trigger that you want to create.If you need to determine if the value is changing, you'll still need to code comparison logic for :old and :new values.

CREATE [ OR REPLACE ] TRIGGER trigger_name BEFORE INSERT or UPDATE or DELETE ON table_name [ FOR EACH ROW ] DECLARE -- variable declarations BEGIN -- trigger code EXCEPTION WHEN ...

If batch insert or update takes place, the trigger fires my procedure only once for the last customer being inserted/updated.