473,403 Members | 2,183 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

XMLType insert

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
Jul 19 '05 #1
1 14373
Hi rabbit,

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

Raeards,
Rakesh

zh*******@hotmail.com (rabbit) wrote in message news:<6a*************************@posting.google.c om>...
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

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Abhinav | last post by:
Hi .. I have the following sort of xml (In an xmlType in the database ..) <or_group> <operand>a</operand> <operand> <and_group> <operand>b</operand>
4
by: Bradley Plett | last post by:
I have a relatively simple xsd which I am turning into a class using "xsd.exe". I then create a collection of these classes. I have run into one minor problem. When serializing my collection, I...
0
by: Daniel Lidström | last post by:
Hi, for what reason do I put XmlType and XmlRoot attributes on classes for XML serialization? I understand the reason for the top element, but not why it is sometimes put for child elements. ...
1
by: ChrisHarrington | last post by:
I load an XmlDocument which has an inline schema. I want to use XmlType property of XPathNavigator to get the type according to this inline schema. But XmlType is null for all nodes. I tried...
2
by: =?Utf-8?B?Tm9yZW1hYw==?= | last post by:
Hi. Using VS2005, .NET 2.0. I have an xml document that I want to go through and set the values on attributes of elements. The elements are complex types defined in my schema (xsd) files. ...
2
by: stepby | last post by:
Hi All, In the Oracle, there is a datatype called XMLTYPE. I would like to ask is it possible to get back the xml database by ASP ? What kinds of object can be used ? Thanks stepby
0
by: stepby | last post by:
Hi All, I am using the ASP as the server side language. I would like to ask how to retrieve the whole xml form the xmltype datatype in the database. I have found some SQL example to retrieve...
0
by: =?Utf-8?B?bW90eWxpaw==?= | last post by:
I want to expose my classes via web services in a different format. Using XmlAttributeAttribute and XmlElementAttribute works fine. But XmlType does not in all cases. If I have a class decl: ...
1
by: rabbit | last post by:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.