Hi all,
This is on db2 udb 8.1 / Aix
I'm able to create a trigger using control center gui.
When trying to do the same by script (I do show SQL), i have the following error :
CREATE TRIGGER SLGLD.SP_TEST_UPD NO CASCADE BEFORE UPDATE ON SLGLD.SP_TEST REFERENCING OLD AS old NEW AS new FOR EACH ROW MODE DB2SQL BEGIN ATOMIC
set new.mod_date = current timestamp
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 "END-OF-STATEMENT" was found following "=
current timestamp". Expected tokens may include: "<delim_semicolon>". LINE
NUMBER=2. SQLSTATE=42601
Here is the create trigger statement:
CREATE TRIGGER SLGLD.SP_TEST_UPD NO CASCADE BEFORE UPDATE ON SLGLD.SP_TEST REFERENCING OLD AS old NEW AS new FOR EACH ROW MODE DB2SQL BEGIN ATOMIC
set new.mod_date = current timestamp ;
set new.mod_user = user;
set new.cre_date = old.cre_date;
set new.cre_user = old.cre_user;
END;
When I do it using control center it works, how come I can not do it by script ?
TIA
Stephane Paquette
Administrateur de bases de données
Database Administrator
Standard Life
www.standardlife.ca
Tel. (514) 499-7999 poste 7470 stephane.[Email Address Removed] <mailto:stephane.[Email Address Removed]
DB2 & UDB email list listserv db2-l LazyDBA home page