Hello all,
Suppose I have the following data setup:
create table a (a1 number);
create table b (b1 number, b2 varchar2(100));
create table c (c1 number, c2 number);
insert into c values(1, null);
insert into c values(2, null);
insert into c values(3, 2);
insert into c values(4, 2);
insert into c values(5, 2);
insert into c values(6, 5);
create or replace trigger a_b_tgr
after insert on a
for each row
begin
if :NEW.a1 in (select c1
from c
start with c1 = 2
connect by c2 = prior c1) then
insert into b values(:NEW.a1, 'Some text.');
end if;
end;
/
So, when I try to create this trigger, it gives me the 'PLS-00405: subquery not allowed in this context' error... Why?..
And how should I go about it? The idea of hardcoding 2,3,4,5,6 in the trigger doesn't seem to be a good one...
Thank you.