Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    5

    Unanswered: Error on Select Into statement

    Hello,

    I'm getting an error while executing the following statement in an after insert trigger:

    select level1,level2,level3,level4 into l1,
    l2,l3,l4 from Z_Documents_Types_Levels where id = n.ParentID;

    The error: SQL0104N An unexpected token "l1" was found following "2,level3,level4 into"

    Is this a syntax error and if so what is the correct way to do it ?

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Yes this is a syntax error, and the correct way of doing it would be to look up the correct syntax in the manual.

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    In an "after insert" trigger you probably want to do either an insert or an update of an (other) table.

    "Select .. INTO" is only used in embedded SQL, not typically in triggers.
    --_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
  •