Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2013
    Posts
    4

    Unanswered: Trigger to update value to null not working

    I am not sure what is wrong with my trigger but it compiles fine. When the status is changed in the application to 'INPRG' I get the following error:
    Database error number -723

    The attribute workorder.lead is not a required and can accept null values.
    _____________________________________
    CREATE TRIGGER LR_NULLLEAD_T
    AFTER UPDATE ON MAXIMO.WORKORDER
    REFERENCING
    OLD AS O
    NEW AS N
    FOR EACH ROW MODE DB2SQL
    UPDATE MAXIMO.WORKORDER
    SET LEAD = NULL
    WHERE N.STATUS = 'INPRG'
    _____________________________________

    Thanks in advance.

    DB2 version: 10010100 Build: special_30422 O/S: Linux
    Application: IBM Maximo

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Check the associated messages.

    SQL0723N

    User response

    Check the message associated with the SQLCODE of the SQL statement that failed. Follow the action suggested by that message.

    sqlcode: -723

  3. #3
    Join Date
    Dec 2013
    Posts
    4
    Was able to get it working with:

    BEGIN ATOMIC
    IF N.STATUS = 'SENT'
    THEN
    SET N.LEAD = NULL;
    ELSEIF
    N.STATUS = 'COMP'
    THEN
    SET N.LEAD = NULL;
    END IF;
    END

Posting Permissions

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