Skip to Content
0
Former Member
Jul 16, 2008 at 11:55 AM

-9405 AK Datapart too short and -9999 invalid indexorder after upgrade

11 Views

Hello,

we´ve got a problem with a update trigger after upgrading from 7.5 to 7.6.03.15.

Update statements returns:

-9999 invalid_indexorder

and

-9405 AK Datapart too short

Best regards,

Michael Jürgens

CREATE TRIGGER UPDATE_MESSAGE
    FOR
        MESSAGE
    AFTER
         UPDATE
    EXECUTE (
        IF NEW.INMESSAGEID <> OLD.INMESSAGEID AND NOT NEW.INMESSAGEID IS NULL THEN
          BEGIN
                SELECT KEYWORD
                    INTO :KEYWORD FROM OPER.MESSAGE WHERE :NEW.INMESSAGEID = ID;
                UPDATE
                    OPER.MESSAGE
                SET
                    INMESSAGEKEYWORD       = :KEYWORD
                WHERE
                    ID = :NEW.ID
                    IGNORE TRIGGER;
              END;
        IF NEW.DESTAPPID <> OLD.DESTAPPID THEN
          BEGIN
                SELECT COMPANY_FK
                    INTO :DESTCOMPANYID FROM OPER.COMPANY_APPLICATION WHERE :NEW.DESTAPPID = APPLICATION_FK;
                SELECT APPLICATIONTYPEID
                    INTO :DESTAPPTYPEID FROM OPER.APPLICATION WHERE :NEW.DESTAPPID = APPLICATION.ID;
                UPDATE
                    OPER.MESSAGE
                SET
                    DESTCOMPANYID = :DESTCOMPANYID,
                    DESTAPPTYPEID = :DESTAPPTYPEID
                WHERE
                    ID = :NEW.ID
                    IGNORE TRIGGER;
              END;
        IF NEW.RECEIVEDDATETS <> OLD.RECEIVEDDATETS THEN
          BEGIN
                UPDATE
                    OPER.MESSAGE
                SET
                    RECEIVEDDATEDATE = DATE(:NEW.RECEIVEDDATETS),
                    RECEIVEDDATEHOUR = MAKETIME(HOUR(:NEW.RECEIVEDDATETS),0,0)
                WHERE
                    ID = :NEW.ID
                    IGNORE TRIGGER;
            END;
        IF NEW.ORGAPPID <> OLD.ORGAPPID THEN
          BEGIN
                SELECT COMPANY_FK
                    INTO :ORGCOMPANYID FROM OPER.COMPANY_APPLICATION WHERE :NEW.ORGAPPID = APPLICATION_FK;
                SELECT APPLICATIONTYPEID
                    INTO :ORGAPPTYPEID FROM OPER.APPLICATION WHERE :NEW.ORGAPPID = APPLICATION.ID;
                UPDATE
                    OPER.MESSAGE
                SET
                    ORGCOMPANYID = :ORGCOMPANYID,
                    ORGAPPTYPEID = :ORGAPPTYPEID
                WHERE
                    ID = :NEW.ID
                 IGNORE TRIGGER;
              END;
        IF NEW.DELIVERDATETS <> OLD.DELIVERDATETS THEN
          BEGIN
                UPDATE
                    OPER.MESSAGE
                SET
                    DELIVERDATEDATE = DATE(:NEW.DELIVERDATETS),
                    DELIVERDATEHOUR = MAKETIME(HOUR(:NEW.DELIVERDATETS),0,0)
                WHERE
                    ID = :NEW.ID
                 IGNORE TRIGGER;
            END;
        IF NEW.SENTDATETS <> OLD.SENTDATETS THEN
          BEGIN
                UPDATE
                    OPER.MESSAGE
                SET
                    SENTDATEDATE = DATE(:NEW.SENTDATETS),
                    SENTDATEHOUR = MAKETIME(HOUR(:NEW.SENTDATETS),0,0)
                WHERE
                    ID = :NEW.ID
                    IGNORE TRIGGER;
            END;
    )