ORA-22805 - (inserting an XMl type FAILS) I suspect this is a oracle Bug

We're using
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
Basically when I try to execute the following
dbms_xmlschema.registerschema
('MySchema.xsd',
sys.UriFactory.getUri('/Location/MySchema.xsd'),
genTables=>TRUE);
this generates a table for us with the name "xmlt_ds_0"
when we try to insert into this table, we get an error
INSERT INTO tddb.xmlt_ds_0
SELECT sys.xmltype.createschemabasedxml(mq.content, 'http://My.Schema.xsd')
FROM message_queue mq
WHERE mq.sys_id = 148100
ORA-22805: cannot insert NULL object into object tables or nested tables
Now this works for most xml files, it just one or two that fail, however these files that have failed are well formed, and valid (ie: conform to the scehema)
however, if I try to do this
create table tempTest of xmltype
XMLSCHEMA "Myschema.xsd"
ELEMENT "schedule"
then insert into this
INSERT INTO tempTest
SELECT sys.xmltype.createschemabasedxml(mq.content, 'http://My.Schema.xsd')
FROM message_queue mq
WHERE mq.sys_id = 148100
Basically, this works for the same file, I just dont understand why it wouldn't work in the "resitering the schema" way. I strongly suspect this is a Oracle Bug
Has any one encountered this before, any help would be appriciated.

FIRST of all...
If you create the table via registerschema, then you table will be created case-sensitive (in general take notice that with XMLDB everything can be / will be case-sensitive). So this means you will have to do things the following way (mark the double quotes):
NSERT INTO tddb."xmlt_ds_0"
SELECT sys.xmltype.createschemabasedxml(mq.content, 'http://My.Schema.xsd')
FROM message_queue mq
WHERE mq.sys_id = 148100Your statement (see below) will generate a table the default way, that is a table in uppercase
create table tempTest of xmltype
XMLSCHEMA "Myschema.xsd"
ELEMENT "schedule"so ...this will create a table with the name "TEMPTEST".
regarding the ORA-22805...
- can you post the schema
- can you post the values that cause the error...

Similar Messages

  • Insertion in XML Type table and fetching the data in Pro*C

    I have a Pro*C program written which populate one temp table. That temp table is used for writing the records to a flat file and then the table is purged by this program itself. Now my requirement is to write a new procedure in this progarm which simultaneously populate new XML Type table. Also i have to write some other procedures/functions to query the XML type table
    in Pro*C. I am new to XML part of database. Could somebody suggest how to go ahead with this problem

    Please check the Oracle Database 10g: XML DB Developer's Guild for example.

  • Any way to insert the XML generated from dataTable into the oracle?

    Hi guys,
    I want to know if there is a way to insert the XML generated from dataTable(dataTable.GetXML()) into the oracle?
    Thanks in advance,

    There is o extractor to load assessment cycles; instead you can load dtaa after the assesment cycle is complte in R/3. You can schdeule the job in BW accordingly.
    May I know what exactly is the requirement.
    Ravi Thothadri

  • Getting ORA-22805 when trying to load XML file using SQLLDR

    I'm trying to learn the basics of XML since we'll be getting XML files in the near future. I'm using one of the sample schemas that comes with XMLSPY. I loaded this schema into an 11g Oracle DB using XMLSPY:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XML Spy v4.0 NT beta 1 build Jun 13 2001 (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ipo="http://www.altova.com/IPO" targetNamespace="http://www.altova.com/IPO" elementFormDefault="unqualified" attributeFormDefault="unqualified">
         <annotation>
              <documentation>
    International Purchase order schema for Example.com
    Copyright 2000 Example.com. All rights reserved.
    </documentation>
         </annotation>
         <!-- include address constructs -->
         <include schemaLocation="address.xsd"/>
         <element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
         <element name="comment" type="string"/>
         <complexType name="PurchaseOrderType">
              <sequence>
                   <element name="shipTo" type="ipo:Address"/>
                   <element name="billTo" type="ipo:Address"/>
                   <element ref="ipo:comment" minOccurs="0"/>
                   <element name="Items" type="ipo:Items"/>
              </sequence>
              <attribute name="orderDate" type="date"/>
         </complexType>
         <complexType name="Items">
              <sequence>
                   <element name="item" minOccurs="0" maxOccurs="unbounded">
                        <complexType>
                             <sequence>
                                  <element name="productName" type="string"/>
                                  <element name="quantity">
                                       <simpleType>
                                            <restriction base="positiveInteger">
                                                 <maxExclusive value="100"/>
                                            </restriction>
                                       </simpleType>
                                  </element>
                                  <element name="price" type="decimal"/>
                                  <element ref="ipo:comment" minOccurs="0"/>
                                  <element name="shipDate" type="date" minOccurs="0"/>
                             </sequence>
                             <attribute name="partNum" type="ipo:Sku"/>
                        </complexType>
                   </element>
              </sequence>
         </complexType>
         <simpleType name="Sku">
              <restriction base="string">
                   <pattern value="\d{3}-[A-Z]{2}"/>
              </restriction>
         </simpleType>
    </schema>
    Then I created an XMLType table:
    CREATE TABLE purchaseOrder OF XMLType
    XMLSCHEMA "ipo.xsd" ELEMENT "purchaseOrder"
    I'm trying to load the sample XML file ipo.xml into purchaseOrder using SQLLDR. This is ipo.xml:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Mr. Nobody (Altova GmbH) -->
    <ipo:purchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ipo="http://www.altova.com/IPO" orderDate="1999-12-01" xsi:schemaLocation="http://www.altova.com/IPO
    ipo.xsd">
         <shipTo export-code="1" xsi:type="ipo:EU-Address">
              <ipo:name>Helen Zoe</ipo:name>
              <ipo:street>47 Eden Street</ipo:street>
              <ipo:city>Cambridge</ipo:city>
              <ipo:postcode>126</ipo:postcode>
         </shipTo>
         <billTo xsi:type="ipo:US-Address">
              <ipo:name>Robert Smith</ipo:name>
              <ipo:street>8 Oak Avenue</ipo:street>
              <ipo:city>Old Town</ipo:city>
              <ipo:state>AK</ipo:state>
              <ipo:zip>95819</ipo:zip>
         </billTo>
         <Items>
              <item partNum="833-AA">
                   <productName>Lapis necklace</productName>
                   <quantity>2</quantity>
                   <price>99.95</price>
                   <ipo:comment>Need this for the holidays!</ipo:comment>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="748-OT">
                   <productName>Diamond heart</productName>
                   <quantity>1</quantity>
                   <price>248.90</price>
                   <ipo:comment>Valentine's day packaging.</ipo:comment>
                   <shipDate>2000-02-14</shipDate>
              </item>
              <item partNum="783-KL">
                   <productName>Uncut diamond</productName>
                   <quantity>7</quantity>
                   <price>79.90</price>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="238-KK">
                   <productName>Amber ring</productName>
                   <quantity>3</quantity>
                   <price>89.90</price>
                   <ipo:comment>With no inclusions, please.</ipo:comment>
                   <shipDate>2000-01-07</shipDate>
              </item>
              <item partNum="229-OB">
                   <productName>Pearl necklace</productName>
                   <quantity>1</quantity>
                   <price>4879.00</price>
                   <shipDate>1999-12-05</shipDate>
              </item>
              <item partNum="128-UL">
                   <productName>Jade earring</productName>
                   <quantity>5</quantity>
                   <price>179.90</price>
                   <shipDate>2000-02-14</shipDate>
              </item>
         </Items>
    </ipo:purchaseOrder>
    This is what's in the control file:
    LOAD DATA
    INFILE *
    INTO TABLE purchaseOrder TRUNCATE
    xmltype(xmldata)
    FIELDS
    xmldata LOBFILE (CONSTANT ipo.xml)
    BEGINDATA
    0
    The load fails with:
    Record 1: Rejected - Error on table PURCHASEORDER.
    ORA-22805: cannot insert NULL object into object tables or nested tables
    Another question I have is, how do we know how many records (0's) to specify in the control file? In this case there's only one but when real files are used we won't know how many are in the file.
    Thanks for your help!

    The concept was "Don't use SQL*Loader to parse XML".
    You can use SQL*Loader to load an entire XML document into the DB. That is fine. You can do the same via BFILENAME to read in files from disk as well.
    If you want to parse XML, do that from within Oracle via PL/SQL and/or SQL. The solution depends upon your version of Oracle and what is good enough for you in terms of performance.
    So the basics are
    a) How am I getting the information?
    b) How am I getting in into Oracle?
    c) How do I want to parse it?
    As I see the schema, it only allows for one ipo:purchaseOrder node in the document, since that is the root node. If you have multiple in the incoming file, you no longer have valid XML, both per the schema and because you have no single root node. You have an XML fragment, which must be treated different.
    Just trying to understand the question since I now realize it does not agree with what the schema in your initial example shows.

  • ORA-19007 when coping a table with an xml type in it to a new schema in the

    ORA-19007 when coping a table with an xml type in it to a new schema in the same database.
    Hi all,
    When I copy a table with an xml type in it to a new schema in the same database I get an ora-19009.
    The setup is as follows I have a schema a with table TABLE_WITH_XMLTYPE where data is:
    CREATE
    TABLE TABLE_WITH_XMLTYPE
    FOLDER_ID NUMBER (10, 0) NOT NULL,
    SEARCH_PROPERTIES XMLTYPE ,
    CONSTRAINT TABLE_WITH_XMLTYPE PK PRIMARY KEY (FOLDERID) USING INDEX
    XMLTYPE COLUMN SEARCH_PROPERTIES XMLSCHEMA
    "http://xxxxxxx.net/FolderProperties.xsd" element "FolderProperties"
    VARRAY SEARCH_PROPERTIES."XMLDATA"."PROPERTIES"."PROPERTY" STORE AS TABLE
    PROPERTY_TABLE
    (PRIMARY KEY (NESTED_TABLE_ID, ARRAY_INDEX)) ORGANIZATION INDEX OVERFLOW
    Both schemas have the following xml schema registered as a local xml schema
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://xxxxxxx.net/FolderProperties.xsd',
    SCHEMADOC =>
    '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xdb="http://xmlns.oracle.com/xdb"
    xdb:storeVarrayAsTable="true">
    <xs:element name="FolderProperties"
    type="FolderPropertiesType"
    xdb:defaultTable="FOLDER_SEARCH_PROPERTIES" />
    <xs:complexType name="FolderPropertiesType" xdb:SQLType="FOLDERPROPERTIES_T">
    <xs:sequence>
    <xs:element name="FolderID" type="FolderIDType" minOccurs="1" xdb:SQLName="FOLDER_ID"/>
    <xs:element name="Properties" type="PropertiesType" xdb:SQLName="PROPERTIES"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="PropertiesType" xdb:SQLType="PROPERTIES_T">
    <xs:sequence>
    <xs:element name="Property" type="PropertyType" maxOccurs="unbounded"
    xdb:SQLName="PROPERTY" xdb:SQLCollType="PROPERTY_V"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="PropertyType" xdb:SQLType="PROPERTY_T">
    <xs:sequence>
    <xs:element name="DateValue" type="DateType" xdb:SQLName="DATE_VALUE"/>
    <xs:element name="NumValue" type="NumType" xdb:SQLName="NUM_VALUE"/>
    <xs:element name="StringValue" type="StringType" xdb:SQLName="STRING_VALUE"/>
    </xs:sequence>
    <xs:attribute name="Name" xdb:SQLName="NAME" xdb:SQLType="VARCHAR2">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1"/>
    <xs:maxLength value="255"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    </xs:complexType>
    <xs:simpleType name="FolderIDType">
    <xs:restriction base="xs:integer"/>
    </xs:simpleType>
    <xs:simpleType name="DateType">
    <xs:restriction base="xs:dateTime"/>
    </xs:simpleType>
    <xs:simpleType name="NumType">
    <xs:restriction base="xs:decimal"/>
    </xs:simpleType>
    <xs:simpleType name="StringType">
    <xs:restriction base="xs:string" />
    </xs:simpleType>
    </xs:schema>',
    LOCAL => TRUE,
    GENTYPES => TRUE,
    GENTABLES => FALSE);
    END;
    when I try to do the following insert:
    insert into schemaB.TABLE_WITH_XMLTYPE ( FOLDER_ID, SEARCH_PROPERTIES)
    select FOLDER_ID, SEARCH_PROPERTIES from schemaB.TABLE_WITH_XMLTYPE;
    I’ll get an ora-19007.
    Can some one point me in the right direction how to solve this error.
    Thanks Roelof.

    Who did you create the second table, in other words, how did you COPY the table as you said...
    If you created the second table via a CTAS (create table as select) then you will have created a table that is not the same as the original one. AFAIK I have once created an enhancement request for this after discovering that JDeveloper, for example, creates a "copy" via a CTAS which creates the wrong structure. Double check via package DBMS_METADATA.
    SQL> set long 1000000
    SQL> select DBMS_METADATA('TABLE','TABLE_WITH_XMLTYPE','SchemaA') from dual;
    SQL> select DBMS_METADATA('TABLE','TABLE_WITH_XMLTYPE','SchemaB') from dual;If you have got two different tables, than Mark's solution should help.
    M.
    Edited by: Marco Gralike on Feb 15, 2009 11:16 AM

  • Calling Web Service from PL/SQL (ORA-31011: XML parsing failed)

    hi all,
    i want to invoke a web service from PL/SQL.
    i found a soap_api package from "Tim Hall".
    but it gives error in "ealtas.soap_api.invoke function"
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00007: unexpected end-of-file encountered
    ORA-06512: at "SYS.XMLTYPE", line 48
    ORA-06512: at "EALTAS.SOAP_API", line 135
    ORA-06512: at line 44
    set scan off;
    declare
    P_ADRES_WS VARCHAR2(100) := 'http://<host>:<port>/dswsbobje/qaawsservices/biws?wsdl=1&cuid=AVhBxL14I2dDjz8yFoznRLY';
    P_ENVELOPE VARCHAR2(32767);
    P_FNC VARCHAR2(256) := 'runQueryAsAService';
    ol_req ealtas.soap_api.t_request;
    ol_resp ealtas.soap_api.t_response;
    message varchar2(500);
    BEGIN
    p_envelope := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:db="DB_SUBS_BUDGET">
    <soapenv:Body>
    <db:runQueryAsAService>
    <db:login>DWH_BO</db:login>
    <db:password>Pass1234</db:password>
    </db:runQueryAsAService>
    </soapenv:Body>
    </soapenv:Envelope>
    ol_req := ealtas.soap_api.new_request(P_FNC, 'xmlns="'||P_ADRES_WS||'"');
    ol_resp := ealtas.soap_api.invoke(ol_req, P_ADRES_WS, p_fnc,P_ENVELOPE);
    ealtas.soap_api.show_envelope(p_envelope);
    message := ealtas.soap_api.get_return_value(ol_resp, 'Db_Timeid', 'xmlns:m="'||P_ADRES_WS||'"');
    DBMS_OUTPUT.PUT_LINE('AAAA -'||message);
    end;
    thanks.
    ealtas.

    AlexAnd thanks for your help.
    ACL is ok.
    can you help me about how can i edit this function. i tried many times but i could not do it :( .
    web service url : <host>:<port>/dswsbobje/qaawsservices/biws?WSDL=1&cuid=AVhBxL14I2dDjz8yFoznRLY
    what must be these variables values ?
    l_url :=
    l_namespace :=
    l_method :=
    l_soap_action :=
    l_result_name :=
    this is the xml;
    <?xml version="1.0" encoding="UTF-8" ?>
    - <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="DB_SUBS_BUDGET" xmlns:tns1="dsws.businessobjects.com" targetNamespace="DB_SUBS_BUDGET" xmlns="http://schemas.xmlsoap.org/wsdl/" name="queryasaservice">
    - <types>
    - <s:schema elementFormDefault="qualified" targetNamespace="DB_SUBS_BUDGET">
    - <s:element name="runQueryAsAService">
    - <s:complexType>
    - <s:sequence>
    <s:element name="login" type="s:string" />
    <s:element name="password" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:complexType name="Row">
    - <s:sequence>
    <s:element name="Db_Timeid" type="s:string" nillable="true" />
    <s:element name="Db_Tariff" type="s:string" nillable="true" />
    <s:element name="Grossadds" type="s:double" nillable="true" />
    <s:element name="Cancellations" type="s:double" nillable="true" />
    <s:element name="Netadds" type="s:double" nillable="true" />
    <s:element name="Subs" type="s:double" nillable="true" />
    <s:element name="Churn_P" type="s:double" nillable="true" />
    </s:sequence>
    </s:complexType>
    - <s:complexType name="Table">
    - <s:sequence>
    <s:element name="row" maxOccurs="unbounded" type="s0:Row" />
    </s:sequence>
    </s:complexType>
    - <s:element name="runQueryAsAServiceResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element name="table" type="s0:Table" />
    <s:element name="message" type="s:string" />
    <s:element name="creatorname" type="s:string" />
    <s:element name="creationdate" type="s:dateTime" />
    <s:element name="creationdateformated" type="s:string" />
    <s:element name="description" type="s:string" />
    <s:element name="universe" type="s:string" />
    <s:element name="queryruntime" type="s:int" />
    <s:element name="fetchedrows" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="QaaWSHeader">
    - <s:complexType>
    - <s:sequence>
    <s:element name="sessionID" type="s:string" minOccurs="0" maxOccurs="1" nillable="true" />
    <s:element name="serializedSession" type="s:string" minOccurs="0" maxOccurs="1" nillable="true" />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </types>
    - <message name="runQueryAsAServiceSoapIn">
    <part name="parameters" element="s0:runQueryAsAService" />
    <part name="request_header" element="s0:QaaWSHeader" />
    </message>
    - <message name="runQueryAsAServiceSoapOut">
    <part name="parameters" element="s0:runQueryAsAServiceResponse" />
    </message>
    - <portType name="QueryAsAServiceSoap">
    - <operation name="runQueryAsAService">
    <documentation>Get Web Service Provider server info</documentation>
    <input message="s0:runQueryAsAServiceSoapIn" />
    <output message="s0:runQueryAsAServiceSoapOut" />
    </operation>
    </portType>
    - <binding name="QueryAsAServiceSoap" type="s0:QueryAsAServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <operation name="runQueryAsAService">
    <soap:operation soapAction="DB_SUBS_BUDGET/runQueryAsAService" style="document" />
    - <input>
    - <soap:header message="s0:runQueryAsAServiceSoapIn" part="request_header" use="literal">
    <soap:headerfault message="s0:runQueryAsAServiceSoapIn" part="request_header" use="literal" />
    </soap:header>
    <soap:body use="literal" parts="parameters" />
    </input>
    - <output>
    <soap:body use="literal" />
    </output>
    </operation>
    </binding>
    - <service name="DB_SUBS_BUDGET">
    <documentation />
    - <port name="QueryAsAServiceSoap" binding="s0:QueryAsAServiceSoap">
    <soap:address location="http://<host>:<port>/dswsbobje/qaawsservices/queryasaservice?&cuid=AVhBxL14I2dDjz8yFoznRLY&authType=secEnterprise&locale=en_US&timeout=60&ConvertAnyType=false" />
    </port>
    </service>
    </definitions>

  • ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing L

    Hi There,
    I am trying to load XML data [Given Below] into a table using "Load XML Data" option.
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <ID>13</ID>
    <TYPE_SEQ>8</TYPE_SEQ>
    <TYPE>B749</TYPE>
    <TYPE_DESC>B758</_TYPE_DESC>
    <EFFECTIVE_FROM>2099-01-01</EFFECTIVE_FROM>
    <EFFECTIVE_TO>2099-01-01</EFFECTIVE_TO>
    <CREATED_BY>958344</CREATED_BY>
    <CREATED_ON>2099-01-01</CREATED_ON>
    <UPDATED_BY>172283</UPDATED_BY>
    <UPDATED_ON>2099-01-01</UPDATED_ON>
    </ROW>
    </ROWSET>
    It throws the following error.
    ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00222: error received from SAX callback function
    Can any one advice the solution please.
    -Sudheer.

    Hi Sudheer,
    This is caused by the date format you are using. Probably it is not matching with your NLS settings. Check your NLS settings, what the date format is, and use that in the XML.
    Check it with this code:
    SELECT XMLELEMENT("date", sysdate) FROM dual;Make sure, you have your NLS_DATE settings in the same format.
    Check it with:
    SELECT * FROM v$nls_parameters WHERE parameter = 'NLS_DATE_FORMAT'And then make sure it is the same by setting for example:
      ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD';Greetings,
    Rutger

  • [Oracle JDBC Driver][Oracle]ORA-31011: XML parsing failed

    Hi,
    I have got the following error when i tired to upload an XML file in my application. My application will insert the XML file in to Oracle 10g data base table. (Our DB server is Oracle 10g).
    The error is as follows:-
    [BEA][Oracle JDBC Driver][Oracle]ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00004: internal error "MultiChar overflow"
    Error at line 20795
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    The XML file contains more than 90,000 lines in it. Please help.
    Thanks!
    Siva K.

    Is this a specific problem with 10G release? We are using 10.2.0.4.0.
    Using CLOB, We think that this may hit the performance of the application as we are using large XML files.

  • URGENT HELP !!! ORA-31011: XML parsing failed

    Hi,
    Oracle 9.2.0.4
    I've run into
    ORA-31011: XML parsing failed ORA-19202: Error
    occurred in XML processing LPX-00247: invalid
    Document Type Declaration (DTD) Error at line 1
    ORA-06512: at line 15
    during updateXML operation under CLOB resource.
    It seems to me, I can't update created resource
    at all.
    Is anybody knows the workaround ?
    Please, help !!!
    Thanks,
    Viacheslav

    No, it is an html file. For test purpose I've taken
    welcome.html from ORACLE_HOME installation. Here are
    my test:
    declare
    res0 bfile := BFILENAME('TEMPDIR', 'welcome.html');
    res clob;
    Amount INTEGER := 4000;
    b BOOLEAN;
    begin
    Amount:=DBMS_LOB.getlength(res0);
    DBMS_LOB.CREATETEMPORARY(res,TRUE);
    DBMS_LOB.OPEN(res0, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(res, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(res, res0,Amount);
    --DBMS_LOB.CLOSE(res0);
    b:=DBMS_XDB.createresource
    ('/MyCONTENT/welcome.html',res);
    commit;
    end;
    declare
    res0 bfile := BFILENAME('TEMPDIR', 'welcome.html');
    clob1 clob;
    amt number := dbms_lob.lobmaxsize;
    src_offset number := 1 ;
    dst_offset number := 1 ;
    lang_ctx number := dbms_lob.default_lang_ctx;
    warning number;
    Amount INTEGER := 4000;
    begin
    Amount:=DBMS_LOB.getlength(res0);
    DBMS_LOB.CREATETEMPORARY(clob1 ,TRUE);
    DBMS_LOB.OPEN(res0, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(clob1 , DBMS_LOB.LOB_READWRITE);
    -- DBMS_LOB.LOADFROMFILE(clob1 , res0,Amount);
    dbms_lob.LOADCLOBFROMFILE(clob1 ,res0, amt, dst_offset,
    src_offset,dbms_lob.default_csid, lang_ctx,warning) ;
    UPDATE xdb.resource_view SET res=updatexml
    (res,'/Resource/Contents/*',
    WHERE any_path= '/MyCONTENT/welcome.html';
    commit;
    --dbms_lob.filecloseall() ;
    end;

  • ORA-00600: inserting xml document

    I am getting an this error when inserting an xml document into Oracle.
    The schema below and sample xml document reproduce the problem.
    If I move the element named "theID" from the type "BaseObjectType"
    to "NextObjectType" and remove the extension declaration in this type
    all works ok. complete error is:
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [],
    Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    targetNamespace="http://www.x.com/test"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tes="http://www.x.com/test">
    <xs:complexType name="BaseObjectType" abstract="true">
    <xs:sequence>
    <xs:element name="theID" type="xs:string">
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NextObjectType" abstract="true">
    <xs:complexContent>
    <xs:extension base="tes:BaseObjectType">
    <xs:sequence>
    <xs:element name="title" type="xs:string">
    </xs:element>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RBaseType" abstract="true">
    <xs:complexContent>
    <xs:restriction base="tes:NextObjectType">
    <xs:sequence>
    <xs:element name="theID" type="xs:string"/>
    <xs:element name="title" type="xs:string"/>
    </xs:sequence>
    </xs:restriction>
    </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RType">
    <xs:complexContent>
    <xs:extension base="tes:RBaseType">
    <xs:sequence>
    <xs:element name="theName" type="xs:string">
    </xs:element>     
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="RObject" type="tes:RType"/>
    </xs:schema>
    Sample xml document:
    <?xml version="1.0" encoding="UTF-8"?>
    <RObject xmlns="http://www.x.com/test"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://localhost:8080:/test.xsd">
    <theID xmlns="">123</theID>
    <title xmlns="">title</title>
    <theName xmlns="">name</theName>
    </RObject>
    Register Schema call:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://localhost:8080/test.xsd',
    SCHEMADOC => bfilename('TMP3','test.xsd'),
    LOCAL => TRUE,
    GENTYPES => TRUE,
    GENTABLES => TRUE,
    CSID => nls_charset_id('AL32UTF8'));
    END;
    Insert xml document call:
    insert into "RObject566_TAB" values
    (XMLType(bfilename('TMP3','test.xml'),nls_charset_id('AL32UTF8')));
    Changing NextObjectType to this gets insert to work:
    <xs:complexType name="NextObjectType" abstract="true">
    <xs:sequence>
    <xs:element name="theID" type="xs:string"/>
    <xs:element name="title" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    Anyone else seen this?
    jcl.

    BTW: This is with Oracle 10.2.0

  • Getting "ORA-31011: XML parsing failed" using xmlAGG as rownum exceeds 1000

    I have a following script which is working and creating xml output when the rownum < 1000, but as the rownum <2000 clause is used, it is throwing "ORA-31011: XML parsing failed" error.
    There are about 2 million recirds that I need to extract in the xml file. Is there any way I can do that without creating 500 files?
    I am new in XML DB and any help/suggestion/input will be highly appreciated.
    Thanks.
    ---------------- script--------------------
    SET SERVEROUTPUT ON
    DECLARE
    v_xml              XMLTYPE;
    v_blob             BLOB;
    v_data_length      NUMBER;
    -- Loop Control Variables
    v_offset           NUMBER             DEFAULT 1;
    v_chunk   CONSTANT NUMBER             DEFAULT 4000;
    -- v_ctx   DBMS_XMLGen.ctxHandle;
    v_file  Utl_File.File_Type;
    BEGIN
    -- Create XML context.
        SELECT XMLELEMENT("COMBO_NETWORK", XMLAGG (IFC_BILL_LOC))
        INTO v_xml
        FROM (
        SELECT XMLELEMENT
            ("CLAIM",
             XMLFOREST(
            ib.clm_num as "CLM_NUM",
            NVL(ib.old_clm_num,' ') as "ALT_CLM_NUM",
            DECODE(ib.clm_stat_cde,1,'OPEN','CLOSED') as "CLM_STATUS",
            ib.SSN as "SSN",
            ib.CLMT_LAST_NAM as "LAST_NAME",
            ib.CLMT_FIRST_NAM as "FIRST_NAME",
            TO_CHAR(ib.CLMT_DOB,'RRRRMMDD') as "DOB",
            TO_CHAR(ib.CLMT_DOI,'RRRRMMDD') as "DOI",
            ib.ER_NAM as "EMPLOYER_NAME",
            sflo.cde  AS "DISTRICT_OFFICE",
            ib.ADD_UPDTE_DEL_FLG as "ADD_UPDATE_DELETE",
            XMLFOREST(ib.CLMT_FST_LINE_ADR||' '||ib.CLMT_SND_LINE_ADR  as "STREET",
                      ib.CLMT_CITY_ADR AS "CITY",
                      ib.CLMT_STATE_ADR as "STATE",
                      ib.CLMT_ZIP_CDE_ADR as "ZIP",
                      ' ' as "PHONE" ) AS "CLAIMNT_ADDRESS",
            DECODE(ib.CLMT_GENDER,1,'M',2,'F',' ') as "CLAIMNT_GENDER",
            XMLFOREST(ib.ADJ_LAST_NAM as "LAST_NAME",
                      ib.ADJ_FIRST_NAM as "FIRST_NAME",
                      au.PHONE_NUM as "PHONE",
                      au.USER_EMAIL as "EMAIL") as "ADJUSTER",
            NVL(ib.CATASTROPHE_FLG,'N') as "CATASTROPHE_FLAG"
        IFC_BILL_LOC
        FROM IFACE_BILL_CLAIM_TRANS ib, SCIF_LOCATIONS sflo, APPLICATION_USERS au
        WHERE ib.comb_transmit_dte IS NULL
        AND ib.SFLO_IDN = sflo.idn
        AND ib.adj_last_nam = UPPER(au.user_last_nam)
        AND ib.adj_first_nam = UPPER(au.user_first_nam)
        AND sflo.cde = 'NF'
        AND rownum < 1000);  -- Failes parsing as rownum < 2000 is used.
        -- Turn the XML into a BLOB
         v_blob := v_xml.getblobval (1);
         v_data_length := DBMS_LOB.getlength (v_blob);
        -- Output XML document to file.
          v_file := Utl_File.FOpen('/u08/test/testdev/interface/out', 'result1.xml', 'wb', v_chunk);
                LOOP
                EXIT WHEN v_offset > v_data_length;
                UTL_FILE.put_raw (v_file, DBMS_LOB.SUBSTR (v_blob, v_chunk, v_offset),
                                                                  TRUE);
                 v_offset := v_offset + v_chunk;
                END LOOP;
                    Utl_File.FClose(v_file);
            EXCEPTION
              WHEN NO_DATA_FOUND
              THEN
              -- We won't write any data, or even open the file,
              -- if the query return no rows
              NULL;
              END;
    --------------------- script end--------------------------
    Following is the version of  y database:
    SQL> col comp_name format a45
    SELECT comp_name, status, substr(version,1,10) as version
    FROM dba_registry;
    SQL> SQL>   2
    COMP_NAME                                     STATUS      VERSION
    Oracle Database Catalog Views                VALID       10.2.0.4.0
    Oracle Database Packages and Types       VALID       10.2.0.4.0
    JServer JAVA Virtual Machine                  VALID       10.2.0.4.0
    Oracle Database Java Packages                VALID       10.2.0.4.0
    Oracle XDK                                           VALID       10.2.0.4.0
    Oracle XML Database                              VALID       10.2.0.4.0
    6 rows selected.
    SQL>Edited by: mdrake on Feb 4, 2010 3:55 PM

    If you have the fix for bug 8246403 you can also control the behavoir with events. This avoids having to use explict translate operations on each column thay may contain bad data. Note this patch also has the effect of replacing the ORA-31011 error with the ORA-31061 error. Also note it is likely this error number will be changed again in the near future.
    SQL>       --
    SQL> -- Replace with ?
    SQL> --
    SQL>  alter session set events = '19119 trace name context forever, level 0x100000'
      2  /
    Session altered.
    SQL> select xmlElement
      2         (
      3            "Result",
      4            xmlAgg
      5            (
      6               xmlElement("Data",MY_DATA)
      7            )
      8         )
      9    from T1
    10  /
    XMLELEMENT("RESULT",XMLAGG(XMLELEMENT("DATA",MY_DATA)))
    <Result><Data>AAAA</Data><Data>BB?BB</Data><Data>CCCC</Data></Result>
    SQL>       --
    SQL> -- Replace with Character Reference
    SQL> --
    SQL> alter session set events = '19119 trace name context forever, level 0x200000'
      2  /
    Session altered.
    SQL> select xmlElement
      2         (
      3            "Result",
      4            xmlAgg
      5            (
      6               xmlElement("Data",MY_DATA)
      7            )
      8         )
      9    from T1
    10  /
    XMLELEMENT("RESULT",XMLAGG(XMLELEMENT("DATA",MY_DATA)))
    <Result><Data>AAAA</Data><Data>BB&#x0000;BB</Data><Data>CCCC</Data></Result>
    SQL>
    SQL>      --
    SQL> -- Remove Bad Characters
    SQL> --
    SQL> alter session set events = '19119 trace name context forever, level 0x400000'
      2  /
    Session altered.
    SQL> select xmlElement
      2         (
      3            "Result",
      4            xmlAgg
      5            (
      6               xmlElement("Data",MY_DATA)
      7            )
      8         )
      9    from T1
    10  /
    XMLELEMENT("RESULT",XMLAGG(XMLELEMENT("DATA",MY_DATA)))
    <Result><Data>AAAA</Data><Data>BBBB</Data><Data>CCCC</Data></Result>
    SQL>
    SQL>Edited by: mdrake on Feb 4, 2010 3:45 PM
    Edited by: mdrake on Feb 4, 2010 3:46 PM
    Edited by: mdrake on Feb 4, 2010 3:47 PM

  • Help  needed  in inserting  into column  of XML type

    i have requirement of inserting data into column of xml type
    eg
    cust product cost
    1 a 3
    1 b 7
    1 c 5
    now required result should
    <PROD-LIST>
    <a>3</a>
    <b>7</b>
    <c>5</c>
    </PROD-LIST>
    Please let me know how to achieve this , i was trying write function , it was working for one values ,but how to do if many values exist .

    Take a deep breath, then retype this putting in all the words and punctuation you missed out the first time until it makes sense.
    Your sample data, for example, could be better formatted using the [pre] and [/pre] tags to preserve formatting and put in a table format. Similarly with your output. Why are two of the numbers floating around freely in your xml but the 3rd isn't?

  • Inserting a row in a schema-based xml type column

    i have problems while inserting a row in a schema-based xml type column
    it reports an error(schema and elemnt do not match)
    although they are matching if anyone can try it
    and if it worked plz send me the example

    SQL> DESC XML_TAB;
    Name Null? Type
    XML XMLTYPE
    SQL> INSERT INTO XML_TAB
    2 VALUES
    3 (xmltype('<request>
    4 <filter>(extshortname=bhagat)</filter>
    5 <attributes>dn</attributes>
    6 <context/>
    7 <scope>subtree</scope>
    8 </request>'));
    1 row created.
    If your problem persists,post ur lines of code..
    Good luck!!!
    Bhagat

  • ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing

    Hi,
    I am trying to update an already existing Sales Order through PO Change Inbound 860. When i am performing changes in the line quantity and scheduled ship date with operation code as "Update" then it is successfully updating the Order and also we are able to generate the POAck for the updated sales order lines. But when i am rejecting one of the PO change lines by checking rejected flag, then order is getting imported successfully(I mean sales order is getting updated successfully) but during the POAck Generation i.e. 865 its raising "*ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00103: Warning: document structure does not match DTD Error at line 1*" at XML Gateway. we are using XML Gateway to process the orders, can somebody help me to get rid of this issue. Thanks in advance.
    Thanks,
    Sunil Chauhan

    Hi Kishan
    Thanks for the reply.
    Because this is an outbound transaction so i can not provide you the XML file as we are facing issue to generate the same. Also we are using oracle seeded PO outbound Ack map.
    In addition i can provide you the DTD file.
    <!-- ==================================================== -->
    <!ENTITY % RESOURCES SYSTEM "oagis_resources.dtd">
    %RESOURCES;
    <!-- ==================================================== -->
    <!ELEMENT ACKNOWLEDGE_PO_008 (CNTROLAREA, DATAAREA+)>
    <!ATTLIST VERB
         value CDATA #FIXED "ACKNOWLEDGE"
    >
    <!ATTLIST NOUN
         value CDATA #FIXED "PO"
    >
    <!ATTLIST REVISION
         value CDATA #FIXED "008"
    >
    <!ELEMENT DATAAREA (ACKNOWLEDGE_PO)
    >
    <!ELEMENT ACKNOWLEDGE_PO (POORDERHDR, POORDERLIN*)
    >
    <!ELEMENT POORDERHDR ((%DATETIME.DOCUMENT;)?, (%OPERAMT.EXTENDED.T;)?, POID, POTYPE, ACKREQUEST?, CONTRACTB?, CONTRACTS?, DESCRIPTN?, NOTES*, OPRAMTAUTH?, PORELEASE?, TAXWHEXMPT?, USERAREA?, ACKHEADER, ATTCHREF*, CHARGE*, PARTNER*, POTERM*)
    >
    <!ELEMENT ACKHEADER (SENDER, (%DATETIME.PROMDELV;)?, (%DATETIME.PROMSHIP;)?, ACKCODE, DESCRIPTN?, NOTES*, SALESORDID?, USERAREA?)
    >
    <!ELEMENT POTERM (DESCRIPTN?, TERMID?, ((DAYOFMONTH, PROXMONTH) | DAYSNUM), ((%OPERAMT.EXTENDED.T;) | (%QUANTITY.PERCENT;)), USERAREA?)
    >
    <!ELEMENT POORDERLIN ((%QUANTITY.ORDERED;), (%DATETIME.NEEDDELV;)?, (%OPERAMT.UNIT.T;)?, POLINENUM, DRAWING?, HAZRDMATL?, ITEMRV?, ITEMRVX?, NOTES*, PACKING?, POLNSTATUS?, TAXWHEXMPT?, ((DESCRIPTN, ITEM?, ITEMX?, UPC?) | (ITEM, ITEMX?, UPC?) | (ITEMX, UPC?) | (UPC)), USERAREA?, ACKLINE*, ATTCHREF*, CHARGE*, DISTRIBUTN*, PARTNER*, POTERM*, POSUBLINE*, POLINESCHD*)
    >
    <!ELEMENT ACKLINE ((%DATETIME.PROMDELV;)?, (%DATETIME.PROMSHIP;)?, (%QUANTITY.ORDERED;)?, ACKCODE, NOTES*, SALESORDID?, USERAREA?)
    >
    <!ELEMENT POSUBLINE ((%QUANTITY.ITEM;), DRAWING?, ITEMRV?, ITEMRVX?, PSBLINENUM?, ((DESCRIPTN, ITEM?, ITEMX?, UPC?) | (ITEM, ITEMX?, UPC?) | (ITEMX, UPC?) | (UPC)), USERAREA?)>
    <!ELEMENT POLINESCHD ((%DATETIME.NEEDDELV;), (%QUANTITY.ORDERED;), DESCRIPTN?, PSCLINENUM?, USERAREA?)
    >
    Thanks,S
    --Sunil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • ORA-31011: XML parsing failed

    Hi
    I am on client version 9.2.0.4 and try to test the following query
    select XMLELEMENT("DATE", sysdate) from dual;
    I am getting the error ORA-31011:XML parsing failed
    Can anybody suggest a solution?
    Thanks for your reply in advance
    Murali

    Murali ,
    you have mentioned about the client version but what is the server version to which
    you are connected ? Pls checkout that. it should be 9.2.0.4 and above.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.4.0 - Production
    SQL> select XMLELEMENT("DATE", sysdate) from dual;
    XMLELEMENT("DATE",SYSDATE)()
    XMLTYPE()
    SQL> ed
    Wrote file afiedt.buf
      1* select XMLELEMENT("DATE", sysdate).GetStringVal() from dual
    SQL> /
    XMLELEMENT("DATE",SYSDATE).GETSTRINGVAL()
    <DATE>05-SEP-05</DATE>
    SQL> Since my client version is 9.0.1.3.0 i have to use GetStringVal() method to extract the contents.

Maybe you are looking for

  • HT201262 What if the error happens while in safe mode?

    Have an error occuring in QuarkXpress. Does not always crash but most of the time it happens after 20-2 hours of restarting or switching users. Only way to use Quark after the error message is to restart. The error is unknown and the item tool in qua

  • Does iPhoto 6 support RAW files?

    Seems that some of my RAW images are not importing into iPhoto 6. They are taken with the Panasonic Lumix L1 SLR. So question is whether or not iPhoto supports RAW files, and is it specific to the camera model which might have its own proprietary RAW

  • How to migrate pricing condition data using lsmw

    Hello All,              can any one explain how to migrate pricing condition data using lsmw. the scenario is we are trying to extend the pricing conditions from one sales area to other sales area on a combination of sales organization, distribution

  • How I can associate shh protocol to putty in firefox or windows?

    How I can associate ssh protocol to putty in firefox or windows? == This happened == Every time Firefox opened

  • Itunes doen't want to play wma file already on computer

    I just got a mac and copies a folder from my PC to my mac, some of it contains MP3's which itunes recognises places in library and plays, but the wma file it won't do anything with, it wont import, cant drag and drop into itunes and wont play it, onl