XMLType insert

From: rabbit <zhoudiwen_at_hotmail.com>
Date: 8 Dec 2003 14:32:40 -0800
Message-ID: <6a950fe.0312081432.6182bb82_at_posting.google.com>


Hi all,
I want to know, how can i insert the xml data using createXML() with CLOB in the xmltype column?

I store the xml data at first in the clob column und want to import these data in the xmltype column in another table. But i get always the error message:
java.sql.SQLException:
ORA-00600: internal error code, arguments: [733], [67107908], [pga heap], [], [], [], [], []
ORA-06512: in "SYS.XMLTYPE", line 0
ORA-06512: in line 1

My programm source code:

CREATE TABLE clobtable(id int PRIMARY KEY not null, xml_dok CLOB)

CREATE TABLE xmltable(id int CONSTRAINT xml_index PRIMARY KEY not null, xml_dok SYS.XMLTYPE)

PreparedStatement pstmt_clob = con.prepareStatement("INSERT INTO clobtable VALUES(?, ?)");
File fil = new File(path + "xml_ordner" + i); String fil_list[] = fil.list();
int fanzahl = fil_list.length;
for (int f = 0; f < fanzahl; f++) {
f_ordner[f+1] = new File(path + "xml_ordner" + i + "//" + fil_list[f]);

pstmt_clob.setInt(1, f+1);
pstmt_clob.setCharacterStream(2, new
java.io.FileReader(f_ordner[f+1]), (int)f_ordner[+1].length());

pstmt_clob.execute();
}

PreparedStatement pstmt_xml = con.prepareStatement("INSERT INTO xmltable VALUES(?, null)");
OracleResultSet rs = (OracleResultSet)stmt.executeQuery("SELECT * FROM clobtable");
while (rs.next()){
int nr = rs.getInt(1);
pstmt_xml.setInt(1, nr); //id
pstmt_xml.execute();

PreparedStatement pstmt = con.prepareStatement("UPDATE xmltable SET xml_dok = SYS.XMLType.createXML(?) WHERE id = ?"); // I have tried to use SYS.XMLType(?). But i get the same error.

pstmt.setClob(1, rs.getCLOB(2));
pstmt.setInt(2, nr);
pstmt.execute();
pstmt.close();

}

I don't know, what's wrong with it? Please help! Must I use the Connection parameter for cretaeXML und XMLType? Some Examples use it, but any not. Which is correct?

Thank you very much and greeting from germany!

rabbit Received on Mon Dec 08 2003 - 23:32:40 CET

Original text of this message