2

I am trying to retrieve thexml from oracle db and then trying to insert the same xml into the Oracle Database different table. The select via clob is working fine but its throwing an error while updation.

java.sql.Clob myClob = null;
connect = DriverManager.getConnection(str2, str3, str4);
String sql = "select xml from table1 where id='3|32'";
stmt = connect.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
    myClob = rs.getClob("XML"); // This part is working fine.


    //Updation


    connect1 = DriverManager.getConnection(str22, str33, str44);
    String query1 = "update documentsout set xml = ?   " +
        "where  id = ? ";
    stmt1 = connect1.prepareStatement(query1);
    stmt1.setString(1, myClob); // Inserting the same CLOB
    stmt1.setString(2, id);
    stmt1.executeUpdate();      // ERROR HERE

The error is

java.sql.SQLException: ORA-00600: internal error code, arguments: [kglgtbo1], [0x700000482AA4608], [], [], [], [], [], [], [], [], [], []

Can you please help?

2
  • what version of oracle are you using? Commented Aug 29, 2013 at 13:41
  • @Gourav were you able to figure this out? I'm suffering the same problem (albeit for an insert). .setString() & .setClob() - neither working for me. Commented Jan 5, 2017 at 18:33

4 Answers 4

2

You should contact your DBA and/or Oracle support representative. According to the documentation on this ORA-00600 error, this is actually an internal problem with Oracle itself.

Source: http://www.orafaq.com/wiki/ORA-00600

Sign up to request clarification or add additional context in comments.

Comments

0

use this

stmt.setClob(position, clob);

instead of

 stmt1.setString(1, myClob);

3 Comments

I did try with set clob also
stmt1.setClob(1, myClob); but same result
stackoverflow.com/questions/5549450/… , see this may be it help you
0

you will have to use the setClob method

  // get clob
  java.sql.Clob clob = (java.sql.Clob) rs.getObject(1);

  // set clob
  String query = "insert into clob_table(id, clob_column) values(?, ?)";
  pstmt = conn.prepareStatement(query);
  pstmt.setString(1, newID);
  pstmt.setClob(2, clob);

1 Comment

Rakesh....as I stated in my last comment...i did try setClob but it still doesn't work
0

This may have limitations, but it worked for my situation. Below, srcValue is the value read from the source (src), which was a clob field, and stmt is the prepared statement i'm using (in my case, an insert). The target (tgt) is also a clob field.

        Clob srcClob = (Clob)srcValue;
        Clob tgtClob = stmt.getConnection().createClob();
        tgtClob.setString(1, srcClob.getSubString(1, (int)srcClob.length()));
        stmt.setClob(icol, tgtClob);

I believe clobs are tied to connections/sessions in some way, which requires the workaround. If there's a better way I'm all ears.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.