How to retreive soap xml data from clob column in a table
Hi,
I am trying to retrieve the XML tag value from clob column.
Table name = xyz and column= abc (clob datatype)
data stored in abc column is as below
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:head="http://www.abc.com/gcgi/shared/system/header" xmlns:v6="http://www.abc.com/gcgi/services/v6_0_0_0" xmlns:sys="http://www.abc.com/gcgi/shared/system/systemtypes">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<RqHeader soapenv:mustUnderstand="0" xmlns="http://www.abc.com/gcgi/shared/system/header">
<DateAndTimeStamp>2011-12-20T16:02:36.677+08:00</DateAndTimeStamp>
<UUID>1000002932</UUID>
<Version>6_0_0_0</Version>
<ClientDetails>
<Org>ABC</Org>
<OrgUnit>ABC</OrgUnit>
<ChannelID>HBK</ChannelID>
<TerminalID>0000</TerminalID>
<SrcCountryCode>SG</SrcCountryCode>
<DestCountryCode>SG</DestCountryCode>
<UserGroup>HBK</UserGroup>
</ClientDetails>
</RqHeader>
<wsa:Action>/SvcImpl/bank/
SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq</wsa:Action></soapenv:Header>
<soapenv:Body>
<v6:AlertDeleteInqRq>
<v6:Base>
<v6:VID>20071209013112</v6:VID>
<!--Optional:-->
<v6:Ref>CTAA00000002644</v6:Ref>
</v6:Base>
</v6:AlertDeleteInqRq>
</soapenv:Body>
</soapenv:Envelope>
And i want to retrieve the values of tag
<ChannelID> and <v6:VID>
can somebody help, i have tried with extractvalue but not able to get the values
I have used the below two queries but not able to get the expected results. Both queries result into no values.
select xmltype(MED_REQ_PAYLOAD).extract('//ClientDetails/Org','xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" || xmlns="http://www.abc.com/gcgi/shared/system/header"').getStringValue() from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/alerts/v6_0_0_0/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
select EXTRACTVALUE(xmltype(MED_REQ_PAYLOAD),'/RqHeader/) from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
Well, for starters, both queries are syntactically wrong :
- non terminated string
- incorrect namespace mapping declaration
- unknown XMLType method "getStringValue()"
Secondly, all those functions are deprecated now.
Here's an up-to-date example using XMLTable. It will retrieve the two tag values you mentioned :
SQL> select x.*
2 from esb_output_temp t
3 , xmltable(
4 xmlnamespaces(
5 'http://schemas.xmlsoap.org/soap/envelope/' as "soap"
6 , 'http://www.abc.com/gcgi/shared/system/header' as "head"
7 , 'http://www.abc.com/gcgi/services/v6_0_0_0' as "v6"
8 )
9 , '/soap:Envelope'
10 passing xmlparse(document t.med_req_payload)
11 columns ChannelID varchar2(10) path 'soap:Header/head:RqHeader/head:ClientDetails/head:ChannelID'
12 , VID varchar2(30) path 'soap:Body/v6:AlertDeleteInqRq/v6:Base/v6:VID'
13 ) x
14 ;
CHANNELID VID
HBK 20071209013112
You may also want to store XML in XMLType columns for both performance and storage optimizations.
Similar Messages
-
Parse a xml file from clob column.
Dear,
i have been suffreing a problem about xml.
i have a table with two columns, one is bfile data type other is clob data type. A xml data is stored into both cloumns
as clob and bfile. My xml data format is correct.
when i took xml data from bfile column, then dbms_xmlparser.parseClob successfully parse my xml data.
Code below:
=======================================
dbms_lob.createtemporary(l_clob, cache=>FALSE);
dbms_lob.loadFromFile(dest_lob => l_clob,
src_lob => l_bfile,
amount => dbms_lob.getLength(l_bfile));
l_parser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(l_parser, l_clob); ========================================
But when i took xml data form clob clumn directly, then dbms_xmlparser.parseClob parse failed and go to exception.
Code below:
====================================================================
dbms_lob.createtemporary(l_clob, cache=>FALSE);
select xml_cfile,xml_bfile
into l_clob ,l_bfile
from xml_load_in
l_parser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(l_parser, l_clob); --failed parse
====================================================================
declare
l_bfile BFILE;
l_clob CLOB;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
begin
dbms_lob.createtemporary(l_clob, cache=>FALSE);
select xml_cfile,xml_bfile
into l_clob ,l_bfile
from xml_load_in
l_parser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(l_parser, l_clob);
l_doc := dbms_xmlparser.getDocument(l_parser);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
exception
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
End;
Example:
======--File_name := Outward.xml;
CREATE OR REPLACE DIRECTORY
MY_INWARD AS
'D:\PBM\Inward\';
CREATE TABLE XML_LOAD_IN
( XML_CFILE CLOB,
XML_BFILE BFILE
INSERT INTO XML_LOAD_IN ( XML_CFILE, XML_BFILE )
VALUES (
'<?xml version="1.0" encoding="UTF-8"?>
<BACPSInterface>
<OCE>
<EHR>
<StandardLevel>03</StandardLevel>
<TestFiledIndicator>T</TestFiledIndicator>
<ImmediateDestRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImmediateDestRoutingNumber>
<ImmediateOriginRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImmediateOriginRoutingNumber>
<FileCreationDate>20090714</FileCreationDate>
<FileCreationTime>1047</FileCreationTime>
<ResendIndicator>N</ResendIndicator>
<ECESettlementDate>20090714</ECESettlementDate>
<ECESessionTime>1047</ECESessionTime>
<ECESettlementTime>1047</ECESettlementTime>
<ECEtype>01</ECEtype>
<CountryCode>BD</CountryCode>
</EHR>
<Collection>
<CHR>
<CashLetterBusinessDate>20090714</CashLetterBusinessDate>
<CashLetterCreationDate>20090714</CashLetterCreationDate>
<CashLetterCreationTime>1047</CashLetterCreationTime>
<CashLetterRecordTypeInd>I</CashLetterRecordTypeInd>
<CashLetterDocTypeIndicator>G</CashLetterDocTypeIndicator>
<CashLetterID>1</CashLetterID>
<OriginatorContactName>Bank Asia</OriginatorContactName>
<OriginatorContactPhoneNumber>XXX</OriginatorContactPhoneNumber>
</CHR>
<ForwardBundle>
<BHR>
<CollectionTypeIndicator>I</CollectionTypeIndicator>
<DestRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</DestRoutingNumber>
<ECEInstitutionRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ECEInstitutionRoutingNumber>
<BundleBusinessDate>20090714</BundleBusinessDate>
<BundleCreationDate>20090714</BundleCreationDate>
<BundleID>1</BundleID>
<ReturnLocationRoutingNumber>070127538</ReturnLocationRoutingNumber>
</BHR>
<CDR>
<CDR num="1">
<ECESettlementDate>20090714</ECESettlementDate>
<ECESessionTime>1047</ECESessionTime>
<ECESettlementTime>1047</ECESettlementTime>
<ECEItemType>N</ECEItemType>
<IssuingBranchRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</IssuingBranchRoutingNumber>
<AccountNumber>0000334008221</AccountNumber>
<ChequeSequenceNumber>1601735</ChequeSequenceNumber>
<ItemAmount>500</ItemAmount>
<ECEInstitutionItemSequencNum>0701275380000001</ECEInstitutionItemSequencNum>
<DocumentationTypeIndicator>I</DocumentationTypeIndicator>
<ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
<MICRValidIndicator>1</MICRValidIndicator>
<BOFDIndicator>Y</BOFDIndicator>
<ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
<CorrectionIndicator>0</CorrectionIndicator>
<RepresentmentIndicator>0</RepresentmentIndicator>
<ArchiveTypeIndicator>F</ArchiveTypeIndicator>
</CDR>
<CDR num="2">
<ECESettlementDate>20090714</ECESettlementDate>
<ECESessionTime>1047</ECESessionTime>
<ECESettlementTime>1047</ECESettlementTime>
<ECEItemType>N</ECEItemType>
<IssuingBranchRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</IssuingBranchRoutingNumber>
<AccountNumber>0000345682256</AccountNumber>
<ChequeSequenceNumber>1234567</ChequeSequenceNumber>
<ItemAmount>1000</ItemAmount>
<ECEInstitutionItemSequencNum>0701275380000002</ECEInstitutionItemSequencNum>
<DocumentationTypeIndicator>I</DocumentationTypeIndicator>
<ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
<MICRValidIndicator>1</MICRValidIndicator>
<BOFDIndicator>Y</BOFDIndicator>
<ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
<CorrectionIndicator>0</CorrectionIndicator>
<RepresentmentIndicator>0</RepresentmentIndicator>
<ArchiveTypeIndicator>F</ArchiveTypeIndicator>
</CDR>
</CDR>
<CDA>
<CDA num="1">
<AddendumRecordNumber>1</AddendumRecordNumber>
<BOFDRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>75</DistrictCode>
<BranchCode>12</BranchCode>
<CheckDigit>8</CheckDigit>
</BOFDRoutingNumber>
<BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
<BOFDDepositAccountNumber>0000334008221</BOFDDepositAccountNumber>
<BOFDDepositBranch>753</BOFDDepositBranch>
<PayeeName>XXX</PayeeName>
<TruncationIndicator>Y</TruncationIndicator>
<BOFDConversionIndicator>2</BOFDConversionIndicator>
<BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
</CDA>
<CDA num="2">
<AddendumRecordNumber>1</AddendumRecordNumber>
<BOFDRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>75</DistrictCode>
<BranchCode>12</BranchCode>
<CheckDigit>8</CheckDigit>
</BOFDRoutingNumber>
<BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
<BOFDDepositAccountNumber>0000345682256</BOFDDepositAccountNumber>
<BOFDDepositBranch>753</BOFDDepositBranch>
<PayeeName>XXX</PayeeName>
<TruncationIndicator>Y</TruncationIndicator>
<BOFDConversionIndicator>2</BOFDConversionIndicator>
<BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
</CDA>
</CDA>
<CDC>
<CDC num="1">
<AddendumCRecordNumber>1</AddendumCRecordNumber>
<EndorsingBankRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</EndorsingBankRountingNumber>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankItemSequenceNum>0701275380000001</EndorsingBankItemSequenceNum>
<TruncationIndicator>Y</TruncationIndicator>
<EndorsingBankConversionInd>2</EndorsingBankConversionInd>
<EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
</CDC>
<CDC num="2">
<AddendumCRecordNumber>1</AddendumCRecordNumber>
<EndorsingBankRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</EndorsingBankRountingNumber>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankItemSequenceNum>0701275380000002</EndorsingBankItemSequenceNum>
<TruncationIndicator>Y</TruncationIndicator>
<EndorsingBankConversionInd>2</EndorsingBankConversionInd>
<EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
</CDC>
</CDC>
<IVD>
<IVD num="1">
<ImageIndicator>1</ImageIndicator>
<ImageCreatorRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImageCreatorRountingNumber>
<ImageCreatorDate>20090714</ImageCreatorDate>
<ImageViewFormatIndicator>0</ImageViewFormatIndicator>
<ImageViewCompressionAlg>0</ImageViewCompressionAlg>
<ViewSideIndicator>0</ViewSideIndicator>
<ViewDescriptor>0</ViewDescriptor>
<DigitalSignatureIndicator>1</DigitalSignatureIndicator>
<DigitalSignatureMethod>0</DigitalSignatureMethod>
<SecurityKeySize>12235</SecurityKeySize>
<ImageRecreateIndicator>0</ImageRecreateIndicator>
</IVD>
<IVD num="2">
<ImageIndicator>1</ImageIndicator>
<ImageCreatorRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImageCreatorRountingNumber>
<ImageCreatorDate>20090714</ImageCreatorDate>
<ImageViewFormatIndicator>0</ImageViewFormatIndicator>
<ImageViewCompressionAlg>0</ImageViewCompressionAlg>
<ViewSideIndicator>0</ViewSideIndicator>
<ViewDescriptor>0</ViewDescriptor>
<DigitalSignatureIndicator>1</DigitalSignatureIndicator>
<DigitalSignatureMethod>0</DigitalSignatureMethod>
<SecurityKeySize>12235</SecurityKeySize>
<ImageRecreateIndicator>0</ImageRecreateIndicator>
</IVD>
</IVD>
<IVT>
<IVT num="1">
<ECEInstitutionRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ECEInstitutionRoutingNumber>
<BundleBusinessDate>20090714</BundleBusinessDate>
<CycleNumber>0</CycleNumber>
<ECEInstitutionItemSeqNumber>0701275380000001</ECEInstitutionItemSeqNumber>
<ClippingOrigin>
<Origin>0</Origin>
<CoordinateH1>0000</CoordinateH1>
<CoordinateH2>0000</CoordinateH2>
<CoordinateV1>0000</CoordinateV1>
<CoordinateV2>0000</CoordinateV2>
</ClippingOrigin>
<LengthofImageReferenceKey>0</LengthofImageReferenceKey>
<LengthofDigitalSignature>0</LengthofDigitalSignature>
<LengthofImageData>1</LengthofImageData>
<OffsetToImageData>01001000</OffsetToImageData>
</IVT>
<IVT num="2">
<ECEInstitutionRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ECEInstitutionRoutingNumber>
<BundleBusinessDate>20090714</BundleBusinessDate>
<CycleNumber>0</CycleNumber>
<ECEInstitutionItemSeqNumber>0701275380000002</ECEInstitutionItemSeqNumber>
<ClippingOrigin>
<Origin>0</Origin>
<CoordinateH1>0000</CoordinateH1>
<CoordinateH2>0000</CoordinateH2>
<CoordinateV1>0000</CoordinateV1>
<CoordinateV2>0000</CoordinateV2>
</ClippingOrigin>
<LengthofImageReferenceKey>0</LengthofImageReferenceKey>
<LengthofDigitalSignature>0</LengthofDigitalSignature>
<LengthofImageData>1</LengthofImageData>
<OffsetToImageData>01001000</OffsetToImageData>
</IVT>
</IVT>
<IVA>
<IVA num="1">
<GlobalImageQuality>0</GlobalImageQuality>
<GlobalImageUsability>1</GlobalImageUsability>
<ImagingBankSpecificTest>1</ImagingBankSpecificTest>
</IVA>
<IVA num="2">
<GlobalImageQuality>0</GlobalImageQuality>
<GlobalImageUsability>1</GlobalImageUsability>
<ImagingBankSpecificTest>1</ImagingBankSpecificTest>
</IVA>
</IVA>
<BCR>
<ItemsWithinBundleCount>2</ItemsWithinBundleCount>
<BundleTotalAmount>1500</BundleTotalAmount>
<MICRValidTotalAmount>1500</MICRValidTotalAmount>
</BCR>
</ForwardBundle>
<CCR>
<BundleCount>1</BundleCount>
<ItemWithinCashLetterCount>2</ItemWithinCashLetterCount>
<CashLetterTotalAmount>1500</CashLetterTotalAmount>
<ImagesWithinCashLetterCount>2</ImagesWithinCashLetterCount>
<ECEInstitutionName>Bank Asia</ECEInstitutionName>
<SettlementDate>20090714</SettlementDate>
</CCR>
</Collection>
<ECR>
<CashLetterCount>1</CashLetterCount>
<TotalRecordCount>2</TotalRecordCount>
<TotalItemCount>2</TotalItemCount>
<FileTotalAmount>1500</FileTotalAmount>
<ImmediateOriginContactName>Bank Asia</ImmediateOriginContactName>
<ImmediateOriginContactNumber>XXX</ImmediateOriginContactNumber>
</ECR>
</OCE>
</BACPSInterface>'
, BFILENAME('MY_INWARD','Outward.xml'));
COMMIT;What version of Oracle (4 digits) and what is the error?
This runs without error on 10.2.0.4 (though you can go directly from a CLOB to a DOMDocument via dbms_xmldom)
-- Created on 9/14/2009 by JH20567
declare
-- Local variables here
l_clob CLOB;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
begin
-- Test statements here
l_clob := '<?xml version="1.0" encoding="UTF-8"?>
<BACPSInterface>
<OCE>
<EHR>
<StandardLevel>03</StandardLevel>
<TestFiledIndicator>T</TestFiledIndicator>
<ImmediateDestRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImmediateDestRoutingNumber>
<ImmediateOriginRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImmediateOriginRoutingNumber>
<FileCreationDate>20090714</FileCreationDate>
<FileCreationTime>1047</FileCreationTime>
<ResendIndicator>N</ResendIndicator>
<ECESettlementDate>20090714</ECESettlementDate>
<ECESessionTime>1047</ECESessionTime>
<ECESettlementTime>1047</ECESettlementTime>
<ECEtype>01</ECEtype>
<CountryCode>BD</CountryCode>
</EHR>
<Collection>
<CHR>
<CashLetterBusinessDate>20090714</CashLetterBusinessDate>
<CashLetterCreationDate>20090714</CashLetterCreationDate>
<CashLetterCreationTime>1047</CashLetterCreationTime>
<CashLetterRecordTypeInd>I</CashLetterRecordTypeInd>
<CashLetterDocTypeIndicator>G</CashLetterDocTypeIndicator>
<CashLetterID>1</CashLetterID>
<OriginatorContactName>Bank Asia</OriginatorContactName>
<OriginatorContactPhoneNumber>XXX</OriginatorContactPhoneNumber>
</CHR>
<ForwardBundle>
<BHR>
<CollectionTypeIndicator>I</CollectionTypeIndicator>
<DestRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</DestRoutingNumber>
<ECEInstitutionRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ECEInstitutionRoutingNumber>
<BundleBusinessDate>20090714</BundleBusinessDate>
<BundleCreationDate>20090714</BundleCreationDate>
<BundleID>1</BundleID>
<ReturnLocationRoutingNumber>070127538</ReturnLocationRoutingNumber>
</BHR>
<CDR>
<CDR num="1">
<ECESettlementDate>20090714</ECESettlementDate>
<ECESessionTime>1047</ECESessionTime>
<ECESettlementTime>1047</ECESettlementTime>
<ECEItemType>N</ECEItemType>
<IssuingBranchRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</IssuingBranchRoutingNumber>
<AccountNumber>0000334008221</AccountNumber>
<ChequeSequenceNumber>1601735</ChequeSequenceNumber>
<ItemAmount>500</ItemAmount>
<ECEInstitutionItemSequencNum>0701275380000001</ECEInstitutionItemSequencNum>
<DocumentationTypeIndicator>I</DocumentationTypeIndicator>
<ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
<MICRValidIndicator>1</MICRValidIndicator>
<BOFDIndicator>Y</BOFDIndicator>
<ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
<CorrectionIndicator>0</CorrectionIndicator>
<RepresentmentIndicator>0</RepresentmentIndicator>
<ArchiveTypeIndicator>F</ArchiveTypeIndicator>
</CDR>
<CDR num="2">
<ECESettlementDate>20090714</ECESettlementDate>
<ECESessionTime>1047</ECESessionTime>
<ECESettlementTime>1047</ECESettlementTime>
<ECEItemType>N</ECEItemType>
<IssuingBranchRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</IssuingBranchRoutingNumber>
<AccountNumber>0000345682256</AccountNumber>
<ChequeSequenceNumber>1234567</ChequeSequenceNumber>
<ItemAmount>1000</ItemAmount>
<ECEInstitutionItemSequencNum>0701275380000002</ECEInstitutionItemSequencNum>
<DocumentationTypeIndicator>I</DocumentationTypeIndicator>
<ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
<MICRValidIndicator>1</MICRValidIndicator>
<BOFDIndicator>Y</BOFDIndicator>
<ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
<CorrectionIndicator>0</CorrectionIndicator>
<RepresentmentIndicator>0</RepresentmentIndicator>
<ArchiveTypeIndicator>F</ArchiveTypeIndicator>
</CDR>
</CDR>
<CDA>
<CDA num="1">
<AddendumRecordNumber>1</AddendumRecordNumber>
<BOFDRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>75</DistrictCode>
<BranchCode>12</BranchCode>
<CheckDigit>8</CheckDigit>
</BOFDRoutingNumber>
<BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
<BOFDDepositAccountNumber>0000334008221</BOFDDepositAccountNumber>
<BOFDDepositBranch>753</BOFDDepositBranch>
<PayeeName>XXX</PayeeName>
<TruncationIndicator>Y</TruncationIndicator>
<BOFDConversionIndicator>2</BOFDConversionIndicator>
<BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
</CDA>
<CDA num="2">
<AddendumRecordNumber>1</AddendumRecordNumber>
<BOFDRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>75</DistrictCode>
<BranchCode>12</BranchCode>
<CheckDigit>8</CheckDigit>
</BOFDRoutingNumber>
<BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
<BOFDDepositAccountNumber>0000345682256</BOFDDepositAccountNumber>
<BOFDDepositBranch>753</BOFDDepositBranch>
<PayeeName>XXX</PayeeName>
<TruncationIndicator>Y</TruncationIndicator>
<BOFDConversionIndicator>2</BOFDConversionIndicator>
<BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
</CDA>
</CDA>
<CDC>
<CDC num="1">
<AddendumCRecordNumber>1</AddendumCRecordNumber>
<EndorsingBankRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</EndorsingBankRountingNumber>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankItemSequenceNum>0701275380000001</EndorsingBankItemSequenceNum>
<TruncationIndicator>Y</TruncationIndicator>
<EndorsingBankConversionInd>2</EndorsingBankConversionInd>
<EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
</CDC>
<CDC num="2">
<AddendumCRecordNumber>1</AddendumCRecordNumber>
<EndorsingBankRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</EndorsingBankRountingNumber>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
<EndorsingBankItemSequenceNum>0701275380000002</EndorsingBankItemSequenceNum>
<TruncationIndicator>Y</TruncationIndicator>
<EndorsingBankConversionInd>2</EndorsingBankConversionInd>
<EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
</CDC>
</CDC>
<IVD>
<IVD num="1">
<ImageIndicator>1</ImageIndicator>
<ImageCreatorRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImageCreatorRountingNumber>
<ImageCreatorDate>20090714</ImageCreatorDate>
<ImageViewFormatIndicator>0</ImageViewFormatIndicator>
<ImageViewCompressionAlg>0</ImageViewCompressionAlg>
<ViewSideIndicator>0</ViewSideIndicator>
<ViewDescriptor>0</ViewDescriptor>
<DigitalSignatureIndicator>1</DigitalSignatureIndicator>
<DigitalSignatureMethod>0</DigitalSignatureMethod>
<SecurityKeySize>12235</SecurityKeySize>
<ImageRecreateIndicator>0</ImageRecreateIndicator>
</IVD>
<IVD num="2">
<ImageIndicator>1</ImageIndicator>
<ImageCreatorRountingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ImageCreatorRountingNumber>
<ImageCreatorDate>20090714</ImageCreatorDate>
<ImageViewFormatIndicator>0</ImageViewFormatIndicator>
<ImageViewCompressionAlg>0</ImageViewCompressionAlg>
<ViewSideIndicator>0</ViewSideIndicator>
<ViewDescriptor>0</ViewDescriptor>
<DigitalSignatureIndicator>1</DigitalSignatureIndicator>
<DigitalSignatureMethod>0</DigitalSignatureMethod>
<SecurityKeySize>12235</SecurityKeySize>
<ImageRecreateIndicator>0</ImageRecreateIndicator>
</IVD>
</IVD>
<IVT>
<IVT num="1">
<ECEInstitutionRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ECEInstitutionRoutingNumber>
<BundleBusinessDate>20090714</BundleBusinessDate>
<CycleNumber>0</CycleNumber>
<ECEInstitutionItemSeqNumber>0701275380000001</ECEInstitutionItemSeqNumber>
<ClippingOrigin>
<Origin>0</Origin>
<CoordinateH1>0000</CoordinateH1>
<CoordinateH2>0000</CoordinateH2>
<CoordinateV1>0000</CoordinateV1>
<CoordinateV2>0000</CoordinateV2>
</ClippingOrigin>
<LengthofImageReferenceKey>0</LengthofImageReferenceKey>
<LengthofDigitalSignature>0</LengthofDigitalSignature>
<LengthofImageData>1</LengthofImageData>
<OffsetToImageData>01001000</OffsetToImageData>
</IVT>
<IVT num="2">
<ECEInstitutionRoutingNumber>
<BankCode>070</BankCode>
<DistrictCode>12</DistrictCode>
<BranchCode>75</BranchCode>
<CheckDigit>8</CheckDigit>
</ECEInstitutionRoutingNumber>
<BundleBusinessDate>20090714</BundleBusinessDate>
<CycleNumber>0</CycleNumber>
<ECEInstitutionItemSeqNumber>0701275380000002</ECEInstitutionItemSeqNumber>
<ClippingOrigin>
<Origin>0</Origin>
<CoordinateH1>0000</CoordinateH1>
<CoordinateH2>0000</CoordinateH2>
<CoordinateV1>0000</CoordinateV1>
<CoordinateV2>0000</CoordinateV2>
</ClippingOrigin>
<LengthofImageReferenceKey>0</LengthofImageReferenceKey>
<LengthofDigitalSignature>0</LengthofDigitalSignature>
<LengthofImageData>1</LengthofImageData>
<OffsetToImageData>01001000</OffsetToImageData>
</IVT>
</IVT>
<IVA>
<IVA num="1">
<GlobalImageQuality>0</GlobalImageQuality>
<GlobalImageUsability>1</GlobalImageUsability>
<ImagingBankSpecificTest>1</ImagingBankSpecificTest>
</IVA>
<IVA num="2">
<GlobalImageQuality>0</GlobalImageQuality>
<GlobalImageUsability>1</GlobalImageUsability>
<ImagingBankSpecificTest>1</ImagingBankSpecificTest>
</IVA>
</IVA>
<BCR>
<ItemsWithinBundleCount>2</ItemsWithinBundleCount>
<BundleTotalAmount>1500</BundleTotalAmount>
<MICRValidTotalAmount>1500</MICRValidTotalAmount>
</BCR>
</ForwardBundle>
<CCR>
<BundleCount>1</BundleCount>
<ItemWithinCashLetterCount>2</ItemWithinCashLetterCount>
<CashLetterTotalAmount>1500</CashLetterTotalAmount>
<ImagesWithinCashLetterCount>2</ImagesWithinCashLetterCount>
<ECEInstitutionName>Bank Asia</ECEInstitutionName>
<SettlementDate>20090714</SettlementDate>
</CCR>
</Collection>
<ECR>
<CashLetterCount>1</CashLetterCount>
<TotalRecordCount>2</TotalRecordCount>
<TotalItemCount>2</TotalItemCount>
<FileTotalAmount>1500</FileTotalAmount>
<ImmediateOriginContactName>Bank Asia</ImmediateOriginContactName>
<ImmediateOriginContactNumber>XXX</ImmediateOriginContactNumber>
</ECR>
</OCE>
</BACPSInterface>';
l_parser := dbms_xmlparser.newParser;
dbms_xmlparser.parseClob(l_parser, l_clob);
l_doc := dbms_xmlparser.getDocument(l_parser);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
end; -
How can I get xml data from KM?
Hi guys,
how can i get a xml data from KM?
I saved an xml document in KM, and I want to read its content. How can I get this document?
Using
DocResource = (IResource) resFactory.getResource(RID.getRID("Document/ Path"),resContext)?
I want to know which kinds of API of KM are responsible for this.
Thanks in advance
Regards,
LiyingHi Liying
use this code.
try {
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User =
WPUMFactory.getUserFactory().getEP5User(sapUser);
IResourceContext resourseContext = new ResourceContext(ep5User);
IResourceFactory resourseFactory = ResourceFactory.getInstance();
RID pathRID =
RID.getRID(
"/documents/"(Path to folder where ur file is"");
ICollection collection =
(ICollection) resourseFactory.getResource(
pathRID,
resourseContext);
IResourceList resourceList = collection.getChildren();
IResourceListIterator resourceListIterator =
resourceList.listIterator();
while (resourceListIterator.hasNext()) {
com.sapportals.wcm.repository.IResource resource =
resourceListIterator.next();
try {
/*File from KM Reading*/
InputStream in = resource.getUnfilteredContent().getInputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];
int bytesread = 0;
while ((bytesread = in.read(buffer)) != -1) {
out.write(buffer, 0, bytesread);
String dataToBeConvertedToXML = out.toString();
catch(Exception e){}
catch(Exception e){}
Award points if found usefull.
I suppose you have used KM sharing reference in ur application
Regards
BP -
Reading Xml file from clob column in the staging table
Hi,
I am trying to poll the staging table with the database adapter which has CLOB column type containing XML file. How do I extract the XML file from CLOB and map the fields to the another variable with definite schema.
Thanks,
Edited by: chaitu123 on Sep 20, 2009 8:16 AM1) when you create DBAdapter on a table which having the clob column watch closely the created xsd for the DBAdapter the clob cloumn element should be a String data type
2) create xsd for Xml File and create variable for the xsd element
3) use ora:parseEscapedXML("yourDBAdapterclobElement") to XmlFileVarilable
Krishna -
How i can transfer XML data from internet to SAP R/3?
Hi all,
I have an issue to catch data from internet (perticular website) in xml format and i want to update that xml data format into SAP R/3 database. so how i can do that?
Can I do directly or i should use any third party tools?Hi Deepak,
Refer these two weblogs,
/people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
/people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap-netweaver-xi
I hope, this will solve your problem
Regards,
Deviprasad -
Hi,
I'm very new in Oracle. I have DB running on oracle 9i. On production DB one tablespace have CLOB datatype and this CLOB field have all techinal stuff stored in XML format. How DO I fetch this info?
select info from infotbl; showing all the XML junk.
what is the batter way to fetch XML data properlyDifficult to give the exact answer without knowing which node repeats..
Howver it will be something like this
select extractValue(value(x),'/RepeatingNode/NonRepatingNode/NonRepeatingNode)
from TABLE, table(xmlsequence(extract(xmltype(clob),'/Root/Node/RepeatingNode')))) x -
How can i get xml data from html
Hi
i need to submit data from an html form to server via xml.
( ie data shold be in xml format instead of POST/GET methods )
how can i can i make this happen ?
Renjith.read the excellent suggestion from mochamaniac (reply 2 of 5): http://forum.java.sun.com/thread.jsp?forum=34&thread=303120
ps. next time run a search on the forum prior from posting ;-) -
Hi Guys,
I wonder if you can help me out , I m trying to insert a XML stored in a CLOB column as an XMLTYPE.. the example at eh end works but when i add in the sSELCT statement I get eh following error...
INSERT INTO tmp_xml_table VALUES
(11, 'select data from tmp_requests where id = 159');
SQL Error: ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of 's'
Error at line 1
31011. 00000 - "XML parsing failed"
*Cause: XML parser returned an error while trying to parse the document.
*Action: Check if the document to be parsed is valid.
DESC tmp_xml_table
Name Null Type
ID NUMBER
DATA XMLTYPE()
this bit works....
INSERT INTO myTable VALUES (1, SYS.XMLType.CreateXML(
'<?xml version="1.0"?>
<fall>
<name>myTable</name>
<county>USA</county>
<state>MI</state>
<url>
http://your.com
</url>
</fall>'));You are trying to insert the literal string 'select data from tmp_requests where id = 159', which is not valid XML.
Try:
insert into tmp_xml_table
select 11, data from tmp_requests where id=159; -
Load XML-data from large file into plain table
We have to load data from an XML file to a relational table row by row.
The structure of the data is very simple:
<ROOT>
<repReport>
<KNZ>XY</KNZ>
<LA>test123</LA>
<Ident>AA20</Ident>
</repReport>
<repReport>
</repReport>
</ROOT>.
The table econtains the fields KNZ, LA, Ident, ...
If the file is small the following PL/SQL-code works fine:
CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
fil BFILE ;
len INTEGER;
insrow INTEGER;
ctxHdl NUMBER;
buffer_c CLOB ;
amt NUMBER := dbms_lob.lobmaxsize;
src_offset NUMBER := 1 ;
dst_offset NUMBER := 1 ;
lang_ctx NUMBER := dbms_lob.default_lang_ctx;
warning NUMBER;
errNo NUMBER;
errMsg VARCHAR2(1999);
BEGIN
fil := BFILENAME('XML_DIR','200412MKBReport.xml');
DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
len := DBMS_LOB.GETLENGTH(fil);
INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
RETURNING init INTO buffer_c;
dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
dbms_xmlsave.SetBatchSize(ctxHdl , 1);
insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLCODE);
errMsg := SQLERRM;
DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
END;
But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
Does anybody have an example how to load this data that is as simple as our problem?We have to load data from an XML file to a relational table row by row.
The structure of the data is very simple:
<ROOT>
<repReport>
<KNZ>XY</KNZ>
<LA>test123</LA>
<Ident>AA20</Ident>
</repReport>
<repReport>
</repReport>
</ROOT>.
The table econtains the fields KNZ, LA, Ident, ...
If the file is small the following PL/SQL-code works fine:
CREATE OR REPLACE PROCEDURE Loadxml_Epd AS
fil BFILE ;
len INTEGER;
insrow INTEGER;
ctxHdl NUMBER;
buffer_c CLOB ;
amt NUMBER := dbms_lob.lobmaxsize;
src_offset NUMBER := 1 ;
dst_offset NUMBER := 1 ;
lang_ctx NUMBER := dbms_lob.default_lang_ctx;
warning NUMBER;
errNo NUMBER;
errMsg VARCHAR2(1999);
BEGIN
fil := BFILENAME('XML_DIR','200412MKBReport.xml');
DBMS_LOB.OPEN(fil, DBMS_LOB.LOB_READONLY);
len := DBMS_LOB.GETLENGTH(fil);
INSERT INTO INIT_CLOB(init) VALUES( EMPTY_CLOB())
RETURNING init INTO buffer_c;
dbms_lob.loadfromfile(buffer_c,fil, amt, dst_offset, src_offset);
ctxHdl := dbms_xmlsave.newContext ('SST_XML_EPD');
dbms_xmlsave.setRowTag (ctxHdl , 'repReport');
dbms_xmlsave.SetIgnoreCase(ctxHdl , 1);
dbms_xmlsave.SetSqlToXmlnameEscaping (ctxHdl , TRUE);
dbms_xmlsave.propagateOriginalException(ctxHdl , TRUE);
dbms_xmlsave.SetCommitBatch(ctxHdl , 1);
dbms_xmlsave.SetBatchSize(ctxHdl , 1);
insrow := DBMS_XMLSAVE.insertXML(ctxHdl,buffer_c);
DBMS_OUTPUT.PUT_LINE('Anzahl Sätze:' || TO_CHAR(insrow,'999999999'));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLCODE);
errMsg := SQLERRM;
DBMS_OUTPUT.PUT_LINE(SUBSTR(errMsg,1,2000));
IF DBMS_LOB.ISOPEN(fil) = 1 THEN
DBMS_LOB.CLOSE(fil);
END IF;
END;
But if the file is larger (50 MB in our case) this does not work. In various documents we found that we have to use another sort of XML-parser but we did not find any example how this is really done.
Does anybody have an example how to load this data that is as simple as our problem? -
Error reading data from CLOB column into VARCHAR2 variable
Hi all,
Am hitting an issue retrieving data > 8K (minus 1) stored in a CLOB column into a VARCHAR2 variable in PL/SQL...
The "problem to be solved" here is storing DDL, in this case a "CREATE VIEW" statement, that is longer than 8K for later retrieval (and execution) using dynamic SQL. Given that the EXECUTE IMMEDIATE statement can take a VARCHAR2 variable (up to 32K(-1)), this should suffice for our needs, however, it seems that somewhere in the process of converting this VARCHAR2 text to a CLOB for storage, and then retrieving the CLOB and attempting to put it back into a VARCHAR2 variable, it is throwing a standard ORA-06502 exception ("PL/SQL: numeric or value error"). Consider the following code:
set serveroutput on
drop table test1;
create table test1(col1 CLOB);
declare
cursor c1 is select col1 from test1;
myvar VARCHAR2(32000);
begin
myvar := '';
for i in 1..8192 loop
myvar := myvar || 'a';
end loop;
INSERT INTO test1 (col1) VALUES (myvar);
for arec in c1 loop
begin
myvar := arec.col1;
dbms_output.put_line('Read data of length ' || length(myvar));
exception when others then
dbms_output.put_line('Error reading data: ' || sqlerrm);
end;
end loop;
end;
If you change the loop upper bound to 8191, all works fine. I'm guessing this might have something to do with the database character set -- we've recently converted our databases over to UTF-8, for Internationalizion support, and that seems to have changed underlying assumptions regarding character processing...?
As far as the dynamic SQL issue goes, we can probably use the DBMS_SQL interface instead, with it's EXECUTE procedure that takes a PL/SQL array of varchar2(32K) - the only issue there is reading the data from the CLOB column, and then breaking that data into an array but that doesn't seem insurmountable. But this same basic issue (when a 9K text block, let's say, turns into a >32K block after being CLOBberred) seems to comes up in other text-processing situations also, so any ideas for how to resolve would be much appreciated.
Thanks for any tips/hints/ideas...
JimFor those curious about this, here's the word from Oracle support (courtesy of Metalinks):
RESEARCH
========
Test the issue for different DB version and different characterset.
--Testing the following PL/SQL blocks by using direct assignment method(myvar := arec.col1;) on
different database version and different characterset.
SQL>create table test1(col1 CLOB);
--Inserting four CLOB data into test1.
declare
myvar VARCHAR2(32767);
begin
myvar := RPAD('a',4000);
INSERT INTO test1 (col1) VALUES (myvar);
myvar := RPAD('a',8191);
INSERT INTO test1 (col1) VALUES (myvar);
myvar := RPAD('b',8192);
INSERT INTO test1 (col1) VALUES (myvar);
myvar := RPAD('c',32767);
INSERT INTO test1 (col1) VALUES (myvar);
commit;
end;
--Testing the direct assignment method.
declare
cursor c1 is select col1, length(col1) len1 from test1;
myvar VARCHAR2(32767);
begin
for arec in c1 loop
myvar := arec.col1;
--DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar);
dbms_output.put_line('Read data of length: ' || length(myvar));
end loop;
end;
The following are the summary of the test results:
===================================
1. If the database characterset is WE8ISO8859P1, then the above direct assignment
method(myvar := arec.col1;) works for database version 9i/10g/11g without any
errors.
2. If the database characterset is UTF8 or AL32UTF8, then the above direct assignment method(myvar := arec.col1;) will generate the "ORA-06502:
PL/SQL: numeric or value error" when the length of the CLOB data is greater
than 8191(=8K-1). The same error can be reproduced across all database versions
9i/10g/11g.
3. Using DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar) method to read CLOB data into a VARCHAR2 variable works for both WE8ISO8859P1 and UTF8
characterset and for all database versions.
So - it seems as I'd surmised, UTF8 changes the way VARCHAR2 and CLOB data is handled. Not too surprising, I suppose - may you all be lucky enough to be able to stay away from this sort of issue. But - the DBMS_LOB.READ workaround is certainly sufficient for the text processing situations we find ourselves in currently.
Cheers,
Jim C. -
How to read a XML file from BLOB column and insert in a table - PL/SQL Only
Hi,
To make data load more simple to end user instead placing file on the server and use SQL-LOADER, I came up with new idea that using oracle ebusiness suite attachment functionality. that loads a XML file from local PC to a database column(table is fnd_attachments, default data type is BLOB over here).
I tried with DBMS_LOB and didnt get around.
Please can anyone tell me how to read the BLOB column using PL/SQL and store the data in a oracle table. Here's the sample XML file and table structure FYI.
<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Corporate_alloc.xsd" generated="2009-07-07T14:17:49">
<Corporate_alloc>
<PKG_CODE>BKCORP</PKG_CODE>
<PKG_NAME>Corporate Edition - Books</PKG_NAME>
<DET_CODE>B9780080543758</DET_CODE>
<DET_NAME>Waves, Tides and Shallow-Water Processes</DET_NAME>
<ALLOCATION_RATIO>0.000041</ALLOCATION_RATIO>
</Corporate_alloc>
<Corporate_alloc>
<PKG_CODE>BKCORP</PKG_CODE>
<PKG_NAME>Corporate Edition - Books</PKG_NAME>
<DET_CODE>B9780080534343</DET_CODE>
<DET_NAME>Hydrostatically Loaded Structures</DET_NAME>
<ALLOCATION_RATIO>0.000127</ALLOCATION_RATIO>
</Corporate_alloc>
</dataroot>
CREATE TABLE TEST_XML
( PKG_CODE VARCHAR2(50),
PKG_NAME VARCHAR2(100),
DET_CODE VARCHAR2(20),
DET_NAME VARCHAR2(500),
ALLOCATION_RATIO NUMBER )
Thanks
EBVIn regards to #3, use the COLUMNS functionality of XMLTable instead of using Extract. Two simple examples are
Re: XML Data - Caliculate fields
Re: Extractvalue function not recognised -
How can I take data from specific column in a table using VBA
Hi
I do not know how to take the values from the last column in a table, I know how to look over each row but I cannot take the last column values for each row I pass by.
This is the table for example:
| Date | Account1 | Account2 | Description | Amount |
|12/03/2008 | 123-32 | 325-78 | None | $50 |
|12/03/2008 | 123-32 | 325-78 | None | $20 |
|12/03/2008 | 123-32 | 325-78 | None | $10 |
|12/03/2008 | 123-32 | 325-78 | None | $40 |
I am using this code as a reference that User FiveNines gave me to loop through all the rows in the table, so What I need is to take the values of the column Amount for each row I go through.
Private Sub RSWVBAPage_afterPlay()
Dim tbl As HTMLTable
Dim tblRow As HTMLTableRow
Dim tblCell As HTMLTableCell
Dim strValue As String
Dim rButton As HTMLInputElement
' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
' Strip out the ; for inner text comparison
strValue = Replace(strValue, ";", "")
' This will get the table but can be modifoed to be more specific
Set tbl = RSWApp.om.FindElement(, "TABLE")
' This loops through all the rows in the table until a match to the strValue is found
For Each tblRow In tbl.rows
If tblRow.innerText = strValue Then
RSWApp.WriteToLog "Tables", "Passed", "Row is Present", True
End If
Next
End SubHi Lippix.
This is code that will loop the rows then loop the cells and check for "$" which will return dollar values. I also attached a script.
Private Sub RSWVBAPage_afterPlay()
Dim tbl As HTMLTable
Dim tblRow As HTMLTableRow
Dim tblCell As HTMLTableCell
Dim strValue As String
' This will get the table but can be modifoed to be more specific
Set tbl = RSWApp.om.FindElement(, "TABLE")
' This loops through all the rows in the table until a match to the strValue is found
For Each tblRow In tbl.rows
For Each tblCell In tblRow.cells
' cycle through the cells and only report those with a dollar value by searching for $
If InStr(1, tblCell.innerText, "$") <> 0 Then
RSWApp.WriteToLog tblCell.innerText
End If
Next
Next
End Sub -
Show the rtf formated data from CLOB Column
Hi all,
is it possible to show the rtf formatted text stored in a clob column on the report generated with bi publisher?
A step-by-step guidance wuold be nice.
I have created with bi publisher a report, generated a data source and sql query.
But in ms word it will not be shown as formatted. All rtf tags will be shown too.
Regards,Hi Leonid,
A) =======
I'd be keen if someone like Tim would pick up on this and advise the full list of supported fo:instream-foreign-object content-type's that BI Publisher supports, would be nice if there was application/pdf and as you require application/rtf or similar. That way you'd just base64 encode your file in your XML output as per images like jpg/gif/png and include it in your template.
Desirable syntax would then be like:
<fo:instream-foreign-object content-type="application/rtf" >
<xsl:value-of select="MY_BASE64_RTF_ELEMENT"/>
</fo:instream-foreign-object>However thats wishful thinking as I can only see documented support for images specifically in jpg / gif / png formats.
B) =======
As a workaround if you have the ability to update your RTFs files (clobs) then you can just use the standard subtemplate functionality.
In that case the approach would be:
1. Update the RTFs (stored as clobs) to surround with template syntax:
<?template:DefSubTemp?>
... your RTF doc here ...
<?end template?>2. Take your clob and setup/upload as template (subtemplate=yes) manual or backend automate.
3. Add the subtemplate to your main template (assuming you register under Application Object Library, code XXV8_SUBTEMP, language English and territory United States):
<?import:xdo://FND.XXV8_SUBTEMP.EN.US?>
<?call-template:DefSubTemp?>C) =======
If you don't have the ability to update your RTF CLOBs and neither of the other solutions are suitable, then one of thing I thought of is on the fly conversion of the RTFs to, say, PNG and then use the image functionality to embed the image in the output. But again this may not be suitable as it will be an image not the "textual" output.
D) =======
All else failing you could look into the XML Publisher APIs to see if those could help.
Hopefully something for you to think about here and get more info on.
Regards,
Gareth
Blog: http://garethroberts.blogspot.com/ -
Reading xml data from url and insert into table
CREATE TABLE url_tab2
URL_NAME VARCHAR2(100),
URL SYS.URIType
INSERT INTO url_tab2 VALUES
(’This is a test URL’,
sys.UriFactory.getUri(’http://www.domain.com/test.xml’)
it is giving error as invalid characterCheck if your single quotes are the correct single quotes.
The principle works as advertised in the XMLDB Developers Guide...
C:\>sqlplus / as sysdba
SQL*Plus: Release 11.1.0.7.0 - Production on Tue Nov 25 21:44:46 2008
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create user OTN identified by OTN account unlock;
User created.
SQL> grant dba, xdbadmin to OTN;
Grant succeeded.
SQL> conn OTN/OTN
Connected.
SQL> CREATE TABLE uri_tab (docUrl SYS.URIType, docName VARCHAR2(200));
Table created.
SQL> -- Method SYS.URIFACTORY.getURI() with absolute URIs
SQL> -- Insert an HTTPUri with absolute URL into SYS.URIType using URIFACTORY.
SQL> -- The target is Oracle home page.
SQL> INSERT INTO uri_tab VALUES
2 (SYS.URIFACTORY.getURI('http://www.oracle.com'), 'AbsURL');
1 row created.
SQL> -- Insert an HTTPUri with relative URL using constructor SYS.HTTPURIType.
SQL> -- Note the absence of prefix http://. The target is the same.
SQL> INSERT INTO uri_tab VALUES (SYS.HTTPURIType('www.oracle.com'), 'RelURL');
1 row created.
SQL> -- Insert a DBUri that targets employee data from database table hr.employees.
SQL>
SQL> INSERT INTO uri_tab VALUES
2 (SYS.URIFACTORY.getURI('/oradb/HR/EMPLOYEES/ROW[EMPLOYEE_ID=200]'), 'Emp200');
1 row created.
SQL> SELECT e.docUrl.getCLOB(), docName FROM uri_tab e;
E.DOCURL.GETCLOB()
DOCNAME
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
">
<html>
<head>
AbsURL
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
">
<html>
E.DOCURL.GETCLOB()
DOCNAME
<head>
RelURL
<?xml version="1.0"?>
<ROW>
<EMPLOYEE_ID>200</EMPLOYEE_ID>
<FIRST_NAME>Jenn
Emp200
SQL> set long 1000
SQL> select HTTPURITYPE('www.oracle.com').getCLob() from dual;
HTTPURITYPE('WWW.ORACLE.COM').GETCLOB()
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN
">
<html>
<head>
<title>Oracle 11g, Siebel, PeopleSoft |
Oracle, The World's Largest Enterprise S
oftware Company</title>
<meta name="title" content="Enterprise Applications | D
atabase | Fusion Middleware | Applicatio
ns Unlimited | Business | Oracle, The Wo
rld's Largest Enterprise Software CompanEdited by: Marco Gralike on Nov 25, 2008 10:13 PM -
We have some XML data loaded into CLOB columns, for reasons too long to explain here we are not using the XMLTYPE, but we do need to extract rows based on conditions of the XML data. For performance reasons we do not want to index the CLOB column. I am looking at ways of inspecting the XML and returning matching results by casting the CLOB out as XMLTYPE and opening up xpath/xquery functions - but need this to be efficient. I have initially used extract().getXXXXVal in the where clause of a select statement, ie. where x.xmltype(clob_col).extract('<xpath>').getNumberVal = nn, but have found this very inefficient with memory usage increasing consistently and CPU hitting 100%. can anyone suggest some alternative methods?
Hi
In expression operator ignore "PLS-00201: identifier 'EXTRACTVALUE' must be declared" .
In Mapping Level Configure Default Operating Mode : Setbased and
Generation Mode : Setbased
and deploy and execute your mapping.
Maybe you are looking for
-
Spawn a new PDF using Java Script within LC Designer
I am trying to spawn a new PDF file to be created from an existing PDF using Java Script within the LC designer I have this example but I can't get it to work function createPdf() pdf = pdf$(); pdf.addText('Hello World'); pdf.writeToFile(
-
Do not display NULL tables/values(Urgent)
Hi, My template consists of a parent BC and child BC fields(BIP integrated with Siebel) . I have inserted the child table inside the parent table. When there are no values in the child record i do not want the parent record to get displayed. I tried
-
Itunes Store will not load again.
Here we go again. Upgraded to iTunes 10.5, now iTunes Store will not load again in iTUnes. Tried the prior answer in Aug. 17, but does not work this time. Uninstalled iTunes and Apple App. Servce and Quicktime. Reinstalled iTunes from new download. S
-
Crashes InDesign on saving document
Hello All, I am facing a unique problem for all my plugins under CS5, which are create from Scratch or which are ported. If I try to save my document after i create a new frame on the document or move or resize the existing frame on the document it c
-
Help This is doing my head in. I have created a named query, its simple, it gets an employee from the database with the matching employeeid... the parameter is "id". Once I created the named query I dragged the Employee class to the Data Control Pale