Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> ORA-01002-Error in Select ... for update

ORA-01002-Error in Select ... for update

From: Uwe Sonntag <Uwe.Sonntag_at_mms-dresden.telekom.de>
Date: Thu, 13 Jan 2000 12:12:35 +0100
Message-ID: <387DB322.78AEB868@mms-dresden.telekom.de>


I would like to insert CLOB in a table (VP_EVENTS) with a primary key (eventid) with the following code:

...
String content = "AAAAAAAAAAAAABBBBBBBBBBXXX"; PreparedStatement cs = this.con.prepareStatement("INSERT INTO vp_events (eventid,term,participant) VALUES (?,?,empty_clob())");

// Register IN-Parameter
cs.setInt(1, 1);
cs.setTimestamp(2, new java.sql.Timestamp( System.currentTimeMillis() ));

//Execute statement
cs.execute();
cs.close();

Statement stmt = con.createStatement(); ResultSet clobLocatorSet = stmt.executeQuery( "SELECT PARTICIPANT FROM VP_EVENTS WHERE EVENTID=1 FOR UPDATE"); // Get the CLOB-locator
if (clobLocatorSet.next())
{

    oracle.sql.CLOB clob =
((oracle.jdbc.driver.OracleResultSet)clobLocatorSet).getCLOB(1);

// Write CLOB-Data
// The first parameter to plsql_write, is // the offset from which
to start

// writing, and the second parameter is the // data to be written.
// plsql_length(), returns the length of // the data in the CLOB
column

    countCLOB = clob.plsql_write(0,content.toCharArray()); }

...

At the execution-point of the "Select for Update"-statement the oracle thin driver throws the Error "Fetch out of sequence ORA-01002".

What's wrong?

Thanks in advance.

With best regards

Uwe Sonntag

Multimedia Software GmbH | http://www.mms-dresden.de

Dresden                  | Email: Uwe.Sonntag_at_telekom.de
Riesaer Straße 5         | Phone: +49 351/8505-369
01129 Dresden            | Fax :  +49 351/8505-833


Received on Thu Jan 13 2000 - 05:12:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US