Dear Sir, I was just wondering why this "SELECT INTO" statements (with a local variable ) failing within following trigger definations:
create trigger fgg_assign_del
after update on fgt_assignments
REFERENCING OLD AS old FOR EACH ROW MODE DB2SQL
begin atomic
declare temp12 integer;
select count (*) into temp12 from tpt_classes p;
--where
-- old.project_id = p.id and
-- p.status >= 400 and p.status < 500;
if (temp12 >= 1) then
SIGNAL SQLSTATE '-20639' ('');
end if;
/* clean up all reservations */
delete from fgt_events where related_to = old.id;
end
__________________________________________________ ___
The error generated is as follows:
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "temp12" was found following "elect count (*) into". Expected tokens may include: "<space>". LINE NUMBER=6.
SQLSTATE=42601
__________________________________________________ ___
Well, basicaly i am translating oracle triggers to DB2 triggers so corresponding oracle trigger is running fine!
Thks in advance!