THANKS FOR YOUR YOUR ASSISTANCE GUYS,
I FINALLY PUT MY TRIGGER WORKING...
I'VE USED DB2 COMMAND LINE AND ON NT AND IT WORKED...
I DON'T KNOW WHY THE CREATE STATEMENT DIDN´T WORK ON SPUFI AND DSNSTEPS IN OS/390...
THANKS ANYWAY...
A BIG HUG TO SATHYA THAT PUT SO MUCH EFFORT ON MY PROBLEM...
AND FOR ALL OF THE DBA'S THROUGHOUT THE WORLD WHO WANTED TO HELP GIVING ME GLADLY SO MUCH INFORMATION...
I'M REALLY PROUD OF YOU GUYS,
I'VE MADE SOME GOOD FRIENDS...
PEDRO GONÇALVES
-----Mensagem original-----
De: Sathya [Email address protected]
Enviada: quinta-feira, 20 de Maio de 2004 18:54
Para: Pedro Miguel Gonçalves
Assunto: RE: PROBLEMS IN A TRIGGER
**A LazyDBA.com subscriber has responded to your lazydba.com post** **LazyDBA.com mail shield has forwarded you this email,
**and removed any attachments, and kept your email address secret **from this person, and any viruses/trojans.
**If you reply to this email, the person will see your email address as normal
**Anything below this line is the original email text
Hi,
Try to create this trigger using
db2 -tvasf <file name> > outputfile.
This outputfile will show the exact position in the trigger giving error.
Give a shot.
bye
"Pedro Miguel Gonçalves " [Email address protected] on 05/20/2004 12:54:52 PM
To: "LazyDBA Discussion" [Email address protected]
cc:
Subject: RE: PROBLEMS IN A TRIGGER
Hi sathya,
Here it is:
CREATE TRIGGER trigger1 NO CASCADE BEFORE INSERT
ON emp_table REFERENCING NEW AS N
FOR EACH ROW MODE DB2SQL
WHEN (N.emp_number=0)
BEGIN ATOMIC
SET N.emp_number=NULL;
END
The END is there and same problem occurred, the error is:
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "". SOME SYMBOLS THAT MIGHT
BE
LEGAL ARE: QUOTE
Why does he wants quotes if the field is numeric?
And where is this space "" is talking about?
Help me please...
Pedro Gonçalves
-----Mensagem original-----
De: Sathya [Email address protected]
Enviada: quinta-feira, 20 de Maio de 2004 17:40
Para: Pedro Miguel Gonçalves
Assunto: RE: PROBLEMS IN A TRIGGER
**A LazyDBA.com subscriber has responded to your lazydba.com post** **LazyDBA.com mail shield has forwarded you this email, **and removed any attachments, and kept your email address secret **from this person, and any viruses/trojans. **If you reply to this email, the person will see your email address as normal **Anything below this line is the original email text
Hi,
Have you missed the END for the Begin. I do not see in your text. Give
me full error text , I will try to fix it for you.
bye
sathya
"Pedro Miguel Gonçalves " [Email address protected] on 05/20/2004 11:39:59 AM
To: "LazyDBA Discussion" [Email address protected]
cc:
Subject: RE: PROBLEMS IN A TRIGGER
NOTHING,
DOES ANYONE HAS ANY MORE SUGGESTIONS?
RIGHT NOW I HAVE AND NOT WORKING ON DB2 V.7 FOR OS/390 THE FOLLOWING:
CREATE TRIGGER trigger_name NO CASCADE BEFORE INSERT
ON table_anme REFERENCING NEW AS N
FOR EACH ROW MODE DB2SQL
WHEN (N.field_name1=0)
BEGIN ATOMIC
SET field_name1=NULL;
All I want is that before inserting a record in a table that contains a 0 is inserted in the table as NULL.
PLEASE HELP ME HERE.
-----Mensagem original-----
De: Alejandro Daniel Toffetti [Email address protected]
Enviada: quinta-feira, 20 de Maio de 2004 13:47
Para: Pedro Miguel Gonçalves
Assunto: Re: PROBLEMS IN A TRIGGER
**A LazyDBA.com subscriber has responded to your lazydba.com post** **LazyDBA.com mail shield has forwarded you this email, **and removed any attachments, and kept your email address secret **from this person, and any viruses/trojans. **If you reply to this email, the person will see your email address as normal **Anything below this line is the original email text
Two things that springs to mind:
Try fitting the whole text of the trigger into one single line and
submit again. It worked for me only this way sometimes (DB2 UDB 6.1
under Windows 2000)
Try replacing
REC.field_name = NULL
with something like
REC.field_name = NULLIF('0', '0')
Nullif returns NULL if both arguments are equal.
Hope this helps,
Daniel
Pedro Miguel Gonçalves wrote:
>Thanks but it's not it...
>
>Keeps getting me SQL = -199 even with REC.field_name = 0;
>
>Any suggestions?
>
>Pedro Gonçalves
>
>
>-----Mensagem original-----
>De: Wilson Allan [Email address protected]
>Enviada: quinta-feira, 20 de Maio de 2004 12:24
>Para: LazyDBA Discussion
>Assunto: RE: PROBLEMS IN A TRIGGER
>
>
>Do you need WHERE REC.field_name = 0;
>
>-----Original Message-----
>From: Pedro Miguel Gonçalves [Email address protected]
>Sent: Thursday, May 20, 2004 6:18 AM
>To: LazyDBA Discussion
>Subject: PROBLEMS IN A TRIGGER
>
>Hi guys,
>
>I'm working with DB2 v.7 for OS/390.
>
>What's the problem with this trigger I want to create?
>
>CREATE TRIGGER trigger_name
> NO CASCADE BEFORE INSERT ON table_name
> REFERENCING NEW AS REC
> FOR EACH ROW MODE DB2SQL
> UPDATE table_name
> SET REC.field_name = NULL
> WHERE field_name = 0;
>
>Keeps telling that I should switch some keyword or end-of-statment for
>some tokken that DB2 doesn´t give me.
>
>
>HELP.
>
>
>Pedro Gonçalves. [Email address protected]
>
>
>---------------------------------------------------------------------
>PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
>website: http://www.LazyDBA.com
>To unsubscribe, e-mail: [Email address protected]
>For additional commands, e-mail: [Email address protected]
>
>
>
>---------------------------------------------------------------------
>PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
>website: http://www.LazyDBA.com
>To unsubscribe, e-mail: [Email address protected]
>For additional commands, e-mail: [Email address protected]
>
>
>
>---------------------------------------------------------------------
>PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
>website: http://www.LazyDBA.com
>To unsubscribe, e-mail: [Email address protected]
>For additional commands, e-mail: [Email address protected]
>
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe, e-mail: [Email address protected]
For additional commands, e-mail: [Email address protected]
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe, e-mail: [Email address protected]
For additional commands, e-mail: [Email address protected]
DB2 & UDB email list listserv db2-l LazyDBA home page