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 > Insert Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-02-09, 10:50
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Insert Error

Hi Experts,

I am gettig error when i tried to insert data.

Could not obtain sequence value; nested exception is java.sql.SQLException: [SQL0029] INTO clause missing from embedded statement.

Please help

TIA
Reply With Quote
  #2 (permalink)  
Old 07-02-09, 11:02
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,530
Can you post the code that is causing the error ?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 07-06-09, 01:34
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Actullay I am getting error from the application
Reply With Quote
  #4 (permalink)  
Old 07-06-09, 06:17
Peter.Vanroose Peter.Vanroose is online now
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,077
Quote:
Originally Posted by ratheeshknair
[SQL0029] INTO clause missing from embedded statement.
I assume this is SQLJ.
Try adding "INTO :varname" between your SELECT and FROM clauses,
where "varname" is the name of the Java variable into which you want the data to be returned.
If you SELECT clause contains multiple columns, you will need multiple variables:
Code:
#sql {
SELECT col1, col2
INTO :var1, :var2
FROM mytable
WHERE ...
};
See e.g. Example 3 on page 882 of the SQL Reference, Volume 2, for DB2 9.5 LUW.
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/

Last edited by Peter.Vanroose; 07-06-09 at 06:22.
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