If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Error on Select Into statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-06-06, 10:31
Syncho Syncho is offline
Registered User
 
Join Date: May 2006
Posts: 5
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
Reply With Quote
  #2 (permalink)  
Old 06-06-06, 12:10
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Yes this is a syntax error, and the correct way of doing it would be to look up the correct syntax in the manual.
Reply With Quote
  #3 (permalink)  
Old 06-06-06, 12:46
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
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/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On