You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set term ^;
create or alter procedure sp_ttt as begin end^
set term ;^
recreate table ttt(id int, x int);
commit;
set term ^;
create or alter procedure sp_ttt(is_deleting boolean) as
begin
end^
create or alter trigger ttt_biud for ttt
active before insert or update or delete position 0 as
begin
--execute procedure sp_ttt( deleting ); ------------------ this causes error during compilation:
--execute procedure sp_ttt( :deleting ); ------------------ this also causes error (note on COLON before "deleting" :))
execute procedure sp_ttt( iif(deleting, true, false) ); ----- this compiled OK; but this expression looks cumbersome because 'deleting' is already of BOOLEAN type
end^
set term ;^
/*
PS. Error text:
------------------
Column does not belong to referenced table.
unsuccessful metadata update.
unknown ISC error 336397272.
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
DELETING.
*/
The text was updated successfully, but these errors were encountered:
summary: Allow pass boolean trigger-context variables: INSERTING, UPDATING or DELETING - directly as arguments when call SP from trigger => Allow trigger-context variables (INSERTING, UPDATING or DELETING) to be used as parameter for SP called from Trigger
6\. For compatibility reasons, the names INSERTING, UPDATING and DELETING \(which aren't keywords\)
work \(like in 2\.5 and previous\) as boolean expressions and work as values \(column or
variable\) in non\-booleans expressions\. For example, in:
SELECT INSERTING, NOT INSERTING FROM TEST WHERE INSERTING AND INSERTING IS TRUE
the INSERTING's are respectively recognized as value, keyword, keyword and value\.
There is no way to make it proper without reserve the words INSERTING, UPDATING and DELETING.
Submitted by: @pavel-zotov
set term ^;
create or alter procedure sp_ttt as begin end^
set term ;^
recreate table ttt(id int, x int);
commit;
set term ^;
create or alter procedure sp_ttt(is_deleting boolean) as
begin
end^
create or alter trigger ttt_biud for ttt
active before insert or update or delete position 0 as
begin
--execute procedure sp_ttt( deleting ); ------------------ this causes error during compilation:
--execute procedure sp_ttt( :deleting ); ------------------ this also causes error (note on COLON before "deleting" :))
execute procedure sp_ttt( iif(deleting, true, false) ); ----- this compiled OK; but this expression looks cumbersome because 'deleting' is already of BOOLEAN type
end^
set term ;^
/*
PS. Error text:
------------------
Column does not belong to referenced table.
unsuccessful metadata update.
unknown ISC error 336397272.
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
DELETING.
*/
The text was updated successfully, but these errors were encountered: