sql - exists condition in a trigger -
i'm quite new pl/sql, sorry if question obvious
according trigger documentation, there when ( condition ) triggers. wanted use exists condition, requires subquery, however, have following error :
ora-02251
- 00000 - "subquery not allowed here"
*cause: subquery not allowed here in statement.
*action: remove subquery statement.
what did miss?
my condition following :
create or replace trigger mytrigger after update of column on this_table each row when (new.status = 'approved' , exists ( select * junction_table this_table_id=new.this_table_id , other_table_id = 'something')) declare begin end;
i want check whether row associated given value, can find in junction table.
i surely in pl/sql part of trigger, :
- it related trigger rather business logic in itself
- i'd understand missed in documentation , why not possible.
if condition might this, i'm interested.
i write conditional element within trigger itself, like
create or replace trigger mytrigger after update of column on this_table each row when (new.status = 'approved') declare begin if exists ( select * junction_table this_table_id=new.this_table_id , other_table_id = 'something')) ... end;
Comments
Post a Comment