ORA-30951: Element or attribute at Xpath /AC//Doc[@] exceeds maximum length
Hi All,
I am trying to load the XML Files into a Table using the SQL Loader and i am getting the Error
Record 1: Rejected - Error on table COMMONASSETCATALOG.
ORA-30951: Element or attribute at Xpath /AC/T[1]/T[1]/T[1]/T[1]/T[1]/Doc[@] exceeds maximum length
The <Doc> Element which is child of the <T> contains an XML Schema inside it..
The Doc Element is declared in Schema as
<xs:complexType name="AsDocType">
<xs:annotation>
<xs:documentation>A (Doc)ument, a container for any type of file</xs:documentation>
</xs:annotation>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="##any" processContents="lax"/>
</xs:sequence>
<xs:attributeGroup ref="AsDocAtts"/>
</xs:complexType>
The Size of the XML Content that <Doc> Node has is around 34Kb.
Could you pls let me know how to resolve this..
Thanks
Sateesh
Hi All,
I am trying to load the XML Files into a Table using the SQL Loader and i am getting the Error
Record 1: Rejected - Error on table COMMONASSETCATALOG.
ORA-30951: Element or attribute at Xpath /AC/T[1]/T[1]/T[1]/T[1]/T[1]/Doc[@] exceeds maximum length
The <Doc> Element which is child of the <T> contains an XML Schema inside it..
The Doc Element is declared in Schema as
<xs:complexType name="AsDocType">
<xs:annotation>
<xs:documentation>A (Doc)ument, a container for any type of file</xs:documentation>
</xs:annotation>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="##any" processContents="lax"/>
</xs:sequence>
<xs:attributeGroup ref="AsDocAtts"/>
</xs:complexType>
The Size of the XML Content that <Doc> Node has is around 34Kb.
Could you pls let me know how to resolve this..
Thanks
Sateesh
Similar Messages
-
ORA-30951: Element or attribute at Xpath exceeds maximum length ORA-06512:
Hi there
I am getting the error when trying to run this test block, this is code is to simulate the production error we are getting...The XML is attached.. Please Help
NB: What confuses me to this is that once I format the XML and run the same query it runs fine....
DECLARE
g_xdoc XMLTYPE;
g_trans_type CHAR (20) := NULL;
BEGIN
SELECT xmltype(c) -- column is a clob column
INTO g_xdoc
FROM test_gil
WHERE a = '1';
SELECT EXTRACT(VALUE (tt), '//transactionType').getstringval()
INTO g_trans_type
FROM TABLE (XMLSEQUENCE (EXTRACT (g_xdoc, '/'))) tt;
DBMS_OUTPUT.put_line (g_trans_type);
END;HI Guys
As I said when I have formatted the XML and run the query it runs but when I run it unformulated it gives the error.. And I have compared the two version of XML formatted/unformulated they are exactly the same... I have attached a copy of the formatted XML at the bottom together with the version number of my database.
SQL*Plus: Release 10.1.0.4.2 - Production on Tue Apr 30 11:34:15 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning option
Oracle version 11.2.0.2.0 on host boa
pdev (assuper)>
<?xml version="1.0" encoding="UTF-8"?>
<ClaimRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="NXS_CLAIM_REQ.XSD">
<Claim>
<transactionType>Request</transactionType>
<testClaim>false</testClaim>
<messageId>neAn0Q062010005</messageId>
<schemeCode>BONITAS</schemeCode>
<planCode>470</planCode>
<providerBHF>7021291</providerBHF>
<referringProviderBHF />
<membershipNo>47000115594</membershipNo>
<scriptNo>7021291-ARETHA</scriptNo>
<authorisationNo />
<inHospitalClaim>N</inHospitalClaim>
<receiptAmount>0.00</receiptAmount>
<providerSubmittedInd>N</providerSubmittedInd>
<source>PPN</source>
<benefitBooking>false</benefitBooking>
<iphReferenceNo>0</iphReferenceNo>
<altClaimNo>4673452</altClaimNo>
<claimGross>1350.00</claimGross>
<claimSchemeSurcharge>0.00</claimSchemeSurcharge>
<numLines>4</numLines>
<Line>
<lineNo>1</lineNo>
<lineType>S</lineType>
<itemCodeType>nappi</itemCodeType>
<beneficiaryInitials />
<beneficiaryFirstName>PAUL NDONI</beneficiaryFirstName>
<beneficiarySurname>MABUZA</beneficiarySurname>
<beneficiaryDOB>1956-07-28</beneficiaryDOB>
<beneficiaryGender>U</beneficiaryGender>
<beneficiaryId>C456253</beneficiaryId>
<dependantNo />
<chargeableCode>62223</chargeableCode>
<extendedCode />
<chargeableDescription>PPN 2 BIFOCAL PLASTIC</chargeableDescription>
<chargeableTreatmentDate>2013-02-02</chargeableTreatmentDate>
<results />
<chargeableQuantity>100.00</chargeableQuantity>
<inHospitalInd>N</inHospitalInd>
<grossAmount>400.00</grossAmount>
<discountAmount>0.00</discountAmount>
<packageNumber>0</packageNumber>
<benefitCode>L</benefitCode>
<labReferenceNo />
<dispensingLocation>P</dispensingLocation>
<mixtureSequence>0</mixtureSequence>
<authorisationNo />
<daysSupplied>0</daysSupplied>
<referringProviderBHF />
<payInstruction>P</payInstruction>
<benefitAmount>400.00</benefitAmount>
<altClaimLineNo />
<treatingProviderBHF />
<levy>0.00</levy>
<schemeSurcharge>0.00</schemeSurcharge>
<savingsSurcharge>0.00</savingsSurcharge>
<referenceSurcharge>0.00</referenceSurcharge>
<overchargeAmount>0.00</overchargeAmount>
<numDiagnoses>3</numDiagnoses>
<Diagnoses>
<lineNo>1</lineNo>
<code>H52.0</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>1</lineNo>
<code>H52.4</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>1</lineNo>
<code>Z97.3</code>
<qualifier>P</qualifier>
</Diagnoses>
<OpticalReadings>
<lineNo>1</lineNo>
<eye>R</eye>
<sphere>0.50</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>16</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
<OpticalReadings>
<lineNo>1</lineNo>
<eye>L</eye>
<sphere>0.75</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>15</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
</Line>
<Line>
<lineNo>2</lineNo>
<lineType>S</lineType>
<itemCodeType>nappi</itemCodeType>
<beneficiaryInitials />
<beneficiaryFirstName>PAUL NDONI</beneficiaryFirstName>
<beneficiarySurname>MABUZA</beneficiarySurname>
<beneficiaryDOB>1956-07-28</beneficiaryDOB>
<beneficiaryGender>U</beneficiaryGender>
<beneficiaryId>C456253</beneficiaryId>
<dependantNo />
<chargeableCode>70406</chargeableCode>
<extendedCode />
<chargeableDescription>CREAYIVE CRP4</chargeableDescription>
<chargeableTreatmentDate>2013-02-02</chargeableTreatmentDate>
<results />
<chargeableQuantity>100.00</chargeableQuantity>
<inHospitalInd>N</inHospitalInd>
<grossAmount>150.00</grossAmount>
<discountAmount>0.00</discountAmount>
<packageNumber>0</packageNumber>
<benefitCode>F</benefitCode>
<labReferenceNo />
<dispensingLocation>P</dispensingLocation>
<mixtureSequence>0</mixtureSequence>
<authorisationNo />
<daysSupplied>0</daysSupplied>
<referringProviderBHF />
<payInstruction>P</payInstruction>
<benefitAmount>150.00</benefitAmount>
<altClaimLineNo />
<treatingProviderBHF />
<levy>0.00</levy>
<schemeSurcharge>0.00</schemeSurcharge>
<savingsSurcharge>0.00</savingsSurcharge>
<referenceSurcharge>0.00</referenceSurcharge>
<overchargeAmount>0.00</overchargeAmount>
<numDiagnoses>3</numDiagnoses>
<Diagnoses>
<lineNo>2</lineNo>
<code>H52.0</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>2</lineNo>
<code>H52.4</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>2</lineNo>
<code>Z97.3</code>
<qualifier>P</qualifier>
</Diagnoses>
<OpticalReadings>
<lineNo>2</lineNo>
<eye>R</eye>
<sphere>0.50</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>16</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
<OpticalReadings>
<lineNo>2</lineNo>
<eye>L</eye>
<sphere>0.75</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>15</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
</Line>
<Line>
<lineNo>3</lineNo>
<lineType>S</lineType>
<itemCodeType>nappi</itemCodeType>
<beneficiaryInitials />
<beneficiaryFirstName>PAUL NDONI</beneficiaryFirstName>
<beneficiarySurname>MABUZA</beneficiarySurname>
<beneficiaryDOB>1956-07-28</beneficiaryDOB>
<beneficiaryGender>U</beneficiaryGender>
<beneficiaryId>C456253</beneficiaryId>
<dependantNo />
<chargeableCode>70001</chargeableCode>
<extendedCode />
<chargeableDescription>PPN COMP EXAM</chargeableDescription>
<chargeableTreatmentDate>2013-02-02</chargeableTreatmentDate>
<results />
<chargeableQuantity>100.00</chargeableQuantity>
<inHospitalInd>N</inHospitalInd>
<grossAmount>400.00</grossAmount>
<discountAmount>0.00</discountAmount>
<packageNumber>0</packageNumber>
<benefitCode>E</benefitCode>
<labReferenceNo />
<dispensingLocation>P</dispensingLocation>
<mixtureSequence>0</mixtureSequence>
<authorisationNo />
<daysSupplied>0</daysSupplied>
<referringProviderBHF />
<payInstruction>P</payInstruction>
<benefitAmount>400.00</benefitAmount>
<altClaimLineNo />
<treatingProviderBHF />
<levy>0.00</levy>
<schemeSurcharge>0.00</schemeSurcharge>
<savingsSurcharge>0.00</savingsSurcharge>
<referenceSurcharge>0.00</referenceSurcharge>
<overchargeAmount>0.00</overchargeAmount>
<numDiagnoses>4</numDiagnoses>
<Diagnoses>
<lineNo>3</lineNo>
<code>H52.4</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>3</lineNo>
<code>Z97.3</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>3</lineNo>
<code>Z01.0</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>3</lineNo>
<code>H52.0</code>
<qualifier>P</qualifier>
</Diagnoses>
<OpticalReadings>
<lineNo>3</lineNo>
<eye>R</eye>
<sphere>0.50</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>16</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
<OpticalReadings>
<lineNo>3</lineNo>
<eye>L</eye>
<sphere>0.75</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>15</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
</Line>
<Line>
<lineNo>4</lineNo>
<lineType>S</lineType>
<itemCodeType>nappi</itemCodeType>
<beneficiaryInitials />
<beneficiaryFirstName>PAUL NDONI</beneficiaryFirstName>
<beneficiarySurname>MABUZA</beneficiarySurname>
<beneficiaryDOB>1956-07-28</beneficiaryDOB>
<beneficiaryGender>U</beneficiaryGender>
<beneficiaryId>C456253</beneficiaryId>
<dependantNo />
<chargeableCode>62223</chargeableCode>
<extendedCode />
<chargeableDescription>PPN 2 BIFOCAL PLASTIC</chargeableDescription>
<chargeableTreatmentDate>2013-02-02</chargeableTreatmentDate>
<results />
<chargeableQuantity>100.00</chargeableQuantity>
<inHospitalInd>N</inHospitalInd>
<grossAmount>400.00</grossAmount>
<discountAmount>0.00</discountAmount>
<packageNumber>0</packageNumber>
<benefitCode>L</benefitCode>
<labReferenceNo />
<dispensingLocation>P</dispensingLocation>
<mixtureSequence>0</mixtureSequence>
<authorisationNo />
<daysSupplied>0</daysSupplied>
<referringProviderBHF />
<payInstruction>P</payInstruction>
<benefitAmount>400.00</benefitAmount>
<altClaimLineNo />
<treatingProviderBHF />
<levy>0.00</levy>
<schemeSurcharge>0.00</schemeSurcharge>
<savingsSurcharge>0.00</savingsSurcharge>
<referenceSurcharge>0.00</referenceSurcharge>
<overchargeAmount>0.00</overchargeAmount>
<numDiagnoses>3</numDiagnoses>
<Diagnoses>
<lineNo>4</lineNo>
<code>H52.0</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>4</lineNo>
<code>H52.4</code>
<qualifier>P</qualifier>
</Diagnoses>
<Diagnoses>
<lineNo>4</lineNo>
<code>Z97.3</code>
<qualifier>P</qualifier>
</Diagnoses>
<OpticalReadings>
<lineNo>4</lineNo>
<eye>R</eye>
<sphere>0.50</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>16</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
<OpticalReadings>
<lineNo>4</lineNo>
<eye>L</eye>
<sphere>0.75</sphere>
<cylinder>0.00</cylinder>
<axis>0.00</axis>
<addition>1.75</addition>
<prism />
<status />
<opticalType />
<opticalReference />
<visualAcuityUnaided>6/6</visualAcuityUnaided>
<visualAcuityCorrected />
<inocularPressure>15</inocularPressure>
<visualFieldInfo>FULL</visualFieldInfo>
<nvsTagNumber />
<labReference />
<labOrderNumber />
</OpticalReadings>
</Line>
</Claim>
</ClaimRequest> -
XML data value exceeds maximum length - ORA-30951
Hello,
I am receiving ORA-30951: Element or attribute at Xpath /dataroot/Respondent[1]/Response[3]/Value exceeds maximum length error during the XML load.
I have registered the schema and it works fine when the Value is less than 64k but fails if its greater. I tried changing the type of Value to type="xsd:base64Binary" xdb:maintainDOM="false" xdb:SQLName="LOB_DATA" xdb:SQLType="BLOB" but then I get ORA-00932: inconsistent datatypes error.
Can someone please let me know what I am doing wrong or is there a way I can load more than 64k length elements on 10g?
Thanks
Here is my schema.
var SCHEMAURL varchar2(256)
var XMLSCHEMA CLOB
set define off
begin
:SCHEMAURL := 'http://xmlns.example.com/Svy_Resp.xsd';
:XMLSCHEMA := '<?xml version="1.0"; encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0"; xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
<xsd:element name="dataroot" xdb:defaultTable="SVY_RESP_XML_SCHEMA" type="datarootType" />
<xsd:complexType name="datarootType" xdb:maintainDOM="false"
xdb:SQLType="Dataroot_T">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="Respondent" type="RespondentType" />
</xsd:sequence>
<xsd:attribute name="generated" type="xsd:dateTime" />
</xsd:complexType>
<xsd:complexType name="RespondentType" xdb:maintainDOM="false" xdb:SQLType="Respondent_Type">
<xsd:sequence>
<xsd:element name="RespondentID" type="xsd:int" />
<xsd:element name="KsID" type="xsd:int" />
<xsd:element name="email" type="xsd:string" />
<xsd:element name="SyID" type="xsd:int" />
<xsd:element name="KSuID" type="xsd:int" />
<xsd:element name="Completed" type="xsd:int" />
<xsd:element name="SubmitDateTime" type="xsd:dateTime" />
<xsd:element maxOccurs="unbounded" name="Response" type="ResponseType" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ResponseType" xdb:maintainDOM="false" xdb:SQLType="Response_Type">
<xsd:sequence>
<xsd:element name="ResponseID" type="xsd:int" />
<xsd:element name="RespondentID" type="xsd:int" />
<xsd:element name="CID" type="xsd:int" />
<xsd:element name="AID" type="xsd:int" />
<xsd:element name="Value" type="xsd:string"/>
<xsd:element name="QID" type="xsd:int" />
<xsd:element name="SID" type="xsd:int" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>';
end;
/Thanks for the quick response. I am not able to modify the source file, but will it be possible to set the value to NULL if it exceeds the max length instead of failure?
Thanks -
ORA-30951: ...exceeds maximum length
Oracle Database 10g Release 10.2.0.1.0 - Production
I am new to XML and having a problem importing data using the XML Repository. I have annotated the schema and validated it using XML Spy. I am able to register the schema w/o errors. I am now working through the issues as they occur during the insertion of xml documents. Thes section below is giving me an error (bottom) that the data exceeds the maximum length. The "DATA" in the xml doc is a pdf file that has been converted to characters by some method. The size element has a data value of 5008. Seems to be too long for a varchar2. I tried RAW, CLOB, BLOB. I was pretty sure they wouldn't work and they didn't. I get an error that the xml/xdb types are incompatible.
How can I modify the schema to get this element to load?
Is it possible to tell oracle to ignore an element so I can eliminate those that are not critical? This would be very helpful.
Thanks!
Schema -
<xs:element name="NpdbReportList" minOccurs="0">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="NpdbReport" minOccurs="0">
<xs:complexType>
<xs:all minOccurs="0">
<xs:element name="DCN" minOccurs="0"/>
<xs:element name="DateReport" type="Date" minOccurs="0"/>
<xs:element name="ReportType" type="IdRef" minOccurs="0"/>
<xs:element ref="LOB" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="LOB" xdb:SQLType="LOB_T"xdb:maintainDOM="false">
<xs:all>
<xs:element name="Type" type="IdRef"/>
<xs:element name="Size"/>
<xs:element name="Data" xdb:maintainDOM="false" xdb:SQLName="LOB_DATA" xdb:SQLType="VARCHAR2"/>
</xs:all>
</xs:complexType>
ftp> mput *
mput Smyth_Steven_1386367.XML? y
227 Entering Passive Mode (127,0,0,1,83,221)
150 ASCII Data Connection
550- Error Response
ORA-30951: Element or attribute at Xpath /Provider/NpdbReportList/NpdbReport[1]/LOB/Data exceeds maximum length
550 End Error Response
28706 bytes sent in 0.014 seconds (1.9e+03 Kbytes/s)
ftp>Thanks for your time Marco.
Here is the header:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2010 rel. 2 (http://www.altova.com) by Joe (DSI) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true" xdb:mapStringToNCHAR="true" xdb:mapUnboundedStringToLob="true">
I made the following change -
<xs:element name="Data" xdb:maintainDOM="false" xdb:SQLName="LOB_DATA" xdb:SQLType="CLOB"/>
I received this error -
ORA-31094: incompatible SQL type "CLOB" for attribute or element "Data"
ORA-06512: at "XML_TEST.XML_TEST_SCHEMA_REGISTER", line 48
I did a little more testing after the first post. I used the same type as an element that is defining image data.
<xs:element name="Data" type="xs:base64Binary" xdb:maintainDOM="false" xdb:SQLName="LOB_DATA" xdb:SQLType="BLOB"/>
While this did register and I was able to load a record, I am guessing that this will render the data for this element usless but at least the record loads. I'll still need to resolve this issue as the .pdf data is important.
Thanks
Joe -
XML Data. Extracting elements and attributes using Xpath or another?
Hi experts,
Using Oracle 11g.
I have an XML table which stores XML in one column (xml_col) like the below structure.
Example:
<measure id="abc">
<data-elements>
<data-element id="ab">
<value>40</value>
</data-element>
<data-element id="cd">
<value>8</value>
</data-element>
<data-element id="ef">
<value>38</value>
</data-element>
<data-element id="gh">
<value>32</value>
</data-element>
</data-elements>
</measure>I've been trying endlessly to run XPath queries on this column to obtain the attribute of the <data-element> node and the value of the <value> node within.
My goal is to turn this into a table of:
ab | 40
cd | 8
ef | 38
gh | 32
My mind is stuck on doing this below and wrapping it with a CSV to rows hierarchical query. I can not convert to xmltype to a string to make that work though.
select str1,str2 from (
select extract(xml_col, 'string-join(//@id, '','')') str1
,extract(xml_col, 'string-join(//value, '','')') str2
from xml_temp_table)
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (str1, '[^,]+')) + 1;But I get the following error:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00607: Invalid reference: 'string-join'.
I'm looking for a non PL solution.
Any suggestions appreciated.
Thanks
Edited by: chris001 on Feb 26, 2013 12:06 PM
Edited by: chris001 on Feb 26, 2013 12:07 PMchris001 wrote:
My mind is stuck on doing this below and wrapping it with a CSV to rows hierarchical query. I can not convert to xmltype to a string to make that work though. Oh boy!
This should ease your pain ;)
SQL> select x.*
2 from xml_temp_table t
3 , xmltable(
4 '/measure/data-elements/data-element'
5 passing t.xml_col
6 columns element_id varchar2(10) path '@id'
7 , element_val number path 'value'
8 ) x ;
ELEMENT_ID ELEMENT_VAL
ab 40
cd 8
ef 38
gh 32 -
ORA-31005: Path name length 3125 exceeds maximum length 1024
what does this error mean?
how to resolve it and how to track where it is occuring.
it is a xml parsing error but which path is it talking about?
str_sqlstring contains xml in string format.
xmlvar := xmltype('ROOT',str_xmlstring);
doc := dbms_xmldom.newDOMDocument(xmlvar);
ndoc := dbms_xmldom.makeNode(doc);
dbms_xmldom.writetobuffer(ndoc, str_buffer);Thanks for your time Marco.
Here is the header:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2010 rel. 2 (http://www.altova.com) by Joe (DSI) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true" xdb:mapStringToNCHAR="true" xdb:mapUnboundedStringToLob="true">
I made the following change -
<xs:element name="Data" xdb:maintainDOM="false" xdb:SQLName="LOB_DATA" xdb:SQLType="CLOB"/>
I received this error -
ORA-31094: incompatible SQL type "CLOB" for attribute or element "Data"
ORA-06512: at "XML_TEST.XML_TEST_SCHEMA_REGISTER", line 48
I did a little more testing after the first post. I used the same type as an element that is defining image data.
<xs:element name="Data" type="xs:base64Binary" xdb:maintainDOM="false" xdb:SQLName="LOB_DATA" xdb:SQLType="BLOB"/>
While this did register and I was able to load a record, I am guessing that this will render the data for this element usless but at least the record loads. I'll still need to resolve this issue as the .pdf data is important.
Thanks
Joe -
Hi!!
During insert an xml doc I'm getting the error:
ORA-30951: Element or attribute at Xpath /Security/SecurityInformation/FundInformation/TotalAssets exceeds maximum length
This is the part of the xml doc:
<Security id="16850" xmlns="http://mydb/security_v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mydb/security_v1.1 security.xsd">
<Symbol>AAAGX</Symbol>
<Name>AAL Aggressive Growth A</Name>
<ShortName>AAAGX</ShortName>
<SecurityType>Stock Fund</SecurityType>
<SecurityInformation>
<FundInformation>
<FundFamily>AAL Mutual Funds</FundFamily>
<Sector>Healthcare</Sector>
<Industry>Advertising</Industry>
<Industry>ElectricUtilities</Industry>
<AssetGroup>Large Growth</AssetGroup>
<Category Capitalization="Small" Class="Value"/>
<ExpenseRatio>0.62</ExpenseRatio>
<TotalAssets>34423803904</TotalAssets>
<MinInitialInvestment>10000</MinInitialInvestment>
<MinSubsequentInvestment>100</MinSubsequentInvestment>
</FundInformation>
And this is the part of the schema:
<xsd:element name="FundInformation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="FundFamily" type="xsd:string"/>
<xsd:element name="Sector" type="security:SectorType" minOccurs="0"/>
<xsd:element name="Industry" type="security:IndustryType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="AssetGroup" type="xsd:string"/>
<!--xsd:choice-->
<xsd:element name="Category" type="security:CategoryType" minOccurs="0"/>
<xsd:element name="FixedIncome" type="security:FixedIncomeType" minOccurs="0"/>
<!--/xsd:choice-->
<xsd:element name="ExpenseRatio" type="security:SecurityDecimalType"/>
<xsd:element name="TotalAssets" type="security:SecurityDecimalType"/>
<xsd:element name="MinInitialInvestment" type="xsd:integer" minOccurs="0"/>
<xsd:element name="MinSubsequentInvestment" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
What did I wrong?
Thanks for your help!!In this case I think SPY is wrong
SQL>
SQL>
SQL> var schemaURL varchar2(64);
SQL> --
SQL> begin
2 :schemaURL := 'security.xsd';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 xmlSchema xmltype := xmltype(
3 '<?xml version="1.0" encoding="UTF-8"?>
4 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:security="http://mydb/security_v
1.1" targetNamespace="http://mydb/security_v1.1" elementFormDefault="qualified" attributeFormDefault="unqualified">
5 <xsd:element name="FundInformation" xdb:defaultTable="FUND_TABLE">
6 <xsd:complexType xdb:SQLType="FUND_T">
7 <xsd:sequence>
8 <xsd:element name="FundFamily" type="xsd:string"/>
9 <xsd:element name="Sector" type="xsd:string" minOccurs="0"/>
10 <xsd:element name="Industry" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
11 <xsd:element name="AssetGroup" type="xsd:string"/>
12 <xsd:element name="Category" type="xsd:string" minOccurs="0"/>
13 <xsd:element name="FixedIncome" type="xsd:decimal" minOccurs="0"/>
14 <xsd:element name="ExpenseRatio" type="security:SecurityDecimalType"/>
15 <xsd:element name="TotalAssets" type="security:SecurityDecimalType"/>
16 <xsd:element name="MinInitialInvestment" type="xsd:integer" minOccurs="0"/>
17 <xsd:element name="MinSubsequentInvestment" type="xsd:integer" minOccurs="0"/>
18 </xsd:sequence>
19 </xsd:complexType>
20 </xsd:element>
21 <xsd:simpleType name="SecurityDecimalType">
22 <xsd:restriction base="xsd:decimal">
23 <xsd:minInclusive value="0"/>
24 <xsd:totalDigits value="13"/>
25 <xsd:fractionDigits value="4"/>
26 </xsd:restriction>
27 </xsd:simpleType>
28 </xsd:schema>');
29 begin
30 dbms_xmlSchema.registerSchema(:schemaURL,xmlSchema);
31 end;
32 /
PL/SQL procedure successfully completed.
SQL> desc FUND_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "security.xsd" Element "FundInformation") STORAGE Object-relational TYPE "FUND_T"
SQL> --
SQL> desc FUND_T
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
FundFamily VARCHAR2(4000 CHAR)
Sector VARCHAR2(4000 CHAR)
Industry Industry8403_COLL
AssetGroup VARCHAR2(4000 CHAR)
Category VARCHAR2(4000 CHAR)
FixedIncome NUMBER
ExpenseRatio NUMBER(13,4)
TotalAssets NUMBER(13,4)
MinInitialInvestment NUMBER(38)
MinSubsequentInvestment NUMBER(38)
SQL> --
SQL> insert into FUND_TABLE values ( xmltype(
2 '<FundInformation xmlns="http://mydb/security_v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://my
db/security_v1.1 security.xsd">
3 <FundFamily>AAL Mutual Funds</FundFamily>
4 <Sector>Healthcare</Sector>
5 <Industry>Advertising</Industry>
6 <Industry>ElectricUtilities</Industry>
7 <AssetGroup>Large Growth</AssetGroup>
8 <Category/>
9 <ExpenseRatio>0.62</ExpenseRatio>
10 <TotalAssets>34423803904</TotalAssets>
11 <MinInitialInvestment>10000</MinInitialInvestment>
12 <MinSubsequentInvestment>100</MinSubsequentInvestment>
13 </FundInformation>'))
14 /
insert into FUND_TABLE values ( xmltype(
ERROR at line 1:
ORA-30951: Element or attribute at Xpath /FundInformation/TotalAssets exceeds
maximum length
SQL>
SQL>
SQL> var schemaURL varchar2(64);
SQL> --
SQL> begin
2 :schemaURL := 'security.xsd';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> call dbms_xmlSchema.deleteSchema(:schemaURL,4)
2 /
Call completed.
SQL> declare
2 xmlSchema xmltype := xmltype(
3 '<?xml version="1.0" encoding="UTF-8"?>
4 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:security="http://mydb/security_v
1.1" targetNamespace="http://mydb/security_v1.1" elementFormDefault="qualified" attributeFormDefault="unqualified">
5 <xsd:element name="FundInformation" xdb:defaultTable="FUND_TABLE">
6 <xsd:complexType xdb:SQLType="FUND_T">
7 <xsd:sequence>
8 <xsd:element name="FundFamily" type="xsd:string"/>
9 <xsd:element name="Sector" type="xsd:string" minOccurs="0"/>
10 <xsd:element name="Industry" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
11 <xsd:element name="AssetGroup" type="xsd:string"/>
12 <xsd:element name="Category" type="xsd:string" minOccurs="0"/>
13 <xsd:element name="FixedIncome" type="xsd:decimal" minOccurs="0"/>
14 <xsd:element name="ExpenseRatio" type="security:SecurityDecimalType"/>
15 <xsd:element name="TotalAssets" type="security:SecurityDecimalType"/>
16 <xsd:element name="MinInitialInvestment" type="xsd:integer" minOccurs="0"/>
17 <xsd:element name="MinSubsequentInvestment" type="xsd:integer" minOccurs="0"/>
18 </xsd:sequence>
19 </xsd:complexType>
20 </xsd:element>
21 <xsd:simpleType name="SecurityDecimalType">
22 <xsd:restriction base="xsd:decimal">
23 <xsd:minInclusive value="0"/>
24 <xsd:totalDigits value="15"/>
25 <xsd:fractionDigits value="4"/>
26 </xsd:restriction>
27 </xsd:simpleType>
28 </xsd:schema>');
29 begin
30 dbms_xmlSchema.registerSchema(:schemaURL,xmlSchema);
31 end;
32 /
PL/SQL procedure successfully completed.
SQL> desc FUND_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "security.xsd" Element "FundInformation") STORAGE Object-relational TYPE "FUND_T"
SQL> --
SQL> desc FUND_T
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
FundFamily VARCHAR2(4000 CHAR)
Sector VARCHAR2(4000 CHAR)
Industry Industry8404_COLL
AssetGroup VARCHAR2(4000 CHAR)
Category VARCHAR2(4000 CHAR)
FixedIncome NUMBER
ExpenseRatio NUMBER(15,4)
TotalAssets NUMBER(15,4)
MinInitialInvestment NUMBER(38)
MinSubsequentInvestment NUMBER(38)
SQL> --
SQL> insert into FUND_TABLE values ( xmltype(
2 '<FundInformation xmlns="http://mydb/security_v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://my
db/security_v1.1 security.xsd">
3 <FundFamily>AAL Mutual Funds</FundFamily>
4 <Sector>Healthcare</Sector>
5 <Industry>Advertising</Industry>
6 <Industry>ElectricUtilities</Industry>
7 <AssetGroup>Large Growth</AssetGroup>
8 <Category/>
9 <ExpenseRatio>0.62</ExpenseRatio>
10 <TotalAssets>34423803904</TotalAssets>
11 <MinInitialInvestment>10000</MinInitialInvestment>
12 <MinSubsequentInvestment>100</MinSubsequentInvestment>
13 </FundInformation>'))
14 /
1 row created.
SQL>
SQL>
SQL>The original definition of SecurityDecimalType is a total 13 digits, with 4 reserved for fractional values, leaving 9 digits for the non fractional value. Your instance document contains a non fractional value with 11 digits. As can be seen if we alter the definition to allow for a total of 15 digits then everything works as expected.
I also checked and the XDB schema validator does not catch this issue either. I will file a bug on the schema validator for this issue. -
I am somewhat new to oracle and I am having a very hard time registering a large XML schema (approx 1MB). I tried the following code but I do not understand where or what the problem is. Is it with the XML schema? If so how do I find the line that it is on.
SQL>
SQL> DECLARE
2
3 -- OS file whose content needs to be read.
4 fileName VARCHAR2(50) := 'test.xsd';
5
6
7 -- Directory Object specifying the file location.
8 directoryName VARCHAR2(50) := 'SOURCE_DIR';
9
10 -- CLOB Object to hold the content of the file from the user specified di
rectory.
11 fileContent CLOB;
12
13
14 BEGIN
15 fileContent := xdb_utilities.getFileContent(fileName, directoryName);
16 dbms_xmlschema.registerSchema('test12', fileContent);
17 END;
18 /
DECLARE
ERROR at line 1:
ORA-30951: Element or attribute at Xpath /schema/simpleType[149]/annotation/appi
nfo[2][@] exceeds maximum length
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 31
ORA-06512: at line 16
Thanks,
CrimSuggest you post your question in the XDB forum...
XML DB
as you will get good help from mdrake in there as he knows what he's talking about regarding XML stuff.
;) -
ORA-30951 when registering TPoX schemas
Hello,
I am trying to register the schemas for TPoX benchmark of XMLType Object Relational storage.
BEGIN
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL => 'http://www.fixprotocol.org/FIXML-4-4 fixml-fields-base-4-4.xsd',
SCHEMADOC => bfilename('XML_FILES_DIR','fixml-fields-base-4-4.xsd'),
LOCAL => TRUE,
CSID => nls_charset_id('AL32UTF8'));
END;
I get the following error:
ORA-30951: Element or attribute at Xpath /schema/simpleType[131]/annotation/appinfo[2][@] exceeds maximum length
The element it refers to, indeed is quite large:
<xs:appinfo xmlns:x="http://www.fixprotocol.org/fixml/metadata.xsd">
<x:EnumDoc value="EUSUPRA" desc="EuroSupranationalCoupons"/>
<x:EnumDoc value="FAC" desc="FederalAgencyCoupon"/>
<x:EnumDoc value="FADN" desc="FederalAgencyDiscountNote"/>
<x:EnumDoc value="PEF" desc="PrivateExportFunding"/>
<x:EnumDoc value="SUPRA" desc="USDSupranationalCoupons"/>
<x:EnumDoc value="FUT" desc="Future"/>
<x:EnumDoc value="OPT" desc="Option"/>
<x:EnumDoc value="CORP" desc="CorporateBond"/>
<x:EnumDoc value="CPP" desc="CorporatePrivatePlacement"/>
<x:EnumDoc value="CB" desc="ConvertibleBond"/>
<x:EnumDoc value="DUAL" desc="DualCurrency"/>
<x:EnumDoc value="EUCORP" desc="EuroCorporateBond"/>
<x:EnumDoc value="XLINKD" desc="IndexedLinked"/>
<x:EnumDoc value="STRUCT" desc="StructuredNotes"/>
<x:EnumDoc value="YANK" desc="YankeeCorporateBond"/>
<x:EnumDoc value="FOR" desc="ForeignExchangeContract"/>
<x:EnumDoc value="CS" desc="CommonStock"/>
<x:EnumDoc value="PS" desc="PreferredStock"/>
<x:EnumDoc value="BRADY" desc="BradyBond"/>
<x:EnumDoc value="EUSOV" desc="EuroSovereigns"/>
<x:EnumDoc value="TBOND" desc="USTreasuryBond"/>
<x:EnumDoc value="TINT" desc="InterestStripFromAnyBondOrNote"/>
<x:EnumDoc value="TIPS" desc="TreasuryInflationProtectedSecurities"/>
<x:EnumDoc value="TCAL" desc="PrincipalStripOfACallableBondOrNote"/>
<x:EnumDoc value="TPRN" desc="PrincipalStripFromANoncallableBondOrNote"/>
<x:EnumDoc value="UST" desc="USTreasuryNoteDeprecatedValueUseTNOTE"/>
<x:EnumDoc value="USTB" desc="USTreasuryBillDeprecatedValueUseTBILL"/>
<x:EnumDoc value="TNOTE" desc="USTreasuryNote"/>
<x:EnumDoc value="TBILL" desc="USTreasuryBill"/>
<x:EnumDoc value="REPO" desc="Repurchase"/>
<x:EnumDoc value="FORWARD" desc="Forward"/>
<x:EnumDoc value="BUYSELL" desc="BuySellback"/>
<x:EnumDoc value="SECLOAN" desc="SecuritiesLoan"/>
<x:EnumDoc value="SECPLEDGE" desc="SecuritiesPledge"/>
<x:EnumDoc value="TERM" desc="TermLoan"/>
<x:EnumDoc value="RVLV" desc="RevolverLoan"/>
<x:EnumDoc value="RVLVTRM" desc="RevolverTermLoan"/>
<x:EnumDoc value="BRIDGE" desc="BridgeLoan"/>
<x:EnumDoc value="LOFC" desc="LetterOfCredit"/>
<x:EnumDoc value="SWING" desc="SwingLineFacility"/>
<x:EnumDoc value="DINP" desc="DebtorInPossession"/>
<x:EnumDoc value="DEFLTED" desc="Defaulted"/>
<x:EnumDoc value="WITHDRN" desc="Withdrawn"/>
<x:EnumDoc value="REPLACD" desc="Replaced"/>
<x:EnumDoc value="MATURED" desc="Matured"/>
<x:EnumDoc value="AMENDED" desc="AmendedRestated"/>
<x:EnumDoc value="RETIRED" desc="Retired"/>
<x:EnumDoc value="BA" desc="BankersAcceptance"/>
<x:EnumDoc value="BN" desc="BankNotes"/>
<x:EnumDoc value="BOX" desc="BillOfExchanges"/>
<x:EnumDoc value="CD" desc="CertificateOfDeposit"/>
<x:EnumDoc value="CL" desc="CallLoans"/>
<x:EnumDoc value="CP" desc="CommercialPaper"/>
<x:EnumDoc value="DN" desc="DepositNotes"/>
<x:EnumDoc value="EUCD" desc="EuroCertificateOfDeposit"/>
<x:EnumDoc value="EUCP" desc="EuroCommercialPaper"/>
<x:EnumDoc value="LQN" desc="LiquidityNote"/>
<x:EnumDoc value="MTN" desc="MediumTermNotes"/>
<x:EnumDoc value="ONITE" desc="Overnight"/>
<x:EnumDoc value="PN" desc="PromissoryNote"/>
<x:EnumDoc value="PZFJ" desc="PlazosFijos"/>
<x:EnumDoc value="STN" desc="ShortTermLoanNote"/>
<x:EnumDoc value="TD" desc="TimeDeposit"/>
<x:EnumDoc value="XCN" desc="ExtendedCommNote"/>
<x:EnumDoc value="YCD" desc="YankeeCertificateOfDeposit"/>
<x:EnumDoc value="ABS" desc="AssetbackedSecurities"/>
<x:EnumDoc value="CMBS" desc="CorpMortgagebackedSecurities"/>
<x:EnumDoc value="CMO" desc="CollateralizedMortgageObligation"/>
<x:EnumDoc value="IET" desc="IOETTEMortgage"/>
<x:EnumDoc value="MBS" desc="MortgagebackedSecurities"/>
<x:EnumDoc value="MIO" desc="MortgageInterestOnly"/>
<x:EnumDoc value="MPO" desc="MortgagePrincipalOnly"/>
<x:EnumDoc value="MPP" desc="MortgagePrivatePlacement"/>
<x:EnumDoc value="MPT" desc="MiscellaneousPassthrough"/>
<x:EnumDoc value="PFAND" desc="Pfandbriefe"/>
<x:EnumDoc value="TBA" desc="ToBeAnnounced"/>
<x:EnumDoc value="AN" desc="OtherAnticipationNotesBANGANEtc"/>
<x:EnumDoc value="COFO" desc="CertificateOfObligation"/>
<x:EnumDoc value="COFP" desc="CertificateOfParticipation"/>
<x:EnumDoc value="GO" desc="GeneralObligationBonds"/>
<x:EnumDoc value="MT" desc="MandatoryTender"/>
<x:EnumDoc value="RAN" desc="RevenueAnticipationNote"/>
<x:EnumDoc value="REV" desc="RevenueBonds"/>
<x:EnumDoc value="SPCLA" desc="SpecialAssessment"/>
<x:EnumDoc value="SPCLO" desc="SpecialObligation"/>
<x:EnumDoc value="SPCLT" desc="SpecialTax"/>
<x:EnumDoc value="TAN" desc="TaxAnticipationNote"/>
<x:EnumDoc value="TAXA" desc="TaxAllocation"/>
<x:EnumDoc value="TECP" desc="TaxExemptCommercialPaper"/>
<x:EnumDoc value="TRAN" desc="TaxRevenueAnticipationNote"/>
<x:EnumDoc value="VRDN" desc="VariableRateDemandNote"/>
<x:EnumDoc value="WAR" desc="Warrant"/>
<x:EnumDoc value="MF" desc="MutualFund"/>
<x:EnumDoc value="MLEG" desc="MultilegInstrument"/>
<x:EnumDoc value="NONE" desc="NoSecurityType"/>
<x:EnumDoc value="WLD" desc="WildcardEntry"/>
</xs:appinfo>
Which parameter should I change in order to register the schema?
Any help much appreciated!For example (code snippet)...
declare
V_FILENAME VARCHAR2(700) := 'CMFXML.SWIFT.MT543.xsd';
V_XMLSCHEMA XMLTYPE := xmltype(bfilename('XMLDIR',V_FILENAME),nls_charset_id('AL32UTF8'));
-- res boolean;
begin
dbms_xmlschema_annotate.addXDBNamespace(V_XMLSCHEMA);
dbms_xmlschema_annotate.setDefaultTable(V_XMLSCHEMA,'CMFXML','CMFXML_MT543_TABLE');
dbms_xmlschema_annotate.DISABLEDEFAULTTABLECREATION(V_XMLSCHEMA);
-- DEBUG generated xdb annotations via resource
-- if (dbms_xdb.existsResource('/public/'||V_FILENAME)) then
-- dbms_xdb.deleteResource('/public/'||V_FILENAME);
-- end if;
-- res := dbms_xdb.createResource('/public/'||V_FILENAME,V_XMLSCHEMA);
dbms_xmlschema.registerSchema
schemaurl => V_FILENAME,
schemadoc => V_XMLSCHEMA.getClobVal(),
local => TRUE,
genTypes => TRUE,
genBean => FALSE,
genTables => TRUE,
enablehierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
owner => user
end;
declare
V_FILENAME VARCHAR2(700) := 'CMFXML.SWIFT.MT544.xsd';
V_XMLSCHEMA XMLTYPE := xmltype(bfilename('XMLDIR',V_FILENAME),nls_charset_id('AL32UTF8'));
-- res boolean;
begin
dbms_xmlschema_annotate.addXDBNamespace(V_XMLSCHEMA);
dbms_xmlschema_annotate.setDefaultTable(V_XMLSCHEMA,'CMFXML','CMFXML_MT544_TABLE');
dbms_xmlschema_annotate.DISABLEDEFAULTTABLECREATION(V_XMLSCHEMA);
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TIndicator-22F-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TAmount-19A-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TDate-98A-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TRate-92A-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TFlag-17B-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TQuantityOfFinancialInstrument-36B-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TReference-20C-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
select insertChildXML
V_XMLSCHEMA,
'//xsd:element[@type="TParty-95PQR-01"]',
'@xdb:SQLInline',
'false',
'xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
into V_XMLSCHEMA
from dual;
dbms_xmlschema_annotate.setOutOfLine(V_XMLSCHEMA,'element','ReceiveFreeConfirmationType','TwoLegTransactionDetails','MT544_TWO_LEG_TRANS_TABLE');
dbms_xmlschema_annotate.setOutOfLine(V_XMLSCHEMA,'element','ReceiveFreeConfirmationType','TradeDetails','MT544_TRADE_DETAILS_TABLE');
dbms_xmlschema_annotate.setOutOfLine(V_XMLSCHEMA,'complexType','TTradeDetails','FinancialInstrumentAttributes','MT544_FIN_INST_ATTRS_TABLE');
-- DEBUG generated xdb annotations via resource
-- if (dbms_xdb.existsResource('/public/'||V_FILENAME)) then
-- dbms_xdb.deleteResource('/public/'||V_FILENAME);
-- end if;
-- res := dbms_xdb.createResource('/public/'||V_FILENAME,V_XMLSCHEMA);
dbms_xmlschema.registerSchema
schemaurl => V_FILENAME,
schemadoc => V_XMLSCHEMA.getClobVal(),
local => TRUE,
genTypes => TRUE,
genBean => FALSE,
genTables => TRUE,
enablehierarchy => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
owner => user
end;
-- -
How to remove trailing space-sqlldr failed OCI-30951-exceeds max length
sqlldr failed to load the xml into xdb ( table created through schema registration) because of the padded space in element 'Country' whose maximum length is defined as '3'…Is there any way to remove the extra trailing space using the control file or xdb annotation in the xsd? Thanks!
<Address>
<StreetAddress1>1 BRKSTONE SQ </StreetAddress1>
<StreetAddress2>SUITE 5 </StreetAddress2>
<City>ANDOVER </City>
<State>MA</State>
<Country>USA </Country>
<ZipCode>01810</ZipCode>
</Address>
Here is the errors I got:
kgepop: no error frame to pop to for error 30951
OCI-30951: Element or attribute at Xpath /BranchRegulatoryFiling/Branches/Branch[1]/Address/Country exceeds maximum length
Errors in file :
OCI-30951: Element or attribute at Xpath /BranchRegulatoryFiling/Branches/Branch[1]/Address/Country exceeds maximum length
----- Call Stack Trace -----
Bus Error (core dumped)
Here is my ctl file:
load data
infile *
into table xml_stg_tbl
append
reenable disabled_constraints exceptions cnstr_xcptn_tbl
xmltype(XMLDATA)(
lobfn filler char terminated by ',',
XMLDATA lobfile(lobfn) terminated by EOF
BEGINDATA
/tmp/1025552.xml
Edited by: user10954036 on Jul 27, 2009 8:12 AMHi,
Its good that u pasted the complete log file. In your environment you have to run this upgrade tool only once from any of the middle tier.
And with respect to your error that u got in precheck is quite simple. All u have to do is just run this script from by connecting to portal schema using sqlplus.
Run dropupg.sql
Location-------- /raid/product/OraHome_1/upgrade/temp/portal/prechktmp/dropupg.sql
Later you re-run the upgrade tool and let me know the status.
Good luck
Tanmai -
ORA-01044: size of buffer bound to variable exceeds maximum
Hello Oracle Gurus,
I have a tricky problem.
I have a stored procedure which has to retun more than 100,000 records. In my stored procedure, I have "TABLE OF VARCHAR2(512) INDEX BY BINARY_INTEGER". It fails when I try to get 80,000 records.
I get an error "ORA-01044: size 40960000 of buffer bound to variable exceeds maximum 33554432"
A simple calculation shows that 512*80000=40960000.
Oracle help suggests to reduce buffer size (i.e., number of records being returned or size of variable).
But, reducing the number of records returned or reducing the size of variable is not possible because of our product design constraints.
Are there any other options like changing some database startup parameters to solve this problem?
Thanks,
SridharWe are migrating an application running on Oracle 8i to 9i and found the same problem with some of the stored procedures.
Our setup:
+ Oracle 9.2.0.3.0
+ VB6 Application using OLEDB for Oracle ...
+ MDAC 2.8 msdaora.dll - 2.80.1022.0 (srv03_rtm.030324-2048)
I am calling a stored procedure from VB like this one:
{? = call trev.p_planung.GET_ALL_KONTEN(?,?,{resultset 3611, l_konto_id, l_name,l_ro_id, l_beschreibung, l_typ, l_plg_id})}
If setting the parameter "resultset" beyond a certain limit, I will eventually get this ORA-01044 error. This even happens, if the returned number of records is smaller than what supplied in the resultset parameter (I manually set the "resultset" param in the stored procedure string). E.g.:
resultset = 1000 -> ORA-06513: PL/SQL: Index der PL/SQL-Tabelle ungültig für Language-Array vom Host
resultset = 2000 -> OK (actual return: 1043 Recordsets)
resultset = 3000 -> ORA-01044: GröÃe 6000000 des Puffers für Variable überschreitet Höchstwert von 4194304
resultset = 3500 -> ORA-01044: GröÃe 7000000 des Puffers für Variable überschreitet Höchstwert von 4194304
... therefore one record is calculated here 7000000/3500=2000 bytes.
In Oracle 8i we never had this problem. As this is a huge application using a lot stored procedures, changing all "select" stored procedures to "get data by chunks" (suggestet in some forum threads in OTN) ist not an option.
Interesting: I can call the stored procedure above with the same parameters as given in VB from e.g. Quest SQL Navigator or sql plus successfully and retrieve all data!
Is there any other known solution to this problem in Oracle 9i? Is it possible to increase the maximum buffer size (Oracle documentation: ORA-01044 ... Action: Reduce the buffer size.)? What buffer size is meant here - which part in the communication chain supplies this buffer?
Any help highly appreciated!
Sincerely,
Sven Bombach -
LSX-00310: local element or attribute should be namespace qualified
I am getting the following error
ORA-31154: invalid XML document
ORA-19202: Fout in XML-verwerking (
LSX-00310: local element or attribute should be namespace qualified)
I am doing
declare
l_xmldoc XMLType;
BEGIN
l_xmldoc := xdburiType('/home/1.xml').getXML();
l_xmldoc.schemavalidate;
END;
the schema and xml file are valid , I checked them
with xmlspy
does this error mean
thanx EdwinWill need your schema and document to debug this. Sometimes we catch things SPY doesn't and sometime they catch things we miss...
-
Issue with working on a webservice that has xml elements with attributes
This is a branchout of Thread: Some more complex sample of invokin WS needed_
We are working on a project that involves a outbound SALT Web service call that includes complex elements with attributes..We are looking for options of how to use FML API's to pass these attribute values from the application code.
We opened a ticket with oracle where we were suggested to frame the entire xml and pass the xml using the FML32 of the complex element. But when we framed the xml for Service and put the entire XML which includes the attributes using the FML ID of Service.
Please find a sample Schema and XML similar to the one we are working on...its associated code
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Service" type="Service_Type" nillable="true">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="Service_Type">
<xs:sequence>
<xs:element name="DateTime" type="xs:dateTime" nillable="true">
</xs:element>
<xs:element name="UUID" nillable="true">
</xs:element>
<xs:element name="Status" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
<xs:attribute name="Version" type="xs:string" use="required">
</xs:attribute>
<xs:attribute name="Name" type="xs:string" use="required">
</xs:attribute>
</xs:complexType>
</xs:schema>
The sample XML is :
___<?xml version="1.0" encoding="UTF-8"?>___
___<!--Sample XML file generated by XMLSpy v2010 rel. 2 (http://www.altova.com)-->___
___<Service Name="TestService" Version="1.1" xsi:noNamespaceSchemaLocation="Untitled6.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">___
___ <DateTime>2001-12-17T09:30:47Z</DateTime>___
___ <UUID>text</UUID>___
___</Service>___
wsdlcvt generated the mif file with Service as a FML32 type and all its child elements as "mbstring". We tried to leave as it is and we also tried to replace all the child elements and just had a mif entry for "Service" as a mbstring neither produced a different output...Tried to dump using Ferror32 which did not dump any..._
The sample C/C++ code as per suggestions were to do the following...
_1) Have a string with the entire XML for Service_
xmldata="<Service Name=\"TestService"\ Version="1.1\"_ xsi:noNamespaceSchemaLocation=\"Untitled6.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">_
_ <DateTime>2001-12-17T09:30:47Z</DateTime>_
_ <UUID>text</UUID>_
_</Service>";_
_2) Use Fmbpack32 to create a mbstring data_
_memcpy(reqmbptr, (char*)xmldata.data(),xmldata.length());_
_len=xmldata.length();_
_Fmbpack32(mbcodeName,reqmbptr,len, packdata,(FLDLEN32 *)&packedlen,0);_
userlog("Size of packedlen is %d",packedlen);
3) Add the packed data to the output buffer
Fadd32(fmlbuffer,Service, packdata,packedlen );
But we do not see the Service tag populated in the GWWS outbound request.Everything else makes it....any help on how to move ahead would be appreciated...It seems you switch to the 10gR3 GA and now the whole XML data is mapped to FLD_MBSTRING.
I will forward my sample to you by mail, but this sample is not offical sample, it is just QA test case. You can refere it and check what's the difference.
Please let me know your mail address.
Regards,
Xu he -
ORA-14189: this physical attribute may not be specified for an index subpar
Hi,
I have many partition table and their subpartition and also I create index partition ans index subpartition.
I moved partition table another new tablespace and then when I rebuild partition indexes I am getting below error.
ORA-14189: this physical attribute may not be specified for an index subpartition
I coulsn't understand the problem and I also not find a answer google.
Details:
ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP148ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP1ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP21ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP41ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP61ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP62ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP63ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP64ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP122ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP123ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP124ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP125ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP201ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP206ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP207ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP208ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP261ALTER INDEX ADMINISTRATOR.DX_IND REBUILD
SUBPARTITION SYS_SUBP262
Error at line 2
ORA-14189: this physical attribute may not be specified for an index subpartition
db version: 9.2.0.8
Could you any body help me please how can I solve this problem.
thanks and regards,Hi Justen,
I just run rebuild the index with TOAD. So just I copied toad error output so I haven't written it and also in my computer there is a space. I think when I paste the output here, space gone out.
Anyway, I found workaround solution. First I am taking the script from toad then drop and recreate the index. But this takes very long time, only one index takes 1 hour for recreation. so I have so many index like this and If I calculate all indexes takes 3 days for recreation again.
any other solution is there?
thanks and regards -
ORA-22160: element at index name does not exist
hi
i have a procedure which insert values from a VARRAY type in a table. My question is how can i verify the existence of nth element before inserting to avoid ORA-22160: element at index name does not exist
Here is my code:
CREATE OR REPLACE PACKAGE BODY CANDIDE.PE_CL IS
PROCEDURE p_proc(Id_clt IN P_CLIENT.id_client%TYPE,
nameClt IN P_CLIENT.nameclient%TYPE,
--VARRAY type
priceItem IN price_array,
--VARRAY type
nameItem IN item_array) IS
BEGIN
INSERT INTO P_CLIENT VALUES (Id_clt, nameClt);
FORALL i IN nameItem.FIRST .. nameItem.LAST
INSERT INTO P_ITEMS VALUES (Id_clt, nameItem(i), priceItem(i));
END;
end PE_CL;
Product version: Oracle9i Enterprise Edition Release 9.2.0.1.0
PeterI see the problem now. If there are more values in one varray or the other, how do you want to handle it? Below I have demonstrated, first the solution that I previous offered, that would only insert the rows where there are values from both varrays. In the second example below, I have inserted a null value in place of the missing value from the varray that has fewer values.
scott@ORA92> CREATE TABLE p_client
2 (id_client NUMBER,
3 nameclient VARCHAR2(15))
4 /
Table created.
scott@ORA92> CREATE TABLE p_items
2 (id_client NUMBER,
3 name_item VARCHAR2(10),
4 price_item NUMBER)
5 /
Table created.
scott@ORA92> CREATE OR REPLACE PACKAGE PE_CL
2 IS
3 TYPE item_array IS ARRAY(10) OF VARCHAR2(10);
4 TYPE price_array IS ARRAY(10) OF number;
5 PROCEDURE p_proc
6 (Id_clt IN P_CLIENT.id_client%TYPE,
7 nameClt IN P_CLIENT.nameclient%TYPE,
8 priceItem IN price_array,
9 nameItem IN item_array);
10 end PE_CL;
11 /
Package created.
scott@ORA92> show errors
No errors.
-- first method:
scott@ORA92> CREATE OR REPLACE PACKAGE BODY PE_CL
2 IS
3 PROCEDURE p_proc
4 (Id_clt IN P_CLIENT.id_client%TYPE,
5 nameClt IN P_CLIENT.nameclient%TYPE,
6 priceItem IN price_array,
7 nameItem IN item_array)
8 IS
9 BEGIN
10 INSERT INTO P_CLIENT VALUES (Id_clt, nameClt);
11 -- FORALL i IN nameItem.FIRST .. nameItem.LAST
12 -- INSERT INTO P_ITEMS VALUES (Id_clt, nameItem(i), priceItem(i));
13 FOR i IN nameItem.FIRST .. nameItem.LAST LOOP
14 IF nameItem.EXISTS(i) AND priceItem.EXISTS(i) THEN
15 INSERT INTO P_ITEMS VALUES (Id_clt, nameItem(i), priceItem(i));
16 END IF;
17 END LOOP;
18 END;
19 end PE_CL;
20 /
Package body created.
scott@ORA92> show errors
No errors.
scott@ORA92> declare
2 priceitem pe_cl.price_array := pe_cl.price_array(2, 5);
3 nameitem pe_cl.item_array := pe_cl.item_array('item a', 'item b', 'item c');
4 begin
5 pe_cl.p_proc
6 (id_clt => 900,
7 nameclt => 'MIKE',
8 priceitem => priceitem,
9 nameitem => nameitem);
10 COMMIT;
11 end;
12 /
PL/SQL procedure successfully completed.
scott@ORA92> SELECT * FROM p_client
2 /
ID_CLIENT NAMECLIENT
900 MIKE
scott@ORA92> SELECT * FROM p_items
2 /
ID_CLIENT NAME_ITEM PRICE_ITEM
900 item a 2
900 item b 5
scott@ORA92> TRUNCATE TABLE p_client
2 /
Table truncated.
scott@ORA92> TRUNCATE TABLE p_items
2 /
Table truncated.
-- second method:
scott@ORA92> CREATE OR REPLACE PACKAGE BODY PE_CL
2 IS
3 PROCEDURE p_proc
4 (Id_clt IN P_CLIENT.id_client%TYPE,
5 nameClt IN P_CLIENT.nameclient%TYPE,
6 priceItem IN price_array,
7 nameItem IN item_array)
8 IS
9 BEGIN
10 INSERT INTO P_CLIENT VALUES (Id_clt, nameClt);
11 -- FORALL i IN nameItem.FIRST .. nameItem.LAST
12 -- INSERT INTO P_ITEMS VALUES (Id_clt, nameItem(i), priceItem(i));
13 FOR i IN nameItem.FIRST .. nameItem.LAST LOOP
14 IF nameItem.EXISTS(i) AND priceItem.EXISTS(i) THEN
15 INSERT INTO P_ITEMS VALUES (Id_clt, nameItem(i), priceItem(i));
16 ELSIF nameItem.EXISTS(i) THEN
17 INSERT INTO P_ITEMS VALUES (Id_clt, nameItem(i), null);
18 ELSIF priceItem.EXISTS(i) THEN
19 INSERT INTO P_ITEMS VALUES (Id_clt, null, priceItem(i));
20 END IF;
21 END LOOP;
22 END;
23 end PE_CL;
24 /
Package body created.
scott@ORA92> show errors
No errors.
scott@ORA92> declare
2 priceitem pe_cl.price_array := pe_cl.price_array(2, 5);
3 nameitem pe_cl.item_array := pe_cl.item_array('item a', 'item b', 'item c');
4 begin
5 pe_cl.p_proc
6 (id_clt => 900,
7 nameclt => 'MIKE',
8 priceitem => priceitem,
9 nameitem => nameitem);
10 COMMIT;
11 end;
12 /
PL/SQL procedure successfully completed.
scott@ORA92> SELECT * FROM p_client
2 /
ID_CLIENT NAMECLIENT
900 MIKE
scott@ORA92> SELECT * FROM p_items
2 /
ID_CLIENT NAME_ITEM PRICE_ITEM
900 item a 2
900 item b 5
900 item c
Maybe you are looking for
-
Last week, I removed the battery from my MacBook because it was time to replace it (the first time since I bought it). When I did it and I tried to turn the computer on without the battery, it didn't work. The same day, I made a SMC reset but it didn
-
Sparks when plugging external monitor in
Slightly worried, just connected my Dell monitor via DVI to my macbook pro and noticed a small spark each time the adapter touched the port. This only happens when the display is powered. Should i be worried, is this normal? thanks.
-
Some functions not working in Acrobat Pro 08
For some reason lately when I try to apply a Header/Footer, or Watermark to a pdf document in Acrobat 8 pro the normal dialog box doesn't come up. Am I missing something??? My info: Mac OS X version 10.6.4 Build 10F569 Model Name: MacBook Pro Mode
-
We recently bought 3 new Intel Core Duo running 10.4.8 but we have to downgrade to 10.4.7 since our POS manufacturer informs us that there are some issues with 10.4.8. The downgrade seems okay but when we try to change the date in the Point of Sale s
-
IMac screen issues and iPhoto issues
Hello all, My girlfriend just bought the imac with the 21.5' screen and recently everytime I scroll the screen gets pixilated. And for some reason, now on iPhoto the thumbnails come up but when I click on them no picture comes up to full size. It's