Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> ORA-01002-Error in Select ... for update
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-833Received on Thu Jan 13 2000 - 05:12:35 CST
![]() |
![]() |