create trigger syntax -
08-24-2006
, 02:25 PM
Hello all,
I need to create database triggers from within my c++ code. I've been
having trouble figuring out how to do this with mysql++. The sql code I
would use to do this is as follows:
delimiter $
create trigger init_Real_Cell before insert on Real_Cell
for each row begin
set new.CDate = current_timestamp;
set new.MDate = current_timestamp;
end$
delimiter ;
I've tried building a string containing those lines and then using the
Execute method, but mysql complains about the syntax. I believe the
problem is because I am trying to put a multi line command into a
single line method (Execute or Query).
Has anyone else done this before? I could really use some advice on how
to add these triggers from my code. At this point I'm thinking about
using an external script that I would call from my c++ code but I
_really_ don't want to do that.
Thanks,
Patrick |