Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Posts
    56

    Unanswered: 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;

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    What was the full error message text?
    According to manual, it includes section-number and token-list.

    -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

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    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/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •