Thank you very much.
It's working when I do it on unix.
In command center, how can I change the termination character option ?
The only thing i can change is the auto-commit feature.
Regards,
Stephane
-----Original Message-----
From: Gandra, Narayan [mailto:[Email Address Removed] 25 février, 2004 15:27
To: Stephane Paquette; [Email Address Removed] RE: Creating audit trigger
Stephane,
When creating an atomic trigger, care must be taken with the
end-of-statement character. The database manager, by default, considers a
";" the end-of-statement marker. You should manually edit the
end-of-statement character in your script to create the atomic trigger. The
";" could be replaced by another special character "@" or "#".
From the command line processor, use:
db2 -td @ or # -vf <script name>
Thanks!
Narayan
-----Original Message-----
From: Stephane Paquette [mailto:stephane.[Email Address Removed] Wednesday, February 25, 2004 2:00 PM
To: [Email Address Removed] Creating audit trigger
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]
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
Get today's cartoon: http://www.LazyDBA.com
To unsubscribe, e-mail: db2udbdba-[Email Address Removed] additional commands, e-mail: db2udbdba-[Email Address Removed]DB2 & UDB email list listserv db2-l LazyDBA home page