If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > After trigger Issue in DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-10, 06:28
Ganapathi M Ganapathi M is offline
Registered User
 
Join Date: Dec 2010
Posts: 1
After trigger Issue in DB2

Hi All,

I am new to DB2. I am trying to create after trigger using the following code

CREATE TRIGGER TESTER.ADASCOMCAMCALCS1
AFTER DELETE ON
TESTER.ASCOMCAMCGROUPS REFERENCING OLD AS old
FOR EACH ROW mode db2sql
BEGIN ATOMIC
DELETE from tester.dcmodellog
WHERE idval = old.MCGROUPID
END

I am getting the following error message:

42601(-104)[IBM][CLI Driver][DB2] SQL0104N An unexpected token ";" was found following ";". Expected tokens may include: "<TRIGGERED-SQL-STATEMENT>". SQLSTATE=42601
(0.00 secs)

You help is very much appreciated.
Reply With Quote
  #2 (permalink)  
Old 12-08-10, 11:49
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
That's a pretty wierd error message since you do not have a semi colon in the ddl, which is required. I think what you are after is that you have to change your delimeter to a character other than ;
This is probably what you want:
Quote:
CREATE TRIGGER TESTER.ADASCOMCAMCALCS1
AFTER DELETE ON
TESTER.ASCOMCAMCGROUPS REFERENCING OLD AS old
FOR EACH ROW mode db2sql
BEGIN ATOMIC
DELETE from tester.dcmodellog
WHERE idval = old.MCGROUPID ;
END~
Dave Nance
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On