Want to retrieve multiple XML fragments in CLOBs in a *single query*
Hi,
I am trying to retrieve some well formed XML fragments stored as CLOBs from an 8i DB. For a single fragment at a time this is not a problem using <xsql:include-xml>. However, I am trying to retrieve multiple well formed fragments in a single query, "stacked" like so...
<xsql:include-xml>
<![CDATA[
select theXMLFrag from tclob1 where id = 'open'
union all
select theXMLFrag from tclob2 --returns multiple rows
union all
select theXMLFrag from tclob3 --some more rows
union all
select theXMLFrag from tclob1 where id = 'close'
]]>
</xsql:include-xml>
What I am really after are the contents from the middle two selects. (The 'open' and 'close' bit was just a cheap attempt to ensure that the included XML is well formed.) Though it is not shown in my example, the problem is that the number and source of the CLOB fragments is not known until run time, and I wanted to use a dynamic query to assemble the needed CLOBS...
I have since learned that <xsql:include-xml> returns the first column of the first row of the query result as parsed XML, either from a CLOB or a VARCHAR containing well-formed XML. So my attempt is no good... all but the first row are ignored.
Does anyone have any suggestions for a way to do this using the existing xsql tag library? Or will I need to create my own <xsql:action>?
Thanks,
Bob Nugent
Hi,
Let me correct if i am right:
- Central Contract -> new concept of SRM 7.0. 1 contract which is visible and usable from ECC and SRM as well. (not available in SRM 5.0 - agree)
- GOA -> it exist in SRM 5.0 for sure! (we are currenlty using it for ECC procurement).
The solution what you are mentioned is good...but as you said only for SRM 70...we are in SRM 5.0 and we need solution for here. Do you have any idea?
Currently i am thinking about a new solution based on "standard" functionalities: if a GOA need to be created for mulitple company, it has to be populated in Header distribution (all company will have the same contract header). It item detail all the required information need to be poupulate in SRM (i.e.: item 1 for p.org1/comp.cod1; item 2 for p.org2/comp.cod2).
When this is done, the BADI need to check the informatoin in SRM GOA and create contract according to that -> in this case 1GOA is created, but the 2 items for totally different p.org/comp.code, the BADI needs to create 2 different contract in ECC (i would like to avoid using reference purchasing organization in ECC!
Thanks in advance!
Best Regards,
Attila
Similar Messages
-
How to retrive multiple measures of a dimension in a single query
I am working on Hyperion Essbase.My front end is Alphabox.I need to retrive multiple members of a same dimension at one one query.Suppose i have product as 5 products, and locations as 5 locations, if i need to pull the data for products P1,P2,P4 and locations L2,L4,L5 how i need to give the query.Is Rowrepeat to be used?But in some cases it is not working properly.Please help me on this regard.
<ROW Product<ALLSIBLINGS P1 !This will give you siblings of P1,P2,P3...etc.
-
How to configure for Multiple XML
Hi,
We were successful in working with single xml as a input. Now we are using multiple xml as a input for a single transaction. With the references and the suggestion in documents(working with xml files.pdf) related to Documaker we have changed configuration settings in FSISYS.INI and AFGJOB.JDT.
Down below we have mentioned those changes.
Input Extract file has been changed as F_Sch.DAT; following is the content in the extract file
COM_LOB_1111 .\INPUT\F_SCH1.xml
COM_LOB_1111 .\INPUT\F_SCH2.xml
COM_LOB_1111 .\INPUT\F_SCH3.xml
F_SCH1.xml,F_SCH2.xml,F_SCH3.xml
<?xml version="1.0"?>
<global>
<lm>
<COM>COM</COM>
<LOB>LOB</LOB>
<TRANSACTIONID>121212</TRANSACTIONID>
</lm>
<Foodcard>
<Accname>Alex</Accname>
<Email>[email protected]</Email>
<Accid>1234123412341234</Accid>
<Accno>1234123412341234</Accno>
<Accaddr1>address1</Accaddr1>
<Accaddr2>address2</Accaddr2>
<Accaddr3>address3</Accaddr3>
</Foodcard>
</global>
Changes to FSISYS.INI
< ExtractKeyField >
Key = 1,3
SearchMask = 1,COM_LOB_1111
< TRN_FIELDS >
COM = 1,3,N
LOB = 5,3,N
PolicyNum = 9,3,N
< DATA >
ExtrFile = C:\FAP\DLL\Computer\INPUT\F_Sch.DAT
AFGJOB.JDT
;ImportXMLFile;2;SCH=1,COM_LOB_1111 15,19
Inspite of those changes that made, we were not able to generate the output using three xml as a input.
***error details.***
[04:16:29PM] Warning: Company - LOB - Transaction
[04:16:29PM] Warning: DM17115: : The DownLoadFAP option is set to Yes, this option should be set to No for optimal performance. Check the RunMode control group, DownLoadFAP option.
[04:16:29PM] Error: Company - LOB - Transaction
[04:16:29PM] Error: DM12041: : FAP library error: Transaction:<>, area:<DXMLoadXMLRecs>
code1:<48>, code2:<0>
msg:<XML Parse Error: The 1 chars before error=<C>, the 20 chars starting at error=< >>.
[04:16:29PM] Error: Company - LOB - Transaction
[04:16:29PM] Error: DM12041: : FAP library error: Transaction:<>, area:<DXMLoadXMLRecs>
code1:<48>, code2:<0>
msg:<syntax error at line 1 column 0>.
[04:16:29PM] Error: Company - LOB - Transaction
[04:16:29PM] Error: DM10292: in <RULXMLExtract()>: Unable to <DXMLoadXMLRecs()>.
[04:16:29PM] Warning: Company - LOB - Transaction
[04:16:29PM] Warning: DM13023: in RCBSendToErrBatch(): Unable to assign the transaction to the error batch. The SentToManualBatch field is not defined in the TrnDfdFile.
[04:16:29PM] Error: Company - LOB - Transaction
[04:16:29PM] Error: DM10947: in NoGenTrnTransactionProc(): Unable to RULLoadXtrRecs(pRPS).
[04:16:51PM] Error: Company - LOB - Transaction
[04:16:51PM] Error: DM12018: in RPDoBaseFormsetRulesForward(): Unable to <WINNOGENTRNTRANSACTIONPROC>().
[04:16:51PM] Error: Company - LOB - Transaction
[04:16:51PM] Error: DM12066: in RPProcessOneTransaction(): Unable to RPDoBaseFormsetRulesForward(pRPS, RP_PRE_PROC_A).
[04:16:51PM] Error: Company - LOB - Transaction
[04:16:51PM] Error: DM12064: in RPProcessTransactions(): Unable to RPProcessOneTransaction(pRPS). Skipping the rest of the transactions for this Base. See INI group:< GenDataStopOn > option:TransactionErrors.
[04:16:51PM] Error: Company - LOB - Transaction
[04:16:51PM] Error: DM12004: in RPProcessOneBase(): Unable to RPProcessTransactions(pRPS).
[04:16:51PM] Error: Company - LOB - Transaction
[04:16:51PM] Error: DM12001: in RPProcessBases(): Unable to RPProcessOneBase(pRPS). Skipping the rest of the Bases for this batch run. See INI group:< GenDataStopOn > option:BaseErrors.
[04:16:51PM] Error: Company - LOB - Transaction
[04:16:51PM] Error: DM12127: in RPRun(): Unable to RPProcessBases(pRPS).
[04:16:51PM] Error: An error occurred during processing.
Kindly let us know in case of any solution for this issue.
Regards,
Balaji R.It looks like it is unable to load your XML files. Depending on how your configuration is laid out, you may want to list full path names in your extract file - we make use of the same technique in 11.5, which I would imagine isn't terribly different in this respect from 12.0. Our configuration is such that we run Gendata at one level, read an extract file in the deflib folder, and the input files are in an input folder, so each entry in the extract file is C:\fap\mstrres\sampco\input\input1.xml.
Not sure if that is analogous to your setup or not, but based on the errors, either it can't find the file, so it is a pathing issue, or the file contents are invalid.
Tony -
Multiple XML import into one PDF
I want to import multiple xml files into my form at one time resulting in one pdf with each page repeating with each set of data. Is there a way to do this?.
Hi,
You can use loadXML method to load necessary XMLs, after that you have parse it, take data, and set it to correspondent fields.
You can check this links, maybe it will be helpfull:
http://forums.adobe.com/thread/333519
http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/common/html/wwhelp .htm?context=Adobe_LiveCycle_Designer_Help&file=001719.html
BR,
Paul Butenko -
Hi
I want to create multiple XML datasets on one page. For
example: 2 queries (php,mysql), 2 results. Then on the page where
you define the datasets you normally add this:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php",
"company/employee");
//-->
</script>
Now, this works perfectly, but how can i add multiple
datasets, for example:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php",
"company/employee");
var dsEmployees2 = new Spry.Data.XMLDataSet("export.php",
"company2/employee2");
//-->
Once i add the second dataset, only the first one displays.
Anybody have any ideas?
Thanks
</script>Ok, here is the code that gets the data and exports it to
XML:
Query 1:
=============================
mysql_select_db($database_conn_export, $conn_export);
$query_rsEmployees = "SELECT * FROM employees_emp";
$rsEmployees = mysql_query($query_rsEmployees, $conn_export)
or die(mysql_error());
$row_rsEmployees = mysql_fetch_assoc($rsEmployees);
$totalRows_rsEmployees = mysql_num_rows($rsEmployees);
// Begin XMLExport rsEmployees
$xmlExportObj = new XMLExport();
$xmlExportObj->setRecordset($rsEmployees);
$xmlExportObj->addColumn("firstname_emp", "firstname");
$xmlExportObj->addColumn("lastname_emp", "lastname");
$xmlExportObj->addColumn("address_emp", "address");
$xmlExportObj->addColumn("salary_emp", "salary");
$xmlExportObj->setMaxRecords("ALL");
$xmlExportObj->setDBEncoding("ISO-8859-1");
$xmlExportObj->setXMLEncoding("ISO-8859-1");
$xmlExportObj->setXMLFormat("NODES");
$xmlExportObj->setRootNode("company");
$xmlExportObj->setRowNode("employee");
$xmlExportObj->Execute();
// End XMLExport rsEmployees
=============================
Query 2:
=============================
=============================
mysql_select_db($database_data_one, $data_one);
$query_mem_details = "SELECT * FROM wherever where
mem='$mem_number'";
$mem_details = mysql_query($query_mem_details, $data_one) or
die(mysql_error());
$row_mem_details = mysql_fetch_assoc($mem_details);
$totalRows_mem_details = mysql_num_rows($mem_details);
// Begin XMLExport Member Details
$xmlExportObj = new XMLExport();
$xmlExportObj->setRecordset($mem_details);
$xmlExportObj->addColumn("firstname", "firstname");
$xmlExportObj->addColumn("lastname", "lastname");
$xmlExportObj->setMaxRecords("ALL");
$xmlExportObj->setDBEncoding("ISO-8859-1");
$xmlExportObj->setXMLEncoding("ISO-8859-1");
$xmlExportObj->setXMLFormat("NODES");
$xmlExportObj->setRootNode("Member");
$xmlExportObj->setRowNode("Details");
$xmlExportObj->Execute();
// End XMLExport Member Details
=============================
And here is the page that calls these two datasets:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php",
"company/employee");
var mem_details = new Spry.Data.XMLDataSet("export.php",
"Member/Details");
//-->
And only the first one appears.
</script> -
Hi,
i want to assign an xml fragment to a variable, i could do it succesfully...ex: <value xsd:string></value>. Now i want to assign the input variable from receive activity into this xml fragment. How do i do this...
There is a thread regarding this How to include variable inside XML Fragment in assign ? but i did not understand the solution
Edited by: user10545499 on May 17, 2009 11:45 PMok, i got what you were saying about CDATA, but i think my problem is the opposite..i WANT my string to be parsed..
when i assign <tag> put @filename@ </tag> i need that variable to be replaced..and right now, it is taken all as a simple string... -
Integrate Multiple Captivate HTML5 Application Simulations inside a single course package
Hi,
We are using Captivate-8. We wants to integrate Multiple Captivate HTML5 Application Simulations inside a single course package. There is an option to create ‘Aggregator Project’ to do so if you have Flash (swf) output. As we are generating HTML5 output is there any way to so?
We also want a menu where we can see list of all such imported files. Along with that we also wants to use simple content screens in between the simulations.
Please share if you know how to achieve this.
ThanksHi Lilybiri,
Our requiremetn is - We wants to develope a single package with at least few show-me simulations, try-me simulations and content screens. There should be some GUI which has menu to list all these pages and the pages should get loaded inside the GUI. There should be some navigation like Next/Back buttons to navigate from one page to other page.
Like this we will have multiple packages. So we can not split each package into multiple SCO.
Please help if there is alternate way to acheive this.
Thanks. -
Retrieve XML Data in clob type
I have a table created as below
create table tab123( x clob);
Inserted a row as below
insert into t values ('"<ProcessBatchRequest xmlns:inp1="http://services.abc.com/" ServiceVersionNumber="" xmlns="http://services.abc.com/GlobalBatchServiceV1.0">
<inp1:BatchDetail>
<inp1:ApplicationID>test.123</inp1:ApplicationID>
<inp1:ApplicationBatchID>test.123</inp1:ApplicationBatchID>
<inp1:MessageTimeStamp>2012-11-28T11:05:32.000-05:00</inp1:MessageTimeStamp>
</inp1:BatchDetail>
<inp1:CustomerIdentityDetail>
<inp1:SubscriberNumber>123</inp1:SubscriberNumber>
<inp1:UserUniqueID>1542</inp1:UserUniqueID>
<inp1:SubscriberCountryISOAlpha2Code>AD</inp1:SubscriberCountryISOAlpha2Code>
<inp1:ApplicationCustomerID>1210</inp1:ApplicationCustomerID>
<inp1:ApplicationCustomerName>ABC</inp1:ApplicationCustomerName>
<inp1:ApplicationUserID>ABC</inp1:ApplicationUserID>
</inp1:CustomerIdentityDetail>
<inp1:BatchSpecification>
<inp1:BatchProcessID>Clean</inp1:BatchProcessID>
<inp1:BatchPriorityValue>10</inp1:BatchPriorityValue>
<inp1:LanguagePreferenceCode>39</inp1:LanguagePreferenceCode>
<inp1:CharacterSetPreferenceCode>23423</inp1:CharacterSetPreferenceCode>
<inp1:MatchSpecification>
<inp1:ConfidenceLowerLevelThresholdValue>8</inp1:ConfidenceLowerLevelThresholdValue>
<inp1:ConfidenceFallbackLowerLevelThresholdValue>4</inp1:ConfidenceFallbackLowerLevelThresholdValue>
<inp1:ReturnAllFallbackMatchCandidatesIndicator>false</inp1:ReturnAllFallbackMatchCandidatesIndicator>
<inp1:ExclusionCriteria>
<inp1:ExclusionDataDescription>Small</inp1:ExclusionDataDescription>
</inp1:ExclusionCriteria>
<inp1:ReturnCleansedInformationIndicator>false</inp1:ReturnCleansedInformationIndicator>
<inp1:MatchOnSeniorPrincipalNameIndicator>0</inp1:MatchOnSeniorPrincipalNameIndicator>
</inp1:MatchSpecification>
<inp1:CleanseSpecification>
<inp1:ParseOnlyIndicator>0</inp1:ParseOnlyIndicator>
<inp1:ProcessAsDiscreteDataIndicator>1</inp1:ProcessAsDiscreteDataIndicator>
<inp1:ReturnDatainMixedCaseIndicator>0</inp1:ReturnDatainMixedCaseIndicator>
<inp1:DoNotReturnChangeOfAddressIndicator>1</inp1:DoNotReturnChangeOfAddressIndicator>
<inp1:DoNotEnableDeliveryPointValidationIndicator>1</inp1:DoNotEnableDeliveryPointValidationIndicator>
<inp1:DoNotReturnEnhancedLineofTravelIndicator>1</inp1:DoNotReturnEnhancedLineofTravelIndicator>
<inp1:DoNotConvertRuralRouteToStreetAddressIndicator>1</inp1:DoNotConvertRuralRouteToStreetAddressIndicator>
<inp1:DoNotReturnSuiteAddressDetailIndicator>1</inp1:DoNotReturnSuiteAddressDetailIndicator>
</inp1:CleanseSpecification>
</inp1:BatchSpecification>
<inp1:InputDetail>
<inp1:InputFileDetail>
<inp1:FileURI>/mnt/auto/</inp1:FileURI>
<inp1:FileLayoutName>Clean</inp1:FileLayoutName>
<inp1:LanguageCode>36</inp1:LanguageCode>
<inp1:CompressTypeValue>None</inp1:CompressTypeValue>
<inp1:RecordsCount>5</inp1:RecordsCount>
</inp1:InputFileDetail>
</inp1:InputDetail>
<inp1:OutputSpecification>
<inp1:FileLocationURI>/mnt/auto/</inp1:FileLocationURI>
</inp1:OutputSpecification>
<inp1:NotificationDetail>
<inp1:NotificationMethodValue>Test</inp1:NotificationMethodValue>
<inp1:NotificationFrequencyValue>0</inp1:NotificationFrequencyValue>
</inp1:NotificationDetail>
<inp1:BatchReferenceDetail/>
</ProcessBatchRequest>
1 rows inserted.
Now i want to retrieve the value present under a given xpath. Can anyone help with the query???Not sure why you're storing double quotes around your XML text.
Anyway, here's a starting point for you...
SQL> ed
Wrote file afiedt.buf
1 with t as (select '"<ProcessBatchRequest xmlns:inp1="http://services.abc.com/" ServiceVersionNumber="" xmlns="http://services.abc.com/GlobalBatchServiceV1.0">
2 <inp1:BatchDetail>
3 <inp1:ApplicationID>test.123</inp1:ApplicationID>
4 <inp1:ApplicationBatchID>test.123</inp1:ApplicationBatchID>
5 <inp1:MessageTimeStamp>2012-11-28T11:05:32.000-05:00</inp1:MessageTimeStamp>
6 </inp1:BatchDetail>
7 <inp1:CustomerIdentityDetail>
8 <inp1:SubscriberNumber>123</inp1:SubscriberNumber>
9 <inp1:UserUniqueID>1542</inp1:UserUniqueID>
10 <inp1:SubscriberCountryISOAlpha2Code>AD</inp1:SubscriberCountryISOAlpha2Code>
11 <inp1:ApplicationCustomerID>1210</inp1:ApplicationCustomerID>
12 <inp1:ApplicationCustomerName>ABC</inp1:ApplicationCustomerName>
13 <inp1:ApplicationUserID>ABC</inp1:ApplicationUserID>
14 </inp1:CustomerIdentityDetail>
15 <inp1:BatchSpecification>
16 <inp1:BatchProcessID>Clean</inp1:BatchProcessID>
17 <inp1:BatchPriorityValue>10</inp1:BatchPriorityValue>
18 <inp1:LanguagePreferenceCode>39</inp1:LanguagePreferenceCode>
19 <inp1:CharacterSetPreferenceCode>23423</inp1:CharacterSetPreferenceCode>
20 <inp1:MatchSpecification>
21 <inp1:ConfidenceLowerLevelThresholdValue>8</inp1:ConfidenceLowerLevelThresholdValue>
22 <inp1:ConfidenceFallbackLowerLevelThresholdValue>4</inp1:ConfidenceFallbackLowerLevelThresholdValue>
23 <inp1:ReturnAllFallbackMatchCandidatesIndicator>false</inp1:ReturnAllFallbackMatchCandidatesIndicator>
24 <inp1:ExclusionCriteria>
25 <inp1:ExclusionDataDescription>Small</inp1:ExclusionDataDescription>
26 </inp1:ExclusionCriteria>
27 <inp1:ReturnCleansedInformationIndicator>false</inp1:ReturnCleansedInformationIndicator>
28 <inp1:MatchOnSeniorPrincipalNameIndicator>0</inp1:MatchOnSeniorPrincipalNameIndicator>
29 </inp1:MatchSpecification>
30 <inp1:CleanseSpecification>
31 <inp1:ParseOnlyIndicator>0</inp1:ParseOnlyIndicator>
32 <inp1:ProcessAsDiscreteDataIndicator>1</inp1:ProcessAsDiscreteDataIndicator>
33 <inp1:ReturnDatainMixedCaseIndicator>0</inp1:ReturnDatainMixedCaseIndicator>
34 <inp1:DoNotReturnChangeOfAddressIndicator>1</inp1:DoNotReturnChangeOfAddressIndicator>
35 <inp1:DoNotEnableDeliveryPointValidationIndicator>1</inp1:DoNotEnableDeliveryPointValidationIndicator>
36 <inp1:DoNotReturnEnhancedLineofTravelIndicator>1</inp1:DoNotReturnEnhancedLineofTravelIndicator>
37 <inp1:DoNotConvertRuralRouteToStreetAddressIndicator>1</inp1:DoNotConvertRuralRouteToStreetAddressIndicator>
38 <inp1:DoNotReturnSuiteAddressDetailIndicator>1</inp1:DoNotReturnSuiteAddressDetailIndicator>
39 </inp1:CleanseSpecification>
40 </inp1:BatchSpecification>
41 <inp1:InputDetail>
42 <inp1:InputFileDetail>
43 <inp1:FileURI>/mnt/auto/</inp1:FileURI>
44 <inp1:FileLayoutName>Clean</inp1:FileLayoutName>
45 <inp1:LanguageCode>36</inp1:LanguageCode>
46 <inp1:CompressTypeValue>None</inp1:CompressTypeValue>
47 <inp1:RecordsCount>5</inp1:RecordsCount>
48 </inp1:InputFileDetail>
49 </inp1:InputDetail>
50 <inp1:OutputSpecification>
51 <inp1:FileLocationURI>/mnt/auto/</inp1:FileLocationURI>
52 </inp1:OutputSpecification>
53 <inp1:NotificationDetail>
54 <inp1:NotificationMethodValue>Test</inp1:NotificationMethodValue>
55 <inp1:NotificationFrequencyValue>0</inp1:NotificationFrequencyValue>
56 </inp1:NotificationDetail>
57 <inp1:BatchReferenceDetail/>
58 </ProcessBatchRequest>"' as xml_clob from dual)
59 --
60 -- end of test data
61 --
62 select b.*, c.*
63 from t
64 ,xmltable(xmlnamespaces(default 'http://services.abc.com/GlobalBatchServiceV1.0', 'http://services.abc.com/' as "inp1"),
65 '/ProcessBatchRequest'
66 passing xmltype(trim('"' from xml_clob))
67 columns BD XMLTYPE path './inp1:BatchDetail'
68 ,CID XMLTYPE path './inp1:CustomerIdentityDetail'
69 ,BS XMLTYPE path './inp1:BatchSpecification'
70 ,ID XMLTYPE path './inp1:InputDetail'
71 ,OS XMLTYPE path './inp1:OutputSpecification'
72 ) a
73 ,xmltable(xmlnamespaces(default 'http://services.abc.com/GlobalBatchServiceV1.0', 'http://services.abc.com/' as "inp1"),
74 '/inp1:BatchDetail'
75 passing a.BD
76 columns App_ID varchar2(10) path './inp1:ApplicationID'
77 ,AppBat_ID varchar2(10) path './inp1:ApplicationBatchID'
78 ,MsgTS varchar2(30) path './inp1:MessageTimeStamp'
79 ) b
80 ,xmltable(xmlnamespaces(default 'http://services.abc.com/GlobalBatchServiceV1.0', 'http://services.abc.com/' as "inp1"),
81 '/inp1:CustomerIdentityDetail'
82 passing a.CID
83 columns Sub_No number path './inp1:SubscriberNumber'
84 ,UUID number path './inp1:UserUniqueID'
85 ,Sub_Country varchar2(2) path './inp1:SubscriberCountryISOAlpha2Code'
86 ,App_Cust_ID number path './inp1:ApplicationCustomerID'
87 ,App_Cust_Nm varchar2(10) path './inp1:ApplicationCustomerName'
88 ,App_User_ID varchar2(10) path './inp1:ApplicationUserID'
89* ) c
SQL> /
APP_ID APPBAT_ID MSGTS SUB_NO UUID SU APP_CUST_ID APP_CUST_N APP_USER_I
test.123 test.123 2012-11-28T11:05:32.000-05:00 123 1542 AD 1210 ABC ABC
SQL>
{code} -
Retrieve XML stored in CLOB as columns
Hi,
I have the below table that holds XML in a CLOB
CREATE TABLE testxml
(idcol NUMBER(3), xml_data CLOB
INSERT
INTO testxml VALUES
201,
<TRADE>
<TRADETYPE>SWAP</TRADETYPE>
<SUBTYPE>CDS</SUBTYPE>
<TRADEHEADER>
<ACTION>NEW</ACTION>
<SOURCEID>ABS-CD</SOURCEID>
<TRADEID>20595896</TRADEID>
</TRADEHEADER>
<TRADELEGS>
<TRADELEG>
<PAY_OR_RECEIVE>P</PAY_OR_RECEIVE>
<FIXED_FLOAT_IND>FLT</FIXED_FLOAT_IND>
<DAY_COUNT_BASIS>A365F</DAY_COUNT_BASIS>
<ORIG_PRIMARY_CURRENCY>ZAR</ORIG_PRIMARY_CURRENCY>
<FIRST_VALUE_DATE>20120511</FIRST_VALUE_DATE>
</TRADELEG>
<TRADELEG>
<PAY_OR_RECEIVE>R</PAY_OR_RECEIVE>
<FIXED_FLOAT_IND>FIX</FIXED_FLOAT_IND>
<DAY_COUNT_BASIS>A365F</DAY_COUNT_BASIS>
<ORIG_PRIMARY_CURRENCY>ZAR</ORIG_PRIMARY_CURRENCY>
<FIRST_VALUE_DATE>20120511</FIRST_VALUE_DATE>
</TRADELEG>
</TRADELEGS>
<PVS>
<PV_SOURCE>ABS-CD</PV_SOURCE>
<PV>
<NPV>0</NPV>
<NPV_CCY>ZAR</NPV_CCY>
<VALUATION_DATE>20130628</VALUATION_DATE>
<LEG_NUMBER>1</LEG_NUMBER>
</PV>
<PV>
<NPV>2214864.54</NPV>
<NPV_CCY>ZAR</NPV_CCY>
<VALUATION_DATE>20130628</VALUATION_DATE>
<LEG_NUMBER>2</LEG_NUMBER>
</PV>
</PVS>
<CREDIT_DERIVATIVES>
<CREDIT_DERIVATIVE>
<NOMINAL>100000000</NOMINAL>
<MATURITY_DATE>20170620</MATURITY_DATE>
<BUY_SELL_INDICATOR>SELL</BUY_SELL_INDICATOR>
<CURRENCY>ZAR</CURRENCY>
</CREDIT_DERIVATIVE>
<CREDIT_DERIVATIVE>
<NOMINAL>100002000</NOMINAL>
<MATURITY_DATE>20170620</MATURITY_DATE>
<BUY_SELL_INDICATOR>BUY</BUY_SELL_INDICATOR>
<CURRENCY>USD</CURRENCY>
</CREDIT_DERIVATIVE>
</CREDIT_DERIVATIVES>
</TRADE>
I need the data to be retrieved as columns. I have tried the below SQL but it works for one XMLTable i.e. TRADELEGS. But If I try to use another XMLTable for PVS then it does a cartesian join.
SELECT id,
xmltype(xml_data).extract('/TRADE/TRADETYPE/text()').getStringVal() AS TRADETYPE,
xmltype(xml_data).extract('/TRADE/SUBTYPE/text()').getStringVal() AS SUBTYPE,
xmltype(xml_data).extract('/TRADE/TRADEHEADER/ACTION/text()').getStringVal() AS ACTION,
x.PAY_OR_RECEIVE,
x.FIXED_FLOAT_IND
FROM testxml,
XMLTable( '/TRADE/TRADELEGS/TRADELEG' passing XMLTYPE(xml_data)
columns
PAY_OR_RECEIVE VARCHAR2(20) PATH 'PAY_OR_RECEIVE'
, FIXED_FLOAT_IND VARCHAR2(20) PATH 'FIXED_FLOAT_IND' ) x;
The below query does not work:
SELECT id,
xmltype(xml_data).extract('/TRADE/TRADETYPE/text()').getStringVal() AS TRADETYPE,
xmltype(xml_data).extract('/TRADE/SUBTYPE/text()').getStringVal() AS SUBTYPE,
xmltype(xml_data).extract('/TRADE/TRADEHEADER/ACTION/text()').getStringVal() AS ACTION,
tradeleg.PAY_OR_RECEIVE,
tradeleg.FIXED_FLOAT_IND
,xmltype(xml_data).extract('/TRADE/PVS/PV_SOURCE/text()').getStringVal() AS PV_SOURCE
,pvs.npv,
pvs.VALUATION_DATE
FROM testxml,
XMLTable( '/TRADE/TRADELEGS/TRADELEG' passing XMLTYPE(xml_data)
columns
PAY_OR_RECEIVE VARCHAR2(1) PATH 'PAY_OR_RECEIVE'
, FIXED_FLOAT_IND VARCHAR2(3) PATH 'FIXED_FLOAT_IND' ) tradeleg
,XMLTable( '/TRADE/PVS/PV' passing XMLTYPE(xml_data)
columns
NPV NUMBER PATH 'NPV'
, VALUATION_DATE VARCHAR2(8) PATH 'VALUATION_DATE' ) pvs
WHERE id = 1;
I need the output for TRADELEGS, PVS and CREDIT_DERIVATIVES.
Regards,
VikramBut If I try to use another XMLTable for PVS then it does a cartesian join.
Of course it does. You have to use a join condition of some kind.
What's the correlation between TRADELEGS, PVS and CREDIT_DERIVATIVES?
I guess you can relate a PV to a TRADELEG via the LEG_NUMBER, right? But what about CREDIT_DERIVATIVE to PV or to TRADELEG?
I need the output for TRADELEGS, PVS and CREDIT_DERIVATIVES.
Explain what that output should look like. -
Xml-fragment Issue retrieving Nested element data
Hi,
I've problem retrieving the nested element data from the xml. Using XmlBeans I am getting null when retriving the inner element. I printed the nested element xmlobject it has Xml-Fragment wrapped. I tired using below code it doesn't throw any error but the data is lost
AAAA TempObj=AAAA.getBXXX().getCXXX(0);
//remove xml fragment
XmlOptions xmlOpt = new XmlOptions();
xmlOpt.setSaveOuter();
XmlCursor c= TempObj.newCursor();
c.toFirstChild();
Myclass myclassObj= Myclass.Factory.parse(c.getObject().xmlText(xmlOpt));
log.debug("Records: "+myclassObj .getXXArray().length);
Output:
length should give aleast 1 or more but I am getting 0. That means the xmltext didn't parse properly.
Can anybody suggest what could be the problem.
Thanks in advance.
-Srino answer
-
Migrating V9 to V10: Update XML Fragment CLOB does not work anymore
I have an XML Schema that contains an element, named Operazione, mapped to a CLOB.
I just migrate to Oracle 10.1.0.2.0 from version 9.2.0.2.0 and the code I developed does not work anymore.
To get a CLOB on v 9.2.0.2.0 I issued the following statement:
select extractValue(value(p),'/operazione.log/Operazione') from XMT_OPERAZIONE_LOG p
where existsNode(value(p),'/operazione.log/Journal[NumeroElettronico=1234567890]') = 1
To make it working on V10 I have to change it as follow:
select extract(value(p),'/operazione.log/Operazione').getClobVal() from XMT_OPERAZIONE_LOG p
where existsNode(value(p),'/operazione.log/Journal[NumeroElettronico=1234567890]') = 1
So using extract intead of extractValue and adding getClobVal() I was able to read the CLOB.
The problem that I was not able to solve is related to CLOB update. In V9 just adding the âfor updateâ clause I was able to change the CLOB value on DB.
In V10 if I run the V9 statement I get the error:
ORA-03113: end-of-file on communication channel
If I use the statement modified for V10, adding the âfor updateâ clause, I get the CLOB and I can change the CLOB value but nothing goes on the DB. Probably I am working on a copy of the DB CLOB.
If I remove the getClobVal() I get an OPAQUE type that I can use on a XMLType but, still, nothing is stored on DB.
Any suggestion ?
I tried with both OCI and Thin ClientCan anybody help me ?
Is it better to use different strategies ( eg. Stored Procedure, DBMS_XMLSTORE etc, etc. ) ?
Any experience updatating XML Fragment CLOB on Oracle V10 ? -
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 valuesI 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. -
My php page needs to bind to multiple xml sources. How?
Hello --
I need to bind an xsl fragment on my php page to multiple xml sources. The bindings panel only allows for one. There's got to be a way, right? The schema is identical, in about eight files, I just want to search and report the info from all eight files into one xsl page... solution?
thanks!
DonI don't know if this is at all possible, or if it answers your needs, but what about creating a php page with all the recordsets in, print the results on the fly to a single xml file, and then import that one xml file.
Just a thought! -
Hopefully a quick one that I'm just missing.
I have a child table:
create table files (docid number(9), filename varchar2(200), filetype varchar2(30));
insert into files values (1, '1.pdf', 'primary');
insert into files values (2, '2.pdf', 'primary');
insert into files values (2, '3.pdf', 'secondary');
insert into files values (2, '4.pdf', 'tertiary');
insert into files values (2, '5.pdf', 'pending');
insert into files values (3, '6.pdf', 'secondary');
insert into files values (3, '7.pdf', 'secondary');What I need is an XML fragment to add to the parent document XML to indicate whether a document has a child filetype of some (but not all) of the permitted types.
The rules are:
if a 'primary' exists, create an element <orig>Y</orig>, otherwise create an element <orig>N</orig>
if a 'secondary' exists, create an element <alt>Y</alt>, otherwise create an element <alt>N</alt>
if a 'tertiary' exists, create an element <fin>Y</fin>, otherwise create an element <fin>N</fin>
if a 'pending' exists, do nothing
the result would be something similar to the following for a given docid:
docid 1 : <orig>Y</orig><alt>N</alt><fin>N</fin>
docid 2 : <orig>Y</orig><alt>Y</alt><fin>Y</fin>
docid 3 : <orig>N</orig><alt>Y</alt><fin>N</fin>I've got a brute force solution in hand, but I'm pretty sure there's a more elegant way.Hi,
Here's one way, if you want to create one fragment at a time for a given DOCID :
SQL> SELECT xmlagg(
2 case ftype
3 when 'primary' then xmlelement("orig", ftype_exists)
4 when 'secondary' then xmlelement("alt", ftype_exists)
5 when 'tertiary' then xmlelement("fin", ftype_exists)
6 end
7 ) as result
8 FROM (
9 SELECT t.column_value as ftype
10 , case when count(f.filetype) != 0 then 'Y' else 'N' end as ftype_exists
11 FROM files f
12 RIGHT OUTER JOIN
13 TABLE(
14 sys.odcivarchar2list( 'primary'
15 , 'secondary'
16 , 'tertiary' )
17 ) t
18 ON t.column_value = f.filetype
19 AND f.docid = 1
20 GROUP BY t.column_value
21 );
RESULT
<orig>Y</orig><alt>N</alt><fin>N</fin>
For multiple DOCID in the same query, a slight modification using a partitioned outer join :
SQL> SELECT docid
2 , xmlagg(
3 case ftype
4 when 'primary' then xmlelement("orig", ftype_exists)
5 when 'secondary' then xmlelement("alt", ftype_exists)
6 when 'tertiary' then xmlelement("fin", ftype_exists)
7 end
8 ) as result
9 FROM (
10 SELECT f.docid
11 , t.column_value as ftype
12 , case when count(f.filetype) != 0 then 'Y' else 'N' end as ftype_exists
13 FROM files f
14 PARTITION BY (f.docid)
15 RIGHT OUTER JOIN
16 TABLE(
17 sys.odcivarchar2list( 'primary'
18 , 'secondary'
19 , 'tertiary' )
20 ) t
21 ON t.column_value = f.filetype
22 GROUP BY f.docid, t.column_value
23 )
24 GROUP BY docid
25 ;
DOCID RESULT
1 <orig>Y</orig><fin>N</fin><alt>N</alt>
2 <orig>Y</orig><fin>Y</fin><alt>Y</alt>
3 <orig>N</orig><fin>N</fin><alt>Y</alt> -
Retrieving Multiple Values from a table
Dear Experts,
Can anyone let me know how to retrieve multiple rows from a table using Oracle BPEL Database Adapter and assign it to a output variable?
Regards,
Pradeep.If the input XML Record is as follows
Input xmlRecord:
<EmployeeCollection>
<Employee>
<id>10</id>
<lastName>Smith</lastName>
</Employee>
<Employee>
<id>20</id>
<lastName>Ram</lastName>
</Employee>
</EmployeeCollection>
I'm getting the following output when used with either queryByExample or normal SELECT option with a WHERE condition
<EmployeeCollection>
<Employee>
<id>10</id>
<lastName>Smith</lastName>
</Employee>
</EmployeeCollection>
Instead of all the records in the Employee table which meet the where condition?
I NEED OUTPUT AS FOLLOWS:
<EmployeeCollection>
<Employee>
<id>10</id>
<lastName>Smith</lastName>
</Employee>
<Employee>
<id>20</id>
<lastName>Ram</lastName>
</Employee>
</EmployeeCollection>
I'm using Transformation with for-each option
Can some one help it is very urgent.
Thanks & Regards,
Murali Vikrala
Maybe you are looking for
-
Windows ME Photo Transfer to Sleek Ph
Hello, I have Windows ME and I have been using Windows Media Player 9 to trandfer my music onto my Sleek Photo, but does anyone know of a way that I can transfer photos to my player without Windows XP? Thanks, Rob
-
Issues integrating niceScroll inside of nested symbol
So I have to produce a custom scrollbar for a client. Which means going to one of the JQuery scripts to create it. I saw a couple of posts about niceScroll, so I downloaded it. It works fine for a text area div that's on the main timeline. But my iss
-
We have a few questions about named query. According to the Toplink documentation, we can register the named query in 2 places. 1. Register the name query in the query manager in a Session level - The documentation said that these are for GLOBAL
-
Firewire drives won't spin down when I put iMac to sleep
I have three external hard drives connected to my iMac in a FW800 daisy chain. It used to be, when I put my iMac to sleep, all three of the external drives would spin down and go quiet. I replaced the drive in the middle of the chain with a new one (
-
I have a profile uplink which include a system vlan of 50, 60, 220 thne i also have a port profile for vlan 50 and 60 but when i connect a vm to this port group, i do not get any connection. however other vlans that are not set as system vlan on the