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 > Trigger with "when" clause

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-11, 09:37
citi citi is offline
Registered User
 
Join Date: Aug 2007
Posts: 45
Trigger with "when" clause

On DB2 V9 for z/OS, I am attempting to create the trigger below but receive the following error:
SQLState: 56059
ErrorCode: -20100

Is the trigger failing because SP02_ADDRESS_TYPE is not an updated field on the table?

Any help would be great. Thank you in advance.

CREATE TRIGGER DB.TRSP02UPD
AFTER UPDATE OF SP02_ADDRESS_LINE_1,
SP02_ADDRESS_LINE_2,
SP02_CITY,
SP02_ZIPCODE,
SP02_ZIP_PLUS4
ON DB.SP02_ADDRESS_T
REFERENCING NEW AS NEWV
OLD AS PREV
FOR EACH ROW MODE DB2SQL
WHEN (SP02_ADDRESS_TYPE = 3)
CALL DB.SP02UPD (PREV.SP02_ADDRESS_ID,
NEWV.SP02_ADDRESS_LINE_1,
NEWV.SP02_ADDRESS_LINE_2,
NEWV.SP02_CITY,
NEWV.SP02_ZIPCODE,
NEWV.SP02_ZIP_PLUS4);
COMMIT;
Reply With Quote
  #2 (permalink)  
Old 08-04-11, 12:27
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
What was the full error message text?
According to manual, it includes section-number and token-list.

Quote:
-20100 AN ERROR OCCURRED WHEN
BINDING A TRIGGERED SQL
STATEMENT. INFORMATION
RETURNED: SECTION NUMBER :
section-number SQLCODE sqlerror,
SQLSTATE sqlstate, AND MESSAGE
TOKENS token-list
Reply With Quote
  #3 (permalink)  
Old 08-04-11, 13:54
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Maybe SP02_ADDRESS_TYPE is not numeric? (Just a guess)
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
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