NEW_TABLE use in BEFORE trigger

 

Question

Is NEW_TABLE supported for BEFORE trigger?

 

Answer

The feature NEW_TABLE is not supported for BEFORE trigger.

The NEW_TABLE and OLD_TABLE can only be used from AFTER triggers because there is no way to know what the content of new_value should be before executing the actual operation.

 

The following example is NOT SUPPORTED:

create table s(a int);
@
create table ss(a int);
@
create trigger ss_trigger for ss before insert for each statement
as

update s set
a = (select a from new_table limit 1);

end_trigger;
@
insert ss(a)values(1);

 

 

Have more questions? Submit a request

Comments