Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / January 2005

Tip: Looking for answers? Try searching our database.

create triggers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Omar Vazquez - 24 Jan 2005 22:25 GMT
HI, I HOPE SOMEBODY CAN HELP ME WITH THIS, I´M TRYING TO CREATE A
TRIGGER WITH A SCRIPT, BUT WEND I RUN IT ALWAYS SEND ME A ERROR
"SQL0104N  Se ha encontrado una señal imprevista
"END-OF-STATEMENT" a continuación de "END".  Entre las señales
esperadas se puede incluir: "JOIN <joined_table>".

THIS IS THE SCRIPT, I LIKE TO USE A SCRIPT TO CREATE ALL MY TRIGGERS
(8 0R 10) BECAUSE EVERY TIME I NEED TO CREATE THEM I HAVE TO USE THE
WIZARD OF CONTROL CENTER. AND THAT'S A HEAD ACHE.

CREATE TRIGGER LEDAT.INGOBS AFTER  INSERT  ON LEDAT.ICITEM
REFERENCING  NEW AS FN  FOR EACH ROW  MODE DB2SQL

/*
*SI EL VALOR RECIBIDO ES MAYOR A CERO ENTONCES SE CONSIDERA
*QUE EL CAMPO LLEVA UN VALOR VALIDO
*/
WHEN (LENGTH(LTRIM(FN.DEFPRICLST)) > 0)
BEGIN ATOMIC
INSERT INTO LEDAT.OBSERVACIONES (IDPROD,IDLISPRE) VALUES (FN.ITEMNO,
FN.DEFPRICLST);
END
Serge Rielau - 25 Jan 2005 14:40 GMT
> HI, I HOPE SOMEBODY CAN HELP ME WITH THIS, I´M TRYING TO CREATE A
> TRIGGER WITH A SCRIPT, BUT WEND I RUN IT ALWAYS SEND ME A ERROR
[quoted text clipped - 18 lines]
> FN.DEFPRICLST);
> END
Omar,

How do you run the script?
Make sure that after the END of the trigger statement you use a
character different from ';'. Popular are '$', '#' or '!'.
Then use that character in comntrol center as termination character for
tools-settings and/or use db2 -td$ -f <file> to run the script.

Cheers
Serge

Signature

Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

J.Haan - 27 Jan 2005 13:06 GMT
If you created the script on a windows machine, remember to run dos2unix
before you try to execute it on a unix machine. (different newline
interpretation).

-R-
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.