|
next
|
 Subject: Mapping XML to Oracle Author: sue depa Date: 28 Jul 2005 06:08 PM
|
Hi All,
I need to map the xml file data to Oracle. Right now I am using the below PL/SQL to map the below xml element info.
XML element info:
<Carrier>
<OrganizationId>INTL</OrganizationId>
<OrganizationName>Integra Logistics LLC</OrganizationName>
</Carrier>
PL/SQL Code:
ELSIF LOWER(node_name)=LOWER('ORGANIZATIONID') THEN
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
IF LOWER(node_name)=LOWER('CARRIER') THEN
INSERT INTO CARRIER(recordnum,organizationid,code) VALUES
(rownumber,nodevalue,'shipment_status_214');
ELSIF LOWER(node_name)=LOWER('CarrierSCAC') THEN
INSERT INTO CARRIER(recordnum,scac_id,code) VALUES
(rownumber,nodevalue,'shipment_status_214');
ELSIF LOWER(node_name)=LOWER('ORGANIZATIONNAME') THEN
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
m:=xmldom.getParentNode(m);
node_name:=xmldom.getNodeName(m);
dbms_output.put_line(' the parent node is: '||node_name);
IF LOWER(node_name)=LOWER('CARRIER') THEN
INSERT INTO CARRIER(recordnum,organizationname,code) VALUES
(rownumber,nodevalue,'shipment_status_214');
ELSIF LOWER(node_name)=LOWER('CarrierSCAC') THEN
INSERT INTO CARRIER(recordnum,scac_name,code) VALUES
(rownumber,nodevalue,'shipment_status_214');
ELSE
dbms_output.put_line('unreferenced attribute ' || attrname || ' = ' || attrval);
Fnd_File.put_line(Fnd_File.LOG,'unreferenced attribute ' || attrname || ' = ' || attrval);
END IF;
And Now there is change in the XML Element above as follows:
<Carrier>
<OrganizationId type="SCAC">INTL</OrganizationId>
<OrganizationName>Integra Logistics LLC</OrganizationName>
</Carrier>
My program gives me error for this element saying Unreferenced element in attribute .... Please help me to map this info.
Thanks,
Sue
|
|
|
|