Hi,
I am newbie to SQL. I am trying to create a trigger on table X , which tests rowcount (with a condition) on table Y, before inserting data into X.
Eg, If rowcount with a condition of Y is greater than 1, it should NOT insert into table X
I tried with following, but its still inserting data into 'temp'
create trigger trigger_on_temp before insert on temp
for each row begin
if (select count(*) from temp2 where col='value') > 1 then
return false;
end if;
end;
Could anyone plz see where i am doing it wrong.
Thnx in advance.
Sandeep