![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a way to query the uncommitted result set of the triggered table through a non row based trigger? For example: CREATE OR REPLACE TRIGGER ABC_Trigger AFTER INSERT OR UPDATE OR DELETE ON ABC_Table DECLARE i NUMBER; BEGIN SELECT COUNT(1) INTO i FROM ABC_Table; DBMS_OUTPUT.PUT_LINE(i); END ABC_Trigger; From this example, the variable "i" will always have the original row count of the table before any records being inserted or removed. |
|
Is there a way to get the final record count (the uncommited result) of the table within the trigger? Please note that this is a non row based trigger since I only want it to trigger once disregarding the number of records being inserted or deleted. |
#3
| |||
| |||
|
|
Aiden Fung wrote: Is there a way to query the uncommitted result set of the triggered table through a non row based trigger? For example: CREATE OR REPLACE TRIGGER ABC_Trigger AFTER INSERT OR UPDATE OR DELETE ON ABC_Table DECLARE i NUMBER; BEGIN SELECT COUNT(1) INTO i FROM ABC_Table; DBMS_OUTPUT.PUT_LINE(i); END ABC_Trigger; From this example, the variable "i" will always have the original row count of the table before any records being inserted or removed. No it doesn't. It will have the rowcount after the insert/delete. It is definied as an _AFTER_ insert/update/delete trigger. Is there a way to get the final record count (the uncommited result) of the table within the trigger? Please note that this is a non row based trigger since I only want it to trigger once disregarding the number of records being inserted or deleted. The trigger does exactly what you want. -- Theo |
![]() |
| Thread Tools | |
| Display Modes | |
| |