Re: XMLType insert

From: Rakesh Patel <patelrk210_at_yahoo.com>
Date: 8 Dec 2003 21:20:41 -0800
Message-ID: <7c12dbc1.0312082120.435f2609_at_posting.google.com>


Hi rabbit,

Go to the above link:
http://www.quest-pipelines.com/newsletter-v3/0702_C.htm

Raeards,
Rakesh

zhoudiwen_at_hotmail.com (rabbit) wrote in message news:<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 Tue Dec 09 2003 - 06:20:41 CET

Original text of this message