SQL Error for DB2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ladysystek
    New Member
    • Aug 2012
    • 1

    SQL Error for DB2

    Code:
    CREATE TRIGGER TESTDTA.WO_INSERT
    
            AFTER INSERT ON TESTDTA.F4801
    
            FOR EACH ROW MODE DB2ROW 
    
    BEGIN        
    
    INSERT INTO TESTDTA.F564801 A 
    
    SET (A.WHDOCO) = (SELECT B.WADOCO FROM TESTDTA.F4801 B WHERE B.WADOCO = A.WHDOCO)
    
    END




    SQL State: 42601

    Vendor Code: -199

    Message: [SQL0199] Keyword SET not expected. Valid tokens: ROWS. Cause . . . . . : The keyword SET was not expected here. A syntax error was detected at keyword SET. The partial list of valid tokens is ROWS. This list assumes that the statement is correct up to the unexpected keyword. The error may be earlier in the statement but the syntax of the statement seems to be valid up to this point. Recovery . . . : Examine the SQL statement in the area of the specified keyword. A colon or SQL delimiter may be missing. SQL requires reserved words to be delimited when they are used as a name. Correct the SQL statement and try the request again.
    Last edited by Rabbit; Aug 4 '12, 06:03 AM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code.

    The INSERT statement doesn't use the SET key word, the UPDATE statement uses it.

    Comment

    Working...