I've just started the work to move all my old database scripts into FM. My product supports MySQL and SQL Server. All the tables are easy, but we have some stored procedures and triggers that are, of course, database specific. So I'm just running our previously working scripts as embedded scripts in FM, but they don't work. It seems like FM is trying to run each line as a separate transaction. There isn't a lot of error output, but here is what I got:
Input script (edited to protect company):
delimiter $$
CREATE
DEFINER=`root`@`%`
TRIGGER `on_insert_XXXXX`
AFTER INSERT ON `XXXXX`
FOR EACH ROW
begin
set @count = (select count(*) from YYYYY where e= new.e);
if (@count = 0) then
insert into YYYYY (a,b,c,d,e)
values(new.a, new.b, new.c, new.d, new.e);
else
update YYYYYY set a= new.a, b= new.b, c= new.c, d= new.d where e= new.e;
end if;
end$$
delimiter ;
FM Error:
!!! Fatal error encountered during command execution.
!!! Parameter '@count' must be defined.
!!! Fatal error encountered during command execution.
!!! Parameter '@count' must be defined.
Does the script need to be formatted in a specific way for FM?