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
Similar Messages
-
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 ChauhanHi 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-19202: Error occurred in XML processing
HI,
I was preparing a support schema which is in synch with the production schema. For one of the UI i am getting the following error when the XML is too large.
The same code is working in the production schema.
I did a reconcilation and found the code sources are exactly the same.Pasting the debug lines below.Please help resolving the issue.
gwpks_service_router.Getting the msg status for
gwpks_service_router.Inside fn_get_msgstat
gwpks_service_router.In wot of msg stat extraction: ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00225: end-element tag "REC" does not match start-element tag "FCUBS_BODY"
Error at line 15697
gwpks_service_router.l_msgstat:
gwpks_service_router.Returning
gwpks_service_router.l_msg_stat:
gwpks_service_router.p_Process_Stat: S
gwpks_service_router. fn_service_router return true
gwpks_service_router.After fn_service_router, msgId:
gwpks_service_router.Logging begins
gwpks_service_router.Inside fn_populate_logs
gwpks_service_router.Inside fn_get_msgstat
gwpks_service_router.In wot of msg stat extraction: ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00225: end-element tag "REC" does not match start-element tag "FCUBS_BODY"
Error at line 15697
gwpks_service_router.l_msgstat:
gwpks_service_router.Returning
gwpks_service_router.Msg Status:
gwpks_service_router.About to start the logging with MsgId:
gwpks_service_router.fn_populate_logs returning true
gwpks_service_router.MsgId:
gwpks_service_router.SysMsgId:
gwpks_service_router.MultitripId:
gwpks_service_router.l_process_stat in pr_process_req_msg : S
gwpks_service_router.GRAND SUCCESS CLOSING DEBUG
gwpks_service_router.GRAND SUCCESS CLOSING DEBUG 1Hi,
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
The code is very big.I prepared another schema on another database and the code is working.
Then v$ version of the working schema is as below:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Still wonder why this works in the second schema but not the first one. -
Error while processing XML ; ORA-19202: Error occurred in XML processing
We have an application, which sends an XML to DB for processing.
While it works in general, it is failing, when special characters are present in the text node
see example below
<?xml version="1.0" encoding="UTF-8"?>
<Query>
<Group>
<Value> %</Value>
</Group>
</Query>
Db throws following error while parsing this xml
XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00217: invalid character 15573180 (U+EDA0BC)
How to fix it?The following works for me on 11.2.0.2, db charset AL32UTF8 :
test_sample.xml, encoding UTF-8 :
<?xml version="1.0" encoding="UTF-8"?>
<Query>
<Group>
<Value>?%</Value>
</Group>
</Query>NB : the characters behind the "?" got lost after posting, they're actually 0xF09F 8C82
Loading...
SQL> truncate table tmp_xml;
Table truncated
SQL>
SQL> insert into tmp_xml values (
2 xmltype(
3 bfilename('TEST_DIR','test_special.xml')
4 , nls_charset_id('AL32UTF8')
5 )
6 );
1 row inserted
SQL> set long 500
SQL> select * from tmp_xml;
SYS_NC_ROWINFO$
<?xml version="1.0" encoding="UTF-8"?>
<Query>
<Group>
<Value>í ¼í¼‚%</Value>
</Group>
</Query>
Edited by: odie_63 on 25 sept. 2012 23:00 -
ORA-19202: Error occurred in XML processingLSX-00023: unknown namespace URI
Hi there
I am trying to register an XSD document as an XML schema on the database. I am using Oracle 9i release 9.2.0.5.0 and using the dbms_xmlschema.registerSchema method in PL/SQL.
I am getting the following error when trying to register:
ORA-19202: Error occurred in XML processing LSX-00023: unknown namespace URI
The problem seems to be caused by a local simpleType declared outside of the root element. If I remove the simpleType from the xsd, I can register it successfully as a schema on the database. However, we need the simpleType there as it defines valid values for one of the elements in the xsd.
The xsd follows the structure:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.oracle.com/VFLOC.xsd"
xmlns:vfloc="http://www.oracle.com/VFLOC.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb">
<xsd:element name="VisionDataExchange">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Credentials">
...... etc. etc.
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- Data Types Must complete data type values from database -->
<xsd:simpleType name="TrueFalseType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="1"/>
<xsd:enumeration value="0"/>
<xsd:enumeration value="True"/>
<xsd:enumeration value="False"/>
</xsd:restriction>
<!-- 1 and 0 are preferred -->
</xsd:simpleType>
</xsd:schema>
Does anyone know how I can register a schema with a targetNamespace and the local simpleType below?
Any help would be much appreciated.
Thanks!
SonyaHi
I wanted to know
1)Hw to register a schema
2) Associate xml files with the schema
3) hw to do read the xml files
If you could provide a small exampl, shall appreciate
Thanks for your help in advance
Sushil -
ORA-19202: Error occurred in XML processing ORA-24333: zero iteration coun
Hi,
I have a procedure which craetes a sql v_sql dynamically
IF v_cnt > 0 THEN
For c1 in v_curr
LOOP
v_sql := ''''||'SELECT * from '|| c1.msg_rcrd_src_tbl_nm||' where rowid = '||''''||''''||c1.msg_rcrd_src_tbl_id||''''||''''||'''';
select DBMS_XMLGEN.getXMLtype(v_sql) into v_xml from dual ;
gives me a error
ORA-19202: Error occurred in XML processing
ORA-24333: zero iteration count
ORA-06512: at "SYS.DBMS_XMLGEN", line 288
ORA-06512: at line 1
Any help greatly appreciated.
Thanks,
RajAnswered
Re: Zero iteration error - when processing dynamic sql in dbms_xmlgen -
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> -
[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,
ViacheslavNo, 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; -
XML parsing failed : Try to update FCRM field
i created one field in fusion crm ,lead . and i have one table in my oracle EBS database i write one procedure which get data from table and pur into fcrm
when i call procedure with static value it perfactly alright but ,when try to use xml parsing for all records give following error
ORA-20001: An error was encountered - -31011 -ERRORORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00245: extra data after end of document
Error at line 1
ORA-06512: at "SCOTT.XX_LEAD_UPDATE", line 101
ORA-06512: at line 1
my procedure as follow :
CREATE OR REPLACE PROCEDURE xx_lead_update
--(p_leadid IN VARCHAR2,p_xx_kp_lead IN VARCHAR2)
IS
p_leadid VARCHAR2(50);
p_xx_kp_lead VARCHAR2(50);
CURSOR c1 IS
SELECT FCRM_LEADID,XX_KP_LEAD
FROM XX_KP_EBSLEAD
WHERE ID = 6;
-- Construct xml payload, which is used to invoke the service.
l_envelope VARCHAR2(32767) := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/types/" xmlns:lead="http://xmlns.oracle.com/oracle/apps/marketing/leadMgmt/leads/leadService/" xmlns:lead1="http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/" xmlns:not="http://xmlns.oracle.com/apps/crmCommon/notes/noteService" xmlns:not1="http://xmlns.oracle.com/apps/crmCommon/notes/flex/noteDff/">
<soapenv:Header/>
<soapenv:Body>
<typ:updateSalesLead>
<typ:salesLead>
<lead:LeadId>'||p_leadid||'</lead:LeadId>
<lead:xx_kp_lead_c>'||p_xx_kp_lead||'</lead:xx_kp_lead_c>
</typ:salesLead>
</typ:updateSalesLead>
</soapenv:Body>
</soapenv:Envelope>';
--PartyId: 300000000912340
l_result VARCHAR2(32767) := null;
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
v_len number;
v_txt Varchar2(32767);
soap_respond CLOB;
resp xmltype;
l_str long;
v_str varchar2(100);
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO p_leadid,p_xx_kp_lead;
dbms_output.put_line ('p_xx_kp_lead '||p_xx_kp_lead);
dbms_output.put_line ('p_leadid: '||p_leadid);
-- Sets the Oracle wallet used for request, required for HTTPS
UTL_HTTP.set_wallet('file:/apps/oracle/dnlclone/10.2.0/wallet','test1234');
-- Creates new HTTP request
l_http_request := UTL_HTTP.begin_request('https://aes.crm.ap2.oraclecloud.com:443/mklLeads/SalesLeadService?WSDL', 'POST','HTTP/1.1');
-- Configure the authentication details on the request
UTL_HTTP.SET_AUTHENTICATION(l_http_request, '[email protected]', 'DNLcrm*1');
-- Configure the request content type to be xml and set the content length
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
-- Set the SOAP action to be invoked; while the call works without this the value is expected to be set based on standards
UTL_HTTP.set_header(l_http_request, 'SOAPAction','http://xmlns.oracle.com/apps/marketing/leadMgmt/leads/leadService/');
-- Write the xml payload to the request.
UTL_HTTP.write_text(l_http_request, l_envelope);
-- Get the response
l_http_response := UTL_HTTP.get_response(l_http_request);
utl_http.get_header_by_name(l_http_response, 'Content-Length', v_len, 1); -- Obtain the length of the response
FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
LOOP
utl_http.read_text(l_http_response, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
soap_respond := soap_respond || v_txt; -- build up CLOB
END LOOP;
UTL_HTTP.END_RESPONSE(l_http_response);
resp:= xmltype.createxml(soap_respond); -- Convert CLOB to XMLTYPE
--Using extract or extractvalue methods, retrieve value from a particular element/tag in the xml
--v_str := resp.extract('/env:Envelope/env:Body/ns0:updateOpportunityResponse/ns2:result/ns3:EBSOrderNumber_c/text()','xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/types/" xmlns:ns2="http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/types/" xmlns:ns3="http://xmlns.oracle.com/apps/sales/opptyMgmt/opportunities/opportunityService/"').getstringval();
l_str := resp.extract('/*').getstringval();
LOOP
EXIT
WHEN l_str IS NULL;
dbms_output.put_line (SUBSTR (l_str, 1, instr (l_str, chr(10)) - 1));
l_str := SUBSTR (l_str, instr (l_str, chr(10)) + 1);
END LOOP;
--dbms_output.put_line('EBS Order Number updated as: '||v_str);
EXIT WHEN c1%NOTFOUND;
END LOOP;
CLOSE c1;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
--dbms_output.put_line('Exception');
RAISE_APPLICATION_ERROR(-20001,'An error was encountered - '
||SQLCODE||' -ERROR'||SQLERRM);
END;Hi,
Remove the exception handler (it's totally useless here) and tell us which line is really giving the error. -
XML parsing failed while select from my table with criteria
While select from my table an error displayed as
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '/<XML Path>/row[c24="SA0010001"]'
select * from category
where existsNode(xmlrecord, '/<XML Path>/row[c24="SA0010001"]') = 1;
xmlrecord
<row id="52843" xml:space="preserve">
<c1>Refund of Domestic Payment Order</c1>
<c2>Ref Dom Py Or</c2>
<c3>PLsql</c3>
<c20>1</c20>
<c21>62_TAABSINPUTT___OFS_TAABS</c21>
<c22>0803181605</c22>
<c23>62_TAABSINPUTT_OFS_TAABS</c23>
<c24>SA0010001</c24>
<c25>1</c25>
</row>Hi,
Did you copy that sample from some demo?
The part "<XML Path>" is meant to be replaced by a real XPath fragment.
Here, I think you may just want this :
select * from category
where existsNode(xmlrecord, '/row[c24="SA0010001"]') = 1;Edit : OK, just seen your previous post and the example given
Edited by: odie_63 on 6 juil. 2010 21:16 -
XML parsing failed - Works in Oracle Developer fails in SQLplus
Hello,
I am trying to figure out what could possibly be causing my XML parsing to fail from sqlplus. Basically the exact same sql script fails with the following error when run from sqlplus but works fine in Oracle Developer.
Now I have read a number of posts talking about the NLS_Lang and characterset issues. But these are all running on the same machine.
Error Message Received:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00222: error received from SAX callback function
ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
ORA-06512: at line 53
Exact SQL Script
DECLARE
insCtx DBMS_XMLStore.ctxType;
rows NUMBER;
xmldoc CLOB :=
'<DepotData DepotCode="B106">
<tblPoint_of_Call>
<DEPOTCODE>B106</DEPOTCODE>
<MASTERKEY>2077</MASTERKEY>
<ADDR_ID>45286159</ADDR_ID>
<ADDR_MAIL_ID>45286160</ADDR_MAIL_ID>
<STREETBLOCK_KEY>45</STREETBLOCK_KEY>
<PC_ID>19603417</PC_ID>
<ST_ID>40034414</ST_ID>
<BUILDING_KEY>0</BUILDING_KEY>
<ADDR_NUM>505</ADDR_NUM>
<POCTYPE>154</POCTYPE>
<RECEPTACLETYPE>964</RECEPTACLETYPE>
<TOTALPOCS>1</TOTALPOCS>
<TOTALPOCSOCCUPIED>1</TOTALPOCSOCCUPIED>
<TOTALADMAIL>1</TOTALADMAIL>
<OLD038POC>0</OLD038POC>
<OCCUPIED>1</OCCUPIED>
<ADMAIL>1</ADMAIL>
<BAGGER>0</BAGGER>
<SORTED>1</SORTED>
<DELIVERED>1</DELIVERED>
<AMOBLIGATORY>0</AMOBLIGATORY>
<POCICANDIDATE>0</POCICANDIDATE>
<DELIVERYSEQUENCE>10</DELIVERYSEQUENCE>
<NUMSEPARATIONS>0.50</NUMSEPARATIONS>
<SEPSGROUPID>0</SEPSGROUPID>
<DELETED>0</DELETED>
<CARDID>0</CARDID>
<CARD>0</CARD>
<FORCECARD>0</FORCECARD>
<DNC>0</DNC>
<PRINTED>0</PRINTED>
<A12CARD>0</A12CARD>
<EXTRACARDS>0</EXTRACARDS>
<DSOUPDATECODE>0</DSOUPDATECODE>
<TRANSACTION_TYPE>0</TRANSACTION_TYPE>
<UPDATE_TYPE>0</UPDATE_TYPE>
<SORTSEQUENCE>10</SORTSEQUENCE>
<BUILDINGBASE>0</BUILDINGBASE>
</tblPoint_of_Call>
</DepotData>';
BEGIN
insCtx := DBMS_XMLStore.newContext('AIMPRIME.TBLPOINT_OF_CALL'); -- get saved context
-- set the columns to be updated as a list of values
-- Now insert the doc.
-- This will only insert into EMPNO, SAL and HIREDATE columns
DBMS_XMLStore.setRowTag(insCtx,'tblPoint_of_Call');
rows := DBMS_XMLStore.insertXML(insCtx, xmlDoc);
-- Close the context
DBMS_XMLStore.closeContext(insCtx);
END;
System Information:
Oracle XE on windows XP. Everything is running on the same machine, sqlplus, Oracle Developer and the database are all on the same machine.
If you need any more information please let me know, and how to get the information you want. I am not a DBA so I don't know how to do a lot of things with oracle, but I do know that this SQL should be working.NLS...read up on them
on the same machine, yeah and...?
(1) c:\> set NLS_LANG=.....
(2) c:\> sqlplus
-- sqlplus has the active nls settings set from (1)
3) you now connect to a database
- this database has an NLS character settings that where set during using a spfile or pfile
- or, as in the case of the characterset, was defined and set once, during the creation of the database.
So...
Your NLS settings in (1) can be different from the ones that are active in the database (3).
Your NLS settings are / can be set on windows on 5 levels
In the registry under /software/oracle:
1) on HKEY_LOCAL_MACHINE
2) on HKEY LOCAL USER
In the envionment settings from windows under control panel, system, advanced, environment settings:
3) on system level
4) on user level
5) On command level via explicitly setting the parameter before starting the actual program
So in all, you can have the case where the NLS settings from sqlplus or Oracle Developer or the database are all different.
http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm -
I tried to parse an XML file in a directory using PL/SQL code below and to display it in the screen
create or replace procedure xmlcheck
as
zbfile BFILE;
zclob CLOB;
zparser dbms_xmlparser.Parser;
zdoc dbms_xmldom.DOMDocument;
znl dbms_xmldom.DOMNodeList;
zn dbms_xmldom.DOMNode;
ztemp VARCHAR2(1000);
TYPE t_type IS TABLE OF emp%ROWTYPE;
t_tab t_type := t_type();
BEGIN
zbfile := BFileName('FILDIR', '1.xml');
dbms_lob.createtemporary(zclob, cache=>FALSE);
dbms_lob.open(zbfile, dbms_lob.lob_readonly);
dbms_lob.loadFromFile(dest_lob => zclob,
src_lob => zbfile,
amount => dbms_lob.getLength(zbfile));
dbms_lob.close(zbfile); --Closes the internal LOB
zparser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(zparser, zclob);
zdoc := dbms_xmlparser.getDocument(zparser);
dbms_lob.freetemporary(zclob);
dbms_xmlparser.freeParser(zparser);
znl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(zdoc),'/EMPLOYEES/EMP');
FOR cur_emp IN 0 .. dbms_xmldom.getLength(znl) - 1 LOOP
zn := dbms_xmldom.item(znl, cur_emp);
t_tab.extend;
dbms_xslprocessor.valueOf(zn,'EMPNO/text()',t_tab(t_tab.last).eno,null);
dbms_xslprocessor.valueOf(zn,'ENAME/text()',t_tab(t_tab.last).ename,null);
END LOOP;
-- Insert data into the real EMP table from the table collection.
-- Form better performance multiple collections should be used to allow
-- bulk binding using the FORALL construct but this would make the code
-- too long-winded for this example.
FOR cur_emp IN t_tab.first .. t_tab.last LOOP
dbms_output.put_line('E No: '|| t_tab(cur_emp).eno ||', Ename: ' ||t_tab(cur_emp).ename);
END LOOP;
dbms_xmldom.freeDocument(zdoc);
EXCEPTION
WHEN OTHERS THEN
raise_application_error (-20110,'Error Occurred' || sqlerrm);
dbms_lob.freetemporary(zclob);
dbms_xmlparser.freeParser(zparser);
dbms_xmldom.freeDocument(zdoc);
END;
but this throws an error mentioned below (that too only when i add exception handling)
ERROR at line 1:
ORA-20110: Error Occurred
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '<'
Error at line 1
ORA-06512: at "SYS.XMLCHECK", line 110
ORA-06512: at line 1
Im new to handling XML files with oracle, can anyone suggest what can be the cause?
Thanks.sorry here is the right code.
create table emp(eno number(10), ename varchar2(100))
create or replace procedure xmlcheck
as
zbfile BFILE;
zclob CLOB;
zparser dbms_xmlparser.Parser;
zdoc dbms_xmldom.DOMDocument;
znl dbms_xmldom.DOMNodeList;
zn dbms_xmldom.DOMNode;
ztemp VARCHAR2(1000);
TYPE t_type IS TABLE OF emp%ROWTYPE;
t_tab t_type := t_type();
BEGIN
zbfile := BFileName('FILDIR', '1.xml');
dbms_lob.createtemporary(zclob, cache=>FALSE);
dbms_lob.open(zbfile, dbms_lob.lob_readonly);
dbms_lob.loadFromFile(dest_lob => zclob,
src_lob => zbfile,
amount => dbms_lob.getLength(zbfile));
dbms_lob.close(zbfile); --Closes the internal LOB
zparser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(zparser, zclob);
zdoc := dbms_xmlparser.getDocument(zparser);
dbms_lob.freetemporary(zclob);
dbms_xmlparser.freeParser(zparser);
znl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(zdoc),'/EMPLOYEES/EMP');
FOR cur_emp IN 0 .. dbms_xmldom.getLength(znl) - 1 LOOP
zn := dbms_xmldom.item(znl, cur_emp);
t_tab.extend;
dbms_xslprocessor.valueOf(zn,'EMPNO/text()',t_tab(t_tab.last).eno,null);
dbms_xslprocessor.valueOf(zn,'ENAME/text()',t_tab(t_tab.last).ename,null);
END LOOP;
FOR cur_emp IN t_tab.first .. t_tab.last LOOP
dbms_output.put_line('E No: '|| t_tab(cur_emp).eno ||', Ename: ' ||t_tab(cur_emp).ename);
END LOOP;
dbms_xmldom.freeDocument(zdoc);
EXCEPTION
WHEN OTHERS THEN
raise_application_error (-20110,'Error Occurred' || sqlerrm);
dbms_lob.freetemporary(zclob);
dbms_xmlparser.freeParser(zparser);
dbms_xmldom.freeDocument(zdoc);
END;
and the error message that i receive after adding exception handling.
ERROR at line 1:
ORA-20110: Error Occurred
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '<'
Error at line 1
ORA-06512: at "SYS.XMLCHECK", line 110
ORA-06512: at line 1
can anyone pls suggest a corrective action?
Thanks. -
it 's 10g
set serveroutput on
set line 2000
drop table emp;
CREATE TABLE EMP (
EMPNO NUMBER(10),
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7, 2),
COMM NUMBER(7, 2),
DEPTNO NUMBER(2));
DECLARE
l_bfile BFILE;
l_clob CLOB;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
l_nl dbms_xmldom.DOMNodeList;
l_n dbms_xmldom.DOMNode;
l_temp VARCHAR2(1000);
TYPE tab_type IS TABLE OF emp%ROWTYPE;
t_tab tab_type := tab_type();
BEGIN
l_bfile := BFileName('ADMIN1_DIR', 'emp.xml');
dbms_lob.createtemporary(l_clob, cache=>FALSE);
dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
dbms_lob.loadFromFile(dest_lob => l_clob,
src_lob => l_bfile,
amount => dbms_lob.getLength(l_bfile));
dbms_lob.close(l_bfile);
-- make sure implicit date conversions are performed correctly
dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY''');
-- Create a parser.
l_parser := dbms_xmlparser.newParser;
-- Parse the document and create a new DOM document.
dbms_xmlparser.parseClob(l_parser, l_clob);
l_doc := dbms_xmlparser.getDocument(l_parser);
-- Free resources associated with the CLOB and Parser now they are no longer needed.
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
-- Get a list of all the EMP nodes in the document using the XPATH syntax.
--l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/EMPLOYEES/EMP');
l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/ipdrIPDR');
-- Loop through the list and create a new record in a tble collection
-- for each EMP record.
FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
l_n := dbms_xmldom.item(l_nl, cur_emp);
t_tab.extend;
-- Use XPATH syntax to assign values to he elements of the collection.
-- dbms_xslprocessor.valueOf(l_n,'recordId/text()',t_tab(t_tab.last).empno);
dbms_xslprocessor.valueOf(l_n,'recordId/text()',t_tab(t_tab.last).ename);
dbms_xslprocessor.valueOf(l_n,'JOB/text()',t_tab(t_tab.last).job);
dbms_xslprocessor.valueOf(l_n,'MGR/text()',t_tab(t_tab.last).mgr);
dbms_xslprocessor.valueOf(l_n,'HIREDATE/text()',t_tab(t_tab.last).hiredate);
dbms_xslprocessor.valueOf(l_n,'SAL/text()',t_tab(t_tab.last).sal);
dbms_xslprocessor.valueOf(l_n,'COMM/text()',t_tab(t_tab.last).comm);
dbms_xslprocessor.valueOf(l_n,'DEPTNO/text()',t_tab(t_tab.last).deptno);
END LOOP;
-- Insert data into the real EMP table from the table collection.
-- Form better performance multiple collections should be used to allow
-- bulk binding using the FORALL construct but this would make the code
-- too long-winded for this example.
FOR cur_emp IN t_tab.first .. t_tab.last LOOP
INSERT INTO emp
ename
VALUES
t_tab(cur_emp).ename
END LOOP;
COMMIT;
-- Free any resources associated with the document now it
-- is no longer needed.
dbms_xmldom.freeDocument(l_doc);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('errrrrrrrr--->'||sqlerrm);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
END;
/select * from emp;
this file works fine
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ipdrIPDR>
<recordId>923622</recordId>
</ipdrIPDR>
but this is not . .. note my special charter in the tokens... i did change in the program too but does not work ...
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ipdr:IPDR>
<recordId>923622</recordId>
</ipdr:IPDR>
I get error
errrrrrrrr--->ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00234: namespace prefix "ipdr" is not declared
Error at line 2
PL/SQL procedure successfully completed.Hi,
Yes, I have tried the same method. will be ok.
But I have got another some records on the same column as follows.
I have tried with another one xmltable with outer join(+), still not getting the actual data (null record from the original(main) table) and extra records from the new xmltable.
Is it possible to make one or union with xmltable also can we check the node either /Item or /section exists something like that
<?xml version="1.0" encoding="WINDOWS-1252"?>
<section>
<sectionmetadata>
<object_id>317832</object_id>
<asitype>Section</asitype>
<instructornotes/>
</sectionmetadata>
<selection_ordering>
<selection seltype="All">
<selection_number>1</selection_number>
<or_selection>
<selection_metadata mdoperator="EQ" mdname="questionid">_155451_1</selection_metadata>
</or_selection>
</selection>
<selection seltype="All">
<or_selection>
<selection_param pname="singleLink">true</selection_param>
</or_selection>
</selection>
</selection_ordering>
</section>Thanks, -
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
MuraliMurali ,
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
-
Urgent: Error in uploading data in cube after adding new Key figure
Hi Guys, I have added 1 key figure (DEC) to my existing cube. and proceeded as below: 1. Deleted all data from cube 2. activated the cube 3. set Constant 1 for this key figure 4. activated the transformation 5. reated a new DTP But when i execute it,
-
Counting Number of calls Occurring at the same time (Concurrent)
Hi All, Thanks for the help in advance. I have a T-SQL problem I'm not sure how to solve. I have a table which holds calls. The table gives a start time and a booked duration time which I can use to create a booked end time. I would like to count
-
When downloading from a Sony minidisc video camera, the picture is downloading but without sound. Previously, it had downloaded successfully both sound and picture. I have subsequently upgraded to Lion X (10.7.4). Is there some problem with the up
-
Is a BAPIBadi available for uploading data to create Service Entry Sheet?
Dear MM Gurus, Users are currently entering Service PO and creating Service Entry sheet for the Subcontractor consultants (using Transaction code - ML81N) by referring to the Service PO. Due to the high amount of data, the users do not want to creat
-
SEVERE: Servlet threw load() exception
I am trying to load servlet in Tomcat 5.5 . It is throwing an exception as follows. The LicenseAuthentication class exists in WEB-INF/Class directory. So it is not the problem. 1. In lib folder there is no servlet.jar. If I put that I am getting diff