Results 1 to 4 of 4

Thread: Insert Error

  1. #1
    Join Date
    Jan 2009
    Posts
    153

    Unanswered: 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

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Can you post the code that is causing the error ?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jan 2009
    Posts
    153
    Actullay I am getting error from the application

  4. #4
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    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.
    Last edited by Peter.Vanroose; 07-06-09 at 07:22.
    --_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
  •