Home » Developer & Programmer » JDeveloper, Java & XML » CLOB missing values from XMLType (Oracle DB, EE)
CLOB missing values from XMLType [message #359892] Tue, 18 November 2008 09:24
Messages: 1
Registered: November 2008
Junior Member
Hello everyone,

the scenario goes like this:
1) I've created a table based on a .xsd schema. I plan on using it to store XMLtype objects.
create table xml_type_table OF XMLTYPE 
   XMLSCHEMA "http://my_schema.xsd" ELEMENT "Elem";

2) I get a CLOB value from an outside system. This CLOB is special in a way that it lacks one element called <vendor> that is registered in the schema I mentioned above.

3) I convert CLOB to an XMLType and I store it into the table xml_type_table .
insert into xml_type_table values (l_xmltype);

4) The point of all this: I need to update that record with a vendor name, so I do a simple update statement. Commit. When I query the "vendor" tag from the table I get the value I updated the record with.
update xml_type_table p 
   set   p.xmldata."vendor" = 'New_vendor'
   where p.xmldata."ID"='10850';

select   p.xmldata."vendor" -- returns the new updated vendor
from     xml_type_table p
where    p.xmldata."ID"='10850';

5) The problem: when I try to get the CLOB value of that XMLType I'm missing the <vendor> tag.
   select   value(p).getclobval() 
   from     xml_type_table p 
   where    p.xmldata."ID"='10850';

Why am I missing the <vendor> tag in my CLOB even though I've 'successfully' updated the XMLType?

Previous Topic: Customized XML Ouput
Next Topic: How to use left outer joins ,right outer joins and order by clause for below query (merged)
Goto Forum:

Current Time: Sat Apr 01 06:47:45 CDT 2023