ORA-01427: using XML Shredding query
Oracle version: 10.2.0.4.0
Hello. I want to shred the following XML into relational form so I can insert the results into a table:
<?xml version="1.0" encoding="UTF-8"?>
<ContentEnvelope xmlns="http://data.schemas.tfn.orgname.com/Envelope/2007-10-29/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://data.schemas.tfn.orgname.com/Envelope/2007-10-29/Tests.xsd" majorVersion="0" minorVersion="0.1" publishingStyle="FULL">
<Header>
<Info>
<Id>2563653D10DF394085FED1CC358E2C</Id>
<TimeStamp>2008-04-17 23:51:17</TimeStamp>
</Info>
</Header>
<Body majorVersion="0" minorVersion="0.1" contentSet="Tests">
<ContentItem action="Insert">
<Data>
<MAElement dealId="1864795040">
<TestCurrencyCode>STG</TestCurrencyCode>
<TestStatusCode>P</TestStatusCode>
<TestAmtOrIDDate>2007-05-07</TestAmtOrIDDate>
<TestCreateDate>2007-05-04</TestCreateDate>
<TestUpdateDate>2008-03-27</TestUpdateDate>
<MAElementStructure>
<TestEVExcCpInf>13016605000</TestEVExcCpInf>
<TempEVAtAmt>8864948000</TempEVAtAmt>
<NOSORFI>33200000</NOSORFI>
<POBAPM>76</POBAPM>
<CSIDdBA>201049088</CSIDdBA>
<CSSTBA>1256556797</CSSTBA>
<SpinoffEstSP>0</SpinoffEstSP>
<STOptionAverageExercisePCR>3.56</STOptionAverageExercisePCR>
<STOptionProceedsBasedOnAverageExercisePCR>113030000</STOptionProceedsBasedOnAverageExercisePCR>
<POOrder>51.245</POOrder>
<POOther>0</POOther>
<POST>48.755</POST>
<POPprOwnedAfterTR>0</POPprOwnedAfterTR>
<POAcqPprIDd>23.892</POAcqPprIDd>
<POPprHeldBAAtAdDate>0</POPprHeldBAAtAdDate>
<SPPaidBAForXYZPpr>6.965</SPPaidBAForXYZPpr>
<PctgChangeFinalORFPCRToINTORFPCR>0</PctgChangeFinalORFPCRToINTORFPCR>
<POPprAcqSeekingToOwnAfterTR>100</POPprAcqSeekingToOwnAfterTR>
<POPprTRedInTRORF>0</POPprTRedInTRORF>
<PctgOwnedByXYZPostSymb>24</PctgOwnedByXYZPostSymb>
<EVOfOrder>4542393000</EVOfOrder>
<EVOfCMST>4321751000</EVOfCMST>
<EVOfTempBasedOnMMtt>10017260000</EVOfTempBasedOnMMtt>
<EVOfTempAtStartDate>10017260000</EVOfTempAtStartDate>
<PctOfPprSTInTRORF>0</PctOfPprSTInTRORF>
</MAElementStructure>
<IsCLLBreached>false</IsCLLBreached>
<CostToSpndCS>8751114000</CostToSpndCS>
<CostToSpndConvertibleSRCS>113030000</CostToSpndConvertibleSRCS>
<FormOfTestCode>M</FormOfTestCode>
<INTReceptionCode>A</INTReceptionCode>
<MAElementTypeCode>DI</MAElementTypeCode>
<INTORFPCR>6965000</INTORFPCR>
<CLLStatus>P</CLLStatus>
<TargetTermnationFee>87</TargetTermnationFee>
<TestEV>8864144000</TestEV>
<SourceUsedForTestValCode>RNS</SourceUsedForTestValCode>
<TestAttitudeCode>F</TestAttitudeCode>
<RankEVOfTR>9185144000</RankEVOfTR>
<ImpliedTestEV>8751918000</ImpliedTestEV>
<TestEVExcludingCpinFun>8864144000</TestEVExcludingCpinFun>
<TestEVExcludingXtrFlown>8864144000</TestEVExcludingXtrFlown>
<IsStandardRankingEligible>true</IsStandardRankingEligible>
<TRTypeCode>MERG</TRTypeCode>
<TestEVExcludingFlownXtrAtTestStartDate>17628123000</TestEVExcludingFlownXtrAtTestStartDate>
<GTmanTTFees>86711000</GTmanTTFees>
<SymmetricCLL>false</SymmetricCLL>
<TestParticipants>
<TestParticipant dealParticipantId="76132M" participantRoleCode="TARGET">
<TerminationFee>86800000</TerminationFee>
<TestMentors>
<TestMentor mentorOrganizationId="09253U" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-10</MentorAddedDate>
<MentorRoleAndCredit>something here</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>another desc</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="FA"/>
<TestMentorAssignment mentorAssignmentCode="FO"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="11524W" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-06-04</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="172967" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-15</MentorAddedDate>
<MentorRoleAndCredit>another thing</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>some desc</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="EC"/>
<TestMentorAssignment mentorAssignmentCode="FA"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="23868X" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-05-10</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="53581E" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-06-05</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="61698W" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-15</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="EC"/>
<TestMentorAssignment mentorAssignmentCode="FA"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="61750L" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-14</MentorAddedDate>
<MentorRoleAndCredit>$ 18,266.496 - CITIGROUP - Adv,ECM</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>plenty desc</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="FA"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="83117R" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-05-18</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="86065K" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-05-20</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="90248E" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-10</MentorAddedDate>
<MentorRoleAndCredit>$ 18,266.496 - UBS-INV-BANK - Adv,ECM,F Opin</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>yet another desc</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="EC"/>
<TestMentorAssignment mentorAssignmentCode="FA"/>
<TestMentorAssignment mentorAssignmentCode="FO"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="94864A" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-05-23</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>9220000</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
</TestMentors>
<TestParticipantOtherMMtt>
<InsurancePremiums>0</InsurancePremiums>
<TTJJDeposits>0</TTJJDeposits>
</TestParticipantOtherMMtt>
</TestParticipant>
<TestParticipant dealParticipantId="884903" participantRoleCode="ACQUIRER">
<TerminationFee>86800000</TerminationFee>
<TestMentors>
<TestMentor mentorOrganizationId="01751J" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-06-06</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="063671" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-23</MentorAddedDate>
<MentorRoleAndCredit>$ 18,266.496 - BANK-MONTREAL - Adv</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>abc</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="FA"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="07383Z" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-10</MentorAddedDate>
<MentorRoleAndCredit>$ 18,266.496 - BEAR - Adv,F Opin</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>efg</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="FA"/>
<TestMentorAssignment mentorAssignmentCode="FO"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="09962E" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-06-13</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="35645K" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-11-27</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="35805N" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-06-15</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="52751T" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-11-13</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="71354R" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-10</MentorAddedDate>
<MentorRoleAndCredit>$ 18,266.496 - PERELLA-WP - Adv</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>hij</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="FA"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="74897K" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-23</MentorAddedDate>
<MentorRoleAndCredit>$ 18,266.496 - RBC-CAP-MKTS - Adv</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>klm</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="FA"/>
</TestMentorAssignments>
</TestMentor>
<TestMentor mentorOrganizationId="82086P" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-09-06</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="83014W" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-06-01</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="89089Q" mentorTypeCode="LEGAL">
<MentorAddedDate>2007-06-04</MentorAddedDate>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<MentorLegalCredit>18266.496</MentorLegalCredit>
<TTMentorFee>0</TTMentorFee>
</TestMentor>
<TestMentor mentorOrganizationId="89117A" mentorTypeCode="FINANCIAL">
<MentorAddedDate>2007-05-15</MentorAddedDate>
<MentorRoleAndCredit>$ 18,266.496 - TD-SRCS - Adv</MentorRoleAndCredit>
<MentorRoleAndCreditLongDescription>nop</MentorRoleAndCreditLongDescription>
<RankMentorMultiplierEV>1</RankMentorMultiplierEV>
<IsRankingIneligible>false</IsRankingIneligible>
<GTmanImputedMentorFee>8122140</GTmanImputedMentorFee>
<TTMentorFee>0</TTMentorFee>
<TestMentorAssignments>
<TestMentorAssignment mentorAssignmentCode="FA"/>
</TestMentorAssignments>
</TestMentor>
</TestMentors>
<TestParticipantOtherMMtt>
<InsurancePremiums>0</InsurancePremiums>
<TTJJDeposits>0</TTJJDeposits>
</TestParticipantOtherMMtt>
</TestParticipant>
</TestParticipants>
<MAElementMultiples>
<PCRDocPremiumToDocEVDiff>5656.198</PCRDocPremiumToDocEVDiff>
<ORFPCRToEpsDiff>30.819</ORFPCRToEpsDiff>
<ORFPCRToDocEVDiff>57.562</ORFPCRToDocEVDiff>
<TestEVToSalesDiff>3.454</TestEVToSalesDiff>
<RankEVToEbitdaDiff>23.982</RankEVToEbitdaDiff>
<RankEVToEbitDiff>37.955</RankEVToEbitDiff>
<RankEVToNetTKsDiff>53.402</RankEVToNetTKsDiff>
<RankEVToNetGuideDiff>31.349</RankEVToNetGuideDiff>
<RankEVToSalesDiff>3.58</RankEVToSalesDiff>
<TestEVToEbitdaDiff>23.144</TestEVToEbitdaDiff>
<TestEVToEbitDiff>36.629</TestEVToEbitDiff>
<TestEVToCMTempDiff>51.536</TestEVToCMTempDiff>
<TestEVToNetTKsDiff>51.536</TestEVToNetTKsDiff>
<TestEVToNetGuideDiff>30.253</TestEVToNetGuideDiff>
<TestEVExcludingFlownXtrToEbitdaDiff>23.144</TestEVExcludingFlownXtrToEbitdaDiff>
<TestEVExcludingFlownXtrToEbitDiff>36.629</TestEVExcludingFlownXtrToEbitDiff>
<TestEVExcludingFlownXtrToNetGuideDiff>30.253</TestEVExcludingFlownXtrToNetGuideDiff>
<TestEVExcludingFlownXtrToPretaxGuideDiff>27.963</TestEVExcludingFlownXtrToPretaxGuideDiff>
<TestEVExcludingFlownXtrToSalesDiff>3.454</TestEVExcludingFlownXtrToSalesDiff>
<ImpliedTestEVToCMTempDiff>50.883</ImpliedTestEVToCMTempDiff>
<ImpliedTestEVToNetGuideDiff>29.87</ImpliedTestEVToNetGuideDiff>
<ImpliedTestEVToPretaxGuideDiff>27.609</ImpliedTestEVToPretaxGuideDiff>
</MAElementMultiples>
<TestHistoryEvents>
<TestHistoryEvent>
<HistoryEventDate>2007-05-04 00:00:00</HistoryEventDate>
<TestHistoryEventDescriptions>
<TestHistoryEventDescription>
<HistoryEventDescription>Some plans arerumored</HistoryEventDescription>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestHistoryEventDescription>
</TestHistoryEventDescriptions>
</TestHistoryEvent>
<TestHistoryEvent>
<HistoryEventDate>2007-05-07 00:00:00</HistoryEventDate>
<TestHistoryEventDescriptions>
<TestHistoryEventDescription>
<HistoryEventDescription>Some plans aredisclosed</HistoryEventDescription>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestHistoryEventDescription>
</TestHistoryEventDescriptions>
</TestHistoryEvent>
<TestHistoryEvent>
<HistoryEventCurrencyCode>STG</HistoryEventCurrencyCode>
<HistoryEventDate>2007-05-08 00:00:00</HistoryEventDate>
<HistoryEventDateOfExchangeRate>2007-05-08 00:00:00</HistoryEventDateOfExchangeRate>
<TestHistoryEventDescriptions>
<TestHistoryEventDescription>
<HistoryEventDescription>Terms are disclosed</HistoryEventDescription>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestHistoryEventDescription>
</TestHistoryEventDescriptions>
</TestHistoryEvent>
<TestHistoryEvent>
<HistoryEventCurrencyCode>STG</HistoryEventCurrencyCode>
<HistoryEventDate>2007-05-15 00:00:00</HistoryEventDate>
<HistoryEventDateOfExchangeRate>2007-05-08 00:00:00</HistoryEventDateOfExchangeRate>
<TestHistoryEventDescriptions>
<TestHistoryEventDescription>
<HistoryEventDescription>Symb agreement is disclosed</HistoryEventDescription>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestHistoryEventDescription>
</TestHistoryEventDescriptions>
</TestHistoryEvent>
<TestHistoryEvent>
<HistoryEventCurrencyCode>STG</HistoryEventCurrencyCode>
<HistoryEventDate>2007-05-15 00:00:00</HistoryEventDate>
<HistoryEventDateOfExchangeRate>2007-05-08 00:00:00</HistoryEventDateOfExchangeRate>
<TestHistoryEventDescriptions>
<TestHistoryEventDescription>
<HistoryEventDescription>Thomson & Reuters' boardsrecommend merger</HistoryEventDescription>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestHistoryEventDescription>
</TestHistoryEventDescriptions>
</TestHistoryEvent>
</TestHistoryEvents>
<TestCharacteristics>
<TestCharacteristicTypeCode>ISV</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>PRD</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>RUMOR</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>SCHEME</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>SFBOR</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>SFBRIDGE</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>SFCORP</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>STR</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>SYN</TestCharacteristicTypeCode>
<IsRankingEV>true</IsRankingEV>
<IsPortfolioCompanyActivity>false</IsPortfolioCompanyActivity>
<IsDefensiveWhiteSquire>false</IsDefensiveWhiteSquire>
</TestCharacteristics>
<MAElementPurchs>
<TestPurch>
<PurchTypeCode>CASH</PurchTypeCode>
<PurchCategory>OFFERED</PurchCategory>
</TestPurch>
<TestPurch>
<PurchTypeCode>ORD</PurchTypeCode>
<PurchCategory>OFFERED</PurchCategory>
</TestPurch>
<TestPurch>
<PurchTypeCode>OPT</PurchTypeCode>
<PurchCategory>SOUGHT</PurchCategory>
</TestPurch>
<TestPurch>
<PurchTypeCode>ORD</PurchTypeCode>
<PurchCategory>SOUGHT</PurchCategory>
</TestPurch>
</MAElementPurchs>
<TestDescriptions>
<TestDescription>
<DescriptionCode>MULT_NOTES</DescriptionCode>
<DescriptionText>Here is some text</DescriptionText>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestDescription>
<TestDescription>
<DescriptionCode>OPTIONS_DESC</DescriptionCode>
<DescriptionText>and some more</DescriptionText>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestDescription>
<TestDescription>
<DescriptionCode>PURPOSE</DescriptionCode>
<DescriptionText>it goes on</DescriptionText>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestDescription>
<TestDescription>
<DescriptionCode>SF</DescriptionCode>
<DescriptionText>and on</DescriptionText>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestDescription>
<TestDescription>
<DescriptionCode>SYNOPSIS</DescriptionCode>
<DescriptionText>and on for a while</DescriptionText>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestDescription>
</TestDescriptions>
<TestDates>
<TestDate dateTypeCode="DATEEFFEXP">
<TestDateEV>2008-04-17</TestDateEV>
</TestDate>
<TestDate dateTypeCode="DATEANNORIG">
<TestDateEV>2007-05-04</TestDateEV>
</TestDate>
<TestDate dateTypeCode="DATECOM">
<TestDateEV>2007-05-07</TestDateEV>
</TestDate>
<TestDate dateTypeCode="DATEVAL">
<TestDateEV>2007-05-08</TestDateEV>
</TestDate>
<TestDate dateTypeCode="SIG_UPDATE">
<TestDateEV>2007-05-23</TestDateEV>
</TestDate>
</TestDates>
<RegulatoryAgencies>
<RegulatoryAgencyCode>EC</RegulatoryAgencyCode>
<RegulatoryAgencyCode>RA</RegulatoryAgencyCode>
</RegulatoryAgencies>
<TestInfoSources>
<TestInfoSource dealInfoSourceCode="WS">
<TestInfoSourceTypeCode>FINSRC</TestInfoSourceTypeCode>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="WS">
<TestInfoSourceTypeCode>A</TestInfoSourceTypeCode>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="RT">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-04</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="WS">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-04</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="RNS">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-08</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="20F">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-08</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="AM">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-08</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="RNS">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-15</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="AM">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-15</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="6K">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-06-01</TestInfoSourceDate>
</TestInfoSource>
</TestInfoSources>
</MAElement>
</Data>
</ContentItem>
<ContentItem action="Insert">
<Data>
<MAElement dealId="1864899020">
<TestStatusCode>P</TestStatusCode>
<TestAOrIDate>2008-02-01</TestAOrIDate>
<TestCreateDate>2007-05-04</TestCreateDate>
<TestUpdateDate>2008-04-15</TestUpdateDate>
<MAElementStructure>
<CSSTBA>1469486513</CSSTBA>
<SpinoffEstSP>0</SpinoffEstSP>
<POOrder>50</POOrder>
<POOther>0</POOther>
<POST>50</POST>
<POPprOwnedAfterTR>0</POPprOwnedAfterTR>
<POAcqPprIDd>0</POAcqPprIDd>
<POPprHeldBAAtAdDate>0</POPprHeldBAAtAdDate>
<SPPaidBAForXYZPpr>31</SPPaidBAForXYZPpr>
<PctgChangeFinalORFPCRToINTORFPCR>0</PctgChangeFinalORFPCRToINTORFPCR>
<POPprAcqSeekingToOwnAfterTR>100</POPprAcqSeekingToOwnAfterTR>
<POPprTRedInTRORF>0</POPprTRedInTRORF>
<EVOfOrder>21855801000</EVOfOrder>
<EVOfCMST>21855800000</EVOfCMST>
<IsEVOfUndeterminedPurchEstimates>false</IsEVOfUndeterminedPurchEstimates>
<EVOfTempBasedOnMMtt>43537945000</EVOfTempBasedOnMMtt>
<EVOfTempAtStartDate>43537945000</EVOfTempAtStartDate>
<PctOfPprSTInTRORF>0</PctOfPprSTInTRORF>
</MAElementStructure>
<IsCLLBreached>false</IsCLLBreached>
<IsChoiceOfPurch>true</IsChoiceOfPurch>
<CostToSpndCS>41429324000</CostToSpndCS>
<CostToSpndConvertibleSRCS>2282277000</CostToSpndConvertibleSRCS>
<FormOfTestCode>M</FormOfTestCode>
<INTReceptionCode>U</INTReceptionCode>
<MAElementTypeCode>DI</MAElementTypeCode>
<INTORFPCR>31000000</INTORFPCR>
<CLLStatus>P</CLLStatus>
<TestEV>43711601000</TestEV>
<SourceUsedForTestValCode>AM</SourceUsedForTestValCode>
<TestAttitudeCode>U</TestAttitudeCode>
<RankEVOfTR>41860117000</RankEVOfTR>
<ImpliedTestEV>45554082000</ImpliedTestEV>
<TestEVExcludingCpinFun>43711601000</TestEVExcludingCpinFun>
<TestEVExcludingXtrFlown>43711601000</TestEVExcludingXtrFlown>
<IsStandardRankingEligible>true</IsStandardRankingEligible>
<TRTypeCode>MERG</TRTypeCode>
<TestEVExcludingFlownXtrAtTestStartDate>43711601000</TestEVExcludingFlownXtrAtTestStartDate>
<GTmanTTFees>0</GTmanTTFees>
<SymmetricCLL>false</SymmetricCLL>
<TestParticipants>
<TestParticipant dealParticipantId="594918" participantRoleCode="ACQUIRER">
<TestParticipantOtherMMtt>
<InsurancePremiums>0</InsurancePremiums>
<TTJJDeposits>0</TTJJDeposits>
</TestParticipantOtherMMtt>
</TestParticipant>
<TestParticipant dealParticipantId="984332" participantRoleCode="TARGET">
<TestParticipantOtherMMtt>
<InsurancePremiums>0</InsurancePremiums>
<TTJJDeposits>-921927000</TTJJDeposits>
</TestParticipantOtherMMtt>
</TestParticipant>
</TestParticipants>
<MAElementMultiples>
<PCRDocPremiumToDocEVDiff>350.385</PCRDocPremiumToDocEVDiff>
<ORFPCRToEpsDiff>45.667</ORFPCRToEpsDiff>
<ORFPCRToDocEVDiff>4.504</ORFPCRToDocEVDiff>
<TestEVToSalesDiff>119.186</TestEVToSalesDiff>
<RankEVToNetTKsDiff>4.566</RankEVToNetTKsDiff>
<RankEVToNetGuideDiff>43.733</RankEVToNetGuideDiff>
<RankEVToSalesDiff>114.137</RankEVToSalesDiff>
<TestEVToCMTempDiff>4.772</TestEVToCMTempDiff>
<TestEVToNetTKsDiff>4.767</TestEVToNetTKsDiff>
<TestEVToNetGuideDiff>45.667</TestEVToNetGuideDiff>
<TestEVExcludingFlownXtrToNetGuideDiff>45.667</TestEVExcludingFlownXtrToNetGuideDiff>
<TestEVExcludingFlownXtrToPretaxGuideDiff>393.961</TestEVExcludingFlownXtrToPretaxGuideDiff>
<TestEVExcludingFlownXtrToSalesDiff>119.186</TestEVExcludingFlownXtrToSalesDiff>
<ImpliedTestEVToCMTempDiff>4.973</ImpliedTestEVToCMTempDiff>
<ImpliedTestEVToNetGuideDiff>47.592</ImpliedTestEVToNetGuideDiff>
<ImpliedTestEVToPretaxGuideDiff>410.567</ImpliedTestEVToPretaxGuideDiff>
</MAElementMultiples>
<TestHistoryEvents>
<TestHistoryEvent>
<HistoryEventDate>2007-05-04 00:00:00</HistoryEventDate>
<TestHistoryEventDescriptions>
<TestHistoryEventDescription>
<HistoryEventDescription>Symb negotiations are rumored</HistoryEventDescription>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestHistoryEventDescription>
</TestHistoryEventDescriptions>
</TestHistoryEvent>
</TestHistoryEvents>
<TestCharacteristics>
<TestCharacteristicTypeCode>EPM</TestCharacteristicTypeCode>
<TestCharacteristicTypeCode>RUMOR</TestCharacteristicTypeCode>
<IsRankingEV>true</IsRankingEV>
<IsPortfolioCompanyActivity>false</IsPortfolioCompanyActivity>
<IsDefensiveWhiteSquire>false</IsDefensiveWhiteSquire>
</TestCharacteristics>
<MAElementPurchs>
<TestPurch>
<PurchTypeCode>NA</PurchTypeCode>
<PurchCategory>OFFERED</PurchCategory>
</TestPurch>
<TestPurch>
<PurchTypeCode>COM</PurchTypeCode>
<PurchCategory>SOUGHT</PurchCategory>
</TestPurch>
</MAElementPurchs>
<TestDescriptions>
<TestDescription>
<DescriptionCode>PURPOSE</DescriptionCode>
<DescriptionText>this field is large</DescriptionText>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestDescription>
<TestDescription>
<DescriptionCode>SYNOPSIS</DescriptionCode>
<DescriptionText>yes</DescriptionText>
<LanguageCode>en</LanguageCode>
<LanguageScriptCode>en-US</LanguageScriptCode>
</TestDescription>
</TestDescriptions>
<TestDates>
<TestDate dateTypeCode="DATECOM">
<TestDateEV>2008-01-31</TestDateEV>
</TestDate>
<TestDate dateTypeCode="SIG_UPDATE">
<TestDateEV>2008-02-11</TestDateEV>
</TestDate>
<TestDate dateTypeCode="DATEVAL">
<TestDateEV>2008-02-01</TestDateEV>
</TestDate>
<TestDate dateTypeCode="DATEEFFEXP">
<TestDateEV>2008-12-31</TestDateEV>
</TestDate>
</TestDates>
<TestInfoSources>
<TestInfoSource dealInfoSourceCode="WS">
<TestInfoSourceTypeCode>A</TestInfoSourceTypeCode>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="WS">
<TestInfoSourceTypeCode>FINSRC</TestInfoSourceTypeCode>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="NYP">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-04</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="10K">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-04</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="10Q">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-04</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="BSW">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-04</TestInfoSourceDate>
</TestInfoSource>
<TestInfoSource dealInfoSourceCode="NR">
<TestInfoSourceTypeCode>SOURCE</TestInfoSourceTypeCode>
<TestInfoSourceDate>2007-05-04</TestInfoSourceDate>
</TestInfoSource>
</TestInfoSources>
</MAElement>
</Data>
</ContentItem>
</Body>
</ContentEnvelope>
This is what I've tried (subset_2.xml is the XML above):
DROP TABLE ray_test_6;
CREATE TABLE ray_test_6
(id NUMBER
,data XMLTYPE
INSERT INTO ray_test_6
(id
,data
VALUES
(1
,XMLTYPE(BFILENAME('SDI_RAY','subset_2.xml'), NLS_CHARSET_ID('AL32UTF8'))
Now, I try to shred the XML using the following statement to get all TestStatusCode nodes:
SELECT *
FROM XMLTABLE('//Body/ContentItem/Data/MAElement'
PASSING (SELECT VALUE(e)
FROM ray_test_6
,TABLE(XMLSEQUENCE(EXTRACT(data
,'ContentEnvelope/*'
,'xmlns="http://data.schemas.tfn.orgname.com/Envelope/2007-10-29/"'))) e)
COLUMNS prod VARCHAR2(20) PATH 'TestStatusCode');
but I get the following error:
PASSING (SELECT VALUE(e)
ERROR at line 3:
ORA-01427: single-row subquery returns more than one row
I can't see what I'm doing wrong. Can anyone help?
Thanks,
Ray
try this
select x.*
from ray_test_6 r
,xmltable(xmlnamespaces(default 'http://data.schemas.tfn.orgname.com/Envelope/2007-10-29/')
,'for $i in /ContentEnvelope/Body/ContentItem/Data/MAElement
return $i'
passing r.data
columns status varchar2(30) path 'TestStatusCode'
,upd_date date path 'TestUpdateDate'
,crt_date date path 'TestCreateDate') x; Ants
Similar Messages
-
Hi all,
I am using a query that has about 12 select clauses in the main Select clause and also other independent columns. I am also using order by for one of the independent column. i am getting an error ORA-01427 - Single subquery returns more than one row.How to resolve this issue. If order by is removed it works. But order by is mandatory here.
ThanksHi!
Please post your query. Without your query I couldn't give you a precise answner. But I guess that your problem is that you've used a single row operator like = in a WHERE-Clause where you get more then one row. Try using somithing like IN, SOME, ANY ...
Hope this helps!
regards -
ORA-01427:single-row sub query returns more than one row (group by)
Hello every one, I am very new to this field , and Right now I am working with this sql, where BEG_BAL_WKST,WKST_RECEIVED_NUM,WKST_PROCESSED_NUM,WKST_CANCELED_NUM are needs to be grouped by,but I am getting the "single-row sub query returns more than one row".
This is the query I am using in my source qualifier:
select
SUM(tmp.WIP_TO_BILL_LOC_AMT) AS WIP_TO_BILL_LOC_AMT,
sum(tmp.REALIZATION_LOC_AMT) AS REALIZATION_LOC_AMT,
SUM(tmp.NEG_REAL_LOC_AMT) AS NEG_REAL_LOC_AMT,
sum(tmp.POS_REAL_LOC_AMT) AS POS_REAL_LOC_AMT,
sum(tmp.BILL_IN_ADVANCE_LOC_AMT) AS BILL_IN_ADVANCE_LOC_AMT,
sum(tmp.CARRY_FORWARD_LOC_AMT) AS CARRY_FORWARD_LOC_AMT,
sum(tmp.BILL_TO_CLIENT_LOC_AMT) AS BILL_TO_CLIENT_LOC_AMT,
sum(tmp.REMAIN_WIP_TO_BILL_LOC_AMT) REMAIN_WIP_TO_BILL_LOC_AMT,
sum(tmp.AR_INV_AMT) AS AR_INV_AMT,
sum(tmp.AR_TAX_AMT) AS AR_TAX_AMT,
tmp.BEG_BAL_WKST_NUM AS BEG_BAL_WKST_NUM,
tmp.WKST_RECEIVED_NUM AS WKST_RECEIVED_NUM,
tmp.WKST_PROCESSED_NUM AS WKST_PROCESSED_NUM,
tmp.WKST_CANCELED_NUM AS WKST_CANCELED_NUM,
tmp.DURATION AS DURATION,
tmp.NUM_DAYS AS NUM_DAYS,
tmp.NUM_HOURS AS NUM_HOURS,
tmp.NUM_MINUTES AS NUM_MINUTES,
tmp.NUM_SECONDS AS NUM_SECONDS,
tmp.LEAD_PROJECT_OFFICE_CODE AS LEAD_PROJECT_OFFICE_CODE,
tmp.LEAD_PROJECT_TEAM_CODE AS LEAD_PROJECT_TEAM_CODE,
tmp.ORG_ID AS ORG_ID,
tmp.RPT_DATE AS RPT_DATE,
tmp.RPT_DATE_WID AS RPT_DATE_WID,
tmp.LOCAL_CURR_CODE AS LOCAL_CURR_CODE,
tmp.USD_EXCH_RATE AS USD_EXCH_RATE,
tmp.EUR_EXCH_RATE AS EUR_EXCH_RATE,
tmp.GBP_EXCH_RATE AS GBP_EXCH_RATE
from(
SELECT
WIP_TO_BILL_LOC_AMT as WIP_TO_BILL_LOC_AMT ,
REALIZATION_LOC_AMT AS REALIZATION_LOC_AMT,
NEG_REAL_LOC_AMT AS NEG_REAL_LOC_AMT ,
POS_REAL_LOC_AMT AS POS_REAL_LOC_AMT,
BILL_IN_ADVANCE_LOC_AMT AS BILL_IN_ADVANCE_LOC_AMT ,
CARRY_FORWARD_loc_AMT AS CARRY_FORWARD_LOC_AMT,
bill_to_client_LOC_AMT AS BILL_TO_CLIENT_LOC_AMT ,
REMAIN_WIP_TO_BILL_LOC_AMT AS REMAIN_WIP_TO_BILL_LOC_AMT,
AR_inv_AMT AS AR_INV_AMT,
ar_tax_amt AS AR_TAX_AMT,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE ((inv_status_type='FIN'AND inv_status_code NOT IN ('COMPLETE','PROCESSED'))
OR (inv_status_type='WS' AND inv_status_code NOT IN ('PRC'))) --COMPLETED
AND to_char((sysdate-5),'YYYYMMDD') between to_char(status_start_dt,'YYYYMMDD') and to_char(status_end_dt,'YYYYMMDD')group by rpad(integration_id,32)) AS BEG_BAL_WKST_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE (inv_status_code='NEW')
AND to_char((sysdate-4),'YYYYMMDD') between to_char(status_start_dt,'YYYYMMDD') and to_char(status_end_dt,'YYYYMMDD')group by rpad(integration_id,32))AS WKST_RECEIVED_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE ((inv_status_type='FIN' and inv_status_code IN ('COMPLETE','PROCESSED'))
OR (inv_status_type='WS' AND inv_status_code IN ('PRC'))) --COMPLETED
AND to_char((sysdate-4),'YYYYMMDD') between to_char((status_start_dt),'YYYYMMDD') and to_char((status_end_dt),'YYYYMMDD')group by rpad(integration_id,32))AS WKST_PROCESSED_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE (inv_status_type='FIN' AND inv_status_code='CANCELLED')
AND to_char((sysdate-4),'YYYYMMDD') between to_char((status_start_dt),'YYYYMMDD') and to_char((status_end_dt),'YYYYMMDD')group by rpad(integration_id,32)) AS WKST_CANCELED_NUM,
DURATION AS DURATION,
NUM_DAYS AS NUM_DAYS,
NUM_HOURS AS NUM_HOURS,
NUM_MINUTES AS NUM_MINUTES,
NUM_SECONDS AS NUM_SECONDS,
lead_project_office_code AS LEAD_PROJECT_OFFICE_CODE,
lead_project_team_code AS LEAD_PROJECT_TEAM_CODE,
org_id AS ORG_ID,
trunc(sysdate-1) AS RPT_DATE,
to_char((sysdate-1),'YYYYMMDD') AS RPT_DATE_WID,
--last_day(a.report_date) mth_end_dt,
LOC_CURR_CODE AS LOCAL_CURR_CODE,
usd_exch_rate AS USD_EXCH_RATE,
eur_exch_rate AS EUR_EXCH_RATE,
gbp_exch_rate AS GBP_EXCH_RATE
FROM Wc_twfs_olb_invoice_history_f
Where
RPT_DT_MCAL_PERIOD_WID =(select max(RPT_DT_MCAL_PERIOD_WID)from Wc_twfs_olb_invoice_history_f))tmp
group by BEG_BAL_WKST_NUM,WKST_RECEIVED_NUM,WKST_PROCESSED_NUM,WKST_CANCELED_NUM,DURATION,NUM_DAYS,NUM_HOURS,NUM_MINUTES,NUM_SECONDS,
LEAD_PROJECT_OFFICE_CODE,LEAD_PROJECT_TEAM_CODE,ORG_ID,RPT_DATE,RPT_DATE_WID,
LOCAL_CURR_CODE,USD_EXCH_RATE,EUR_EXCH_RATE,GBP_EXCH_RATE;
Can you please suggest me what to do next, and what would be the solution to this.
Thanks a lot in advance. please show me some direction.you may want to change it something like
SELECT SUM(Wip_To_Bill_Loc_Amt) AS Wip_To_Bill_Loc_Amt,
SUM(Realization_Loc_Amt) AS Realization_Loc_Amt,
SUM(Neg_Real_Loc_Amt) AS Neg_Real_Loc_Amt,
SUM(Pos_Real_Loc_Amt) AS Pos_Real_Loc_Amt,
SUM(Bill_In_Advance_Loc_Amt) AS Bill_In_Advance_Loc_Amt,
SUM(Carry_Forward_Loc_Amt) AS Carry_Forward_Loc_Amt,
SUM(Bill_To_Client_Loc_Amt) AS Bill_To_Client_Loc_Amt,
SUM(Remain_Wip_To_Bill_Loc_Amt) AS Remain_Wip_To_Bill_Loc_Amt,
SUM(Ar_Inv_Amt) AS Ar_Inv_Amt,
SUM(Ar_Tax_Amt) AS Ar_Tax_Amt,
COUNT(DISTINCT CASE
WHEN ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code NOT IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code NOT IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 5), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD') THEN
Rpad(Integration_Id, 32)
END) AS Beg_Bal_Wkst_Num,
/*(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code NOT IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code NOT IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 5), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Beg_Bal_Wkst_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE (Inv_Status_Code = 'NEW')
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Received_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char((Status_Start_Dt), 'YYYYMMDD') AND
To_Char((Status_End_Dt), 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Processed_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE (Inv_Status_Type = 'FIN' AND Inv_Status_Code = 'CANCELLED')
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char((Status_Start_Dt), 'YYYYMMDD') AND
To_Char((Status_End_Dt), 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Canceled_Num,*/
Duration AS Duration,
Num_Days AS Num_Days,
Num_Hours AS Num_Hours,
Num_Minutes AS Num_Minutes,
Num_Seconds AS Num_Seconds,
Lead_Project_Office_Code AS Lead_Project_Office_Code,
Lead_Project_Team_Code AS Lead_Project_Team_Code,
Org_Id AS Org_Id,
Trunc(SYSDATE - 1) AS Rpt_Date,
To_Char((SYSDATE - 1), 'YYYYMMDD') AS Rpt_Date_Wid,
--last_day(a.report_date) mth_end_dt,
Loc_Curr_Code AS Local_Curr_Code,
Usd_Exch_Rate AS Usd_Exch_Rate,
Eur_Exch_Rate AS Eur_Exch_Rate,
Gbp_Exch_Rate AS Gbp_Exch_Rate
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE Rpt_Dt_Mcal_Period_Wid =
(SELECT MAX(Rpt_Dt_Mcal_Period_Wid)
FROM Wc_Twfs_Olb_Invoice_History_f)
GROUP BY Beg_Bal_Wkst_Num,
Wkst_Received_Num,
Wkst_Processed_Num,
Wkst_Canceled_Num,
Duration,
Num_Days,
Num_Hours,
Num_Minutes,
Num_Seconds,
Lead_Project_Office_Code,
Lead_Project_Team_Code,
Org_Id,
Rpt_Date,
Rpt_Date_Wid,
Local_Curr_Code,
Usd_Exch_Rate,
Eur_Exch_Rate,
Gbp_Exch_Rate;Edited by: 986006 on Mar 4, 2013 1:08 PM -
Getting ORA -01427 for an update query
Hi,
I have two tables
Create table tran
tran_id varchar(5) primary key,
stat varchar(6),
stat_ts timestamp);
create table tran_hist
hist_id number(5) primary key,
tran_id varchar(5) ,
stat varchar(6),
stat_ts timestamp);
insert into tran values('abc', 'stat4', sysdate);
insert into tran values('xyz', 'stat4', sysdate);
insert into tran values('pqr', 'stat3', sysdate);
insert into tran values('ijk', 'stat2', sysdate);
insert into tran_hist values(1, 'abc', 'stat1' , to_date('2/27/2011 14:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(2, 'abc', 'stat2' , to_date('3/27/2011 19:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(3, 'abc', 'stat3' , to_date('3/28/2011 15:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(4, 'xyz', 'stat1' , to_date('2/27/2011 11:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(5, 'xyz', 'stat2' , to_date('2/28/2011 14:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(6, 'xyz', 'stat3' , to_date('3/20/2011 04:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(7, 'pqr', 'stat1' , to_date('2/21/2011 14:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(8, 'pqr', 'stat2' , to_date('2/23/2011 11:30:23','mm/dd/yyyy HH24:MI:SS');
insert into tran_hist values(9, 'ijk', 'stat1' , to_date('2/20/2011 14:30:23','mm/dd/yyyy HH24:MI:SS');
I need to add a new column update_ts to tran_hist.
Please help me in updating the data for update_ts, i need the data to look like below. So, TRAN_ID with stat1 would have the stat2 STAT_TS as UPDATE_TS, etc. the max stat on TRAN_HIST would get the update_ts from TRAN table. update_ts is derived from the next stat.
hist_id tran_id stat stat_ts update_ts
1 abc stat1 2/27/2011 14:30:23 3/27/2011 19:30:23
2 abc stat2 3/27/2011 19:30:23 3/28/2011 15:30:23
3 abc stat3 3/28/2011 15:30:23 6/24/2011 15:30:23
4 xyz stat1 2/27/2011 11:30:23 2/28/2011 14:30:23
5 xyz stat2 2/28/2011 14:30:23 3/20/2011 04:30:23
6 xyz stat3 3/20/2011 04:30:23 6/24/2011 15:30:23
7 pqr stat1 2/21/2011 14:30:23 2/23/2011 11:30:23
8 pqr stat2 2/23/2011 11:30:23 6/24/2011 15:30:23
9 ijk stat1 2/20/2011 14:30:23 6/24/2011 15:30:23I'm not sure what the subject of this post has to do with the question. You already had a solution but that gave that error?
The query to get the data can look like this:
select h.hist_id,h.tran_id,h.stat,h.stat_ts,
lead(h.stat_ts,1,t.stat_ts) over (partition by h.tran_id order by h.tran_id) update_ts
from tran_hist h
left join tran t
on h.tran_id = t.tran_id
order by tran_id,HIST_ID;
HIST_ID TRAN_ID STAT STAT_TS UPDATE_TS
1 abc stat1 27.02.11 14:30:23.000000000 27.03.11 19:30:23.000000000
2 abc stat2 27.03.11 19:30:23.000000000 28.03.11 15:30:23.000000000
3 abc stat3 28.03.11 15:30:23.000000000 25.06.11 07:32:24.000000000
9 ijk stat1 20.02.11 14:30:23.000000000 25.06.11 07:32:24.000000000
7 pqr stat1 21.02.11 14:30:23.000000000 23.02.11 11:30:23.000000000
8 pqr stat2 23.02.11 11:30:23.000000000 25.06.11 07:32:24.000000000
4 xyz stat1 27.02.11 11:30:23.000000000 28.02.11 14:30:23.000000000
5 xyz stat2 28.02.11 14:30:23.000000000 20.03.11 04:30:23.000000000
6 xyz stat3 20.03.11 04:30:23.000000000 25.06.11 07:32:24.000000000 and an update:
alter table tran_hist add (update_ts timestamp);
merge into tran_hist ta
using
(select h.hist_id,h.tran_id,h.stat,h.stat_ts,
lead(h.stat_ts,1,t.stat_ts) over (partition by h.tran_id order by h.tran_id) update_ts
from tran_hist h
left join tran t
on h.tran_id = t.tran_id) so
on (ta.hist_id = so.hist_id)
WHEN MATCHED THEN UPDATE
SET ta.update_ts = so.update_ts;
commit;
select * from tran_hist; -
Update query is not working (ora-01427)
RDBMS 10gr2
Long story short, I created a column from one table in another because the table it was moved from isn't really needed as all the other information is stored in other tables. With that the original column has values that need to be copied to the new column before the old table is dropped.
I'm using this update query:
update bi_req bir
set bir.job_name =
(select distinct bij.job_name
from bi_jobs bij,
bi_freq bif,
bi_apps bia,
bi_req bir
where bij.fk_bi_req_id = bir.pk_bi_req_id
and bia.pk_bi_apps_id = bij.fk_bi_apps_id
and bif.pk_bi_freq_id = bij.fk_bi_freq_id)
where bir.job_name is null;If I run the select statement separately, I get the exact results I need however whenever I run the entire statement, I get:
Error: ORA-01427: single-row subquery returns more than one rowI removed the extra bi_req from the subquery and that didn't help any.
If I replace the '=' with IN (also ALL) I get the error message:
ORA-00927: missing equal signHere is the create table for the table that will soon be dropped:
CREATE TABLE BI_JOBS
PK_BI_JOBS_ID NUMBER NOT NULL,
FK_BI_APPS_ID NUMBER NOT NULL,
FK_BI_FREQ_ID NUMBER NOT NULL,
JOB_NAME VARCHAR2(50 CHAR) NOT NULL,
FK_BI_REQ_ID NUMBER NOT NULL
)and the relevant columns for the table that has the column that needs the values from bi_jobs.job_name
CREATE TABLE BI_REQ
PK_BI_REQ_ID NUMBER NOT NULL,
FK_FREQ_ID NUMBER NOT NULL,
FK_BI_APPS_ID NUMBER,
JOB_NAME VARCHAR2(50 CHAR)
)Whatever value that is in bi_jobs.job_name I want in bi_req.job_name assuming that bi_jobs.fk_bi_req_id equals bi_req.pk_bi_req_id -
XML Generation using a sql query in an efficient way -Help needed urgently
Hi
I am facing the following issue while generating xml using an sql query. I get the below given table using a query.
CODE ID MARK
==================================
1 4 2331 809
2 4 1772 802
3 4 2331 845
4 5 2331 804
5 5 2331 800
6 5 2210 801
I need to generate the below given xml using a query
<data>
<CODE>4</CODE>
<IDS>
<ID>2331</ID>
<ID>1772</ID>
</IDS>
<MARKS>
<MARK>809</MARK>
<MARK>802</MARK>
<MARK>845</MARK>
</MARKS>
</data>
<data>
<CODE>5</CODE>
<IDS>
<ID>2331</ID>
<ID>2210</ID>
</IDS>
<MARKS>
<MARK>804</MARK>
<MARK>800</MARK>
<MARK>801</MARK>
</MARKS>
</data>
Can anyone help me with some idea to generate the above given CLOB messagenot sure if this is the right way to do it but
/* Formatted on 10/12/2011 12:52:28 PM (QP5 v5.149.1003.31008) */
WITH data AS (SELECT 4 code, 2331 id, 809 mark FROM DUAL
UNION
SELECT 4, 1772, 802 FROM DUAL
UNION
SELECT 4, 2331, 845 FROM DUAL
UNION
SELECT 5, 2331, 804 FROM DUAL
UNION
SELECT 5, 2331, 800 FROM DUAL
UNION
SELECT 5, 2210, 801 FROM DUAL)
SELECT TO_CLOB (
'<DATA>'
|| listagg (xml, '</DATA><DATA>') WITHIN GROUP (ORDER BY xml)
|| '</DATA>')
xml
FROM ( SELECT '<CODE>'
|| code
|| '</CODE><IDS><ID>'
|| LISTAGG (id, '</ID><ID>') WITHIN GROUP (ORDER BY id)
|| '</ID><IDS><MARKS><MARK>'
|| LISTAGG (mark, '</MARK><MARK>') WITHIN GROUP (ORDER BY id)
|| '</MARK></MARKS>'
xml
FROM data
GROUP BY code) -
Cursors are not closed when using Ref Cursor Query in a report ORA-01000
Dear Experts
Oracel database 11g,
developer suite 10.1.2.0.2,
application server 10.1.2.0.2,
Windows xp platform
For a long time, I'm hitting ORA-01000
I have a 2 group report (master and detail) using Ref Cusor query, when this report is run, I found that it opens several cursors (should be only one cursor) for the detail query although it should not, I found that the number of these cursors is equal to the number of master records.
Moreover, after the report is finished, these cursors are not closed, and they are increasing cumulatively each time I run the report, and finally the maximum number of open cursors is exceeded, and thus I get ORA-01000.
I increased the open cursors parameter for the database to an unbeleivable value 30000, but of course it will be exceeded during the session because the cursors are increasing cumulatively.
I Found that this problem is solved when using only one master Ref Cursor Query and create a breake group, the problem is solved also if we use SQL Query instead of Ref Query for the master and detail queries, but for some considerations, I should not use neither breake group nor SQL Query, I have to use REF Cursor queries.
Is this an oracle bug , and how can I overcome ?
Thanks
Edited by: Mostafa Abolaynain on May 6, 2012 9:58 AMThank you Inol for your answer, However
Ref Cursor give me felxibility to control the query, for example see the following query :
function QR_1RefCurDS return DEF_CURSORS.JOURHEAD_REFCUR is
temp_JOURHEAD DEF_CURSORS.JOURHEAD_refcur;
v_from_date DATE;
v_to_date DATE;
V_SERIAL_TYPE number;
begin
SELECT SERIAL_TYPE INTO V_SERIAL_TYPE
FROM ACC_VOUCHER_TYPES
where voucher_type='J'
and IDENT_NO=:IDENT
AND COMP_NO=TO_NUMBER(:COMPANY_NO);
IF :no_date=1 then
IF V_SERIAL_TYPE =1 THEN
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((TO_NUMBER(VOCH_NO)=:FROM_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NULL)
OR (TO_NUMBER(VOCH_NO) BETWEEN :FROM_NO AND :TO_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NOT NULL )
OR (TO_NUMBER(VOCH_NO)<=:TO_NO and :FROM_NO IS NULL AND :TO_NO IS NOT NULL )
OR (:FROM_NO IS NULL AND :TO_NO IS NULL ))
ORDER BY TO_NUMBER(VOCH_NO);
ELSE
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((VOCH_NO=:FROM_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NULL)
OR (VOCH_NO BETWEEN :FROM_NO AND :TO_NO and :FROM_NO IS NOT NULL AND :TO_NO IS NOT NULL )
OR (VOCH_NO<=:TO_NO and :FROM_NO IS NULL AND :TO_NO IS NOT NULL )
OR (:FROM_NO IS NULL AND :TO_NO IS NULL ))
ORDER BY VOCH_NO;
END IF;
ELSE
v_from_date:=to_DATE(:from_date);
v_to_date:=to_DATE(:to_date);
IF V_SERIAL_TYPE =1 THEN
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((voch_date between v_from_date and v_to_date and :from_date is not null and :to_date is not null)
OR (voch_date <= v_to_date and :from_date is null and :to_date is not null)
OR (voch_date = v_from_date and :from_date is not null and :to_date is null)
OR (:from_date is null and :to_date is null ))
ORDER BY VOCH_DATE,TO_NUMBER(VOCH_NO);
ELSE
open temp_JOURHEAD for select VOCH_NO, VOCH_DATE
FROM JOURHEAD
WHERE COMP_NO=TO_NUMBER(:COMPANY_NO)
AND IDENT=:IDENT
AND ((voch_date between v_from_date and v_to_date and :from_date is not null and :to_date is not null)
OR (voch_date <= v_to_date and :from_date is null and :to_date is not null)
OR (voch_date = v_from_date and :from_date is not null and :to_date is null)
OR (:from_date is null and :to_date is null ))
ORDER BY VOCH_DATE,VOCH_NO;
END IF;
END IF;
return temp_JOURHEAD;
end; -
ORA-29540: class oracle/xml/sql/query/OracleXMLStaticQuery does not exist
I am getting below error when trying to generate xml. Browsing on google did not help me. I would appreciate if someone can provide the solution.
SQL> select dbms_xmlquery.getxml('select * from dual', 2) from dual;
ERROR:
ORA-29540: class oracle/xml/sql/query/OracleXMLStaticQuery does not exist
ORA-06512: at "SYS.DBMS_XMLQUERY", line 19
ORA-06512: at "SYS.DBMS_XMLQUERY", line 271
ORA-06512: at line 1Then it is probably not the case that you are affected by the issue described in Metalink document 185857.1, but if I were you I would check it anyway, since it might be the problem.
-
Hi all,
From https://www.simple-talk.com/content/print.aspx?article=1756, I mimicked to create the following sql code to do Importing XML data using a CTE:
---Importing XML data using a CTE -----Ad-Hoc XML File Query--simple-talk---1020AM 27 Feb 2015
---query the XML Blob using a CTE (pulling from the XML file each time
USE OPENXMLtesting1
GO
With XmlFile (Contents) AS (
SELECT CONVERT (XML, BulkColumn)
FROM OPENROWSET (BULK 'C:\XML FilesMicrosoft-Samples\books.xml', SINGLE BLOB) AS XmlData
SELECT
FROM XmlFile
GO
I got the following message:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'BLOB'.
I have no ideas why it is incorrect in that code statment. Please kindly help, advise and respond.
Thanks in advance,
Scott Chang
P. S. The books.xml file was copied from the Microsoft samples:
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
<book id="bk104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-03-10</publish_date>
<description>In post-apocalypse England, the mysterious
agent known only as Oberon helps to create a new life
for the inhabitants of London. Sequel to Maeve
Ascendant.</description>
</book>
<book id="bk105">
<author>Corets, Eva</author>
<title>The Sundered Grail</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-09-10</publish_date>
<description>The two daughters of Maeve, half-sisters,
battle one another for control of England. Sequel to
Oberon's Legacy.</description>
</book>
<book id="bk106">
<author>Randall, Cynthia</author>
<title>Lover Birds</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-09-02</publish_date>
<description>When Carla meets Paul at an ornithology
conference, tempers fly as feathers get ruffled.</description>
</book>
<book id="bk107">
<author>Thurman, Paula</author>
<title>Splish Splash</title>
<genre>Romance</genre>
<price>4.95</price>
<publish_date>2000-11-02</publish_date>
<description>A deep sea diver finds true love twenty
thousand leagues beneath the sea.</description>
</book>
<book id="bk108">
<author>Knorr, Stefan</author>
<title>Creepy Crawlies</title>
<genre>Horror</genre>
<price>4.95</price>
<publish_date>2000-12-06</publish_date>
<description>An anthology of horror stories about roaches,
centipedes, scorpions and other insects.</description>
</book>
<book id="bk109">
<author>Kress, Peter</author>
<title>Paradox Lost</title>
<genre>Science Fiction</genre>
<price>6.95</price>
<publish_date>2000-11-02</publish_date>
<description>After an inadvertant trip through a Heisenberg
Uncertainty Device, James Salway discovers the problems
of being quantum.</description>
</book>
<book id="bk110">
<author>O'Brien, Tim</author>
<title>Microsoft .NET: The Programming Bible</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-09</publish_date>
<description>Microsoft's .NET initiative is explored in
detail in this deep programmer's reference.</description>
</book>
<book id="bk111">
<author>O'Brien, Tim</author>
<title>MSXML3: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-01</publish_date>
<description>The Microsoft MSXML3 parser is covered in
detail, with attention to XML DOM interfaces, XSLT processing,
SAX and more.</description>
</book>
<book id="bk112">
<author>Galos, Mike</author>
<title>Visual Studio 7: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>49.95</price>
<publish_date>2001-04-16</publish_date>
<description>Microsoft Visual Studio 7 is explored in depth,
looking at how Visual Basic, Visual C++, C#, and ASP+ are
integrated into a comprehensive development
environment.</description>
</book>
</catalog>I found the mistakes I made and I corrected them. The newly revised/corrected code is:
USE OPENXMLtesting1
GO
With XmlFile (Contents) AS (
SELECT CONVERT (XML, BulkColumn)
FROM OPENROWSET (BULK 'C:\Temp\books.xml', SINGLE_BLOB) AS XmlData
SELECT *
FROM XmlFile
GO
It worked: Results
Contents
1 <catalog><book.id="bk101"><author>Gambardella.M...
If I clicked on this, I got a listing of the whole book.xml!! I don't know what it means. Please comment and respond.
Thanks,
Scott Chang -
Ps query results to xml using xml link function registry
In People tools version 8.46 we need something like where the ps query result output is in the form of XML so that it can be used for external system. The catch I cannot use webservices. It is something like opening peoplesoft queires form excel using hyperlink but in this case we need xml. I looked at David Vandiver's Excel XML libraries which open the data in excel but is there something where the hyperlink output is xml using xml link function registry. I have capatured the data in rowset and now need to create mime type of xml to write the data
thanks in advance
vinnIf I understand correctly, you want to use something like Microsoft Excel's web queries to get data from a PeopleSoft query in XML format. I have never done this before, but if I were to implement this, here is what I would do in PT 8.46:
1. Create an unstructured message in app designer.
2. Create a user that only has access to the queries you want to expose to Excel
3. Write synchronous message handler PeopleCode to call SwitchUser to switch to a specific query user rather than the generic integration broker user and execute a query, returning the results in XML (see [Query.RunToRowsest|http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tpcr/htm/tpcr31.htm#d0e113933] for an example).
4. Call the message through IB using the HTTP GET URL format as defined in PeopleBooks: [http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tibr/book.htm?File=tibr/htm/tibr33.htm#H4026|http://download.oracle.com/docs/cd/E13292_01/pt849pbr0/eng/psbooks/tibr/book.htm?File=tibr/htm/tibr33.htm#H4026]. -
TWO ERRO ORA-01427: single-row subquery returns more than one row
Hi,
I have a procedure which contains a cursor. If i run the select statement in the cursor separetly, it returns only value and works fine. But the same select statement in the cursor of a procedure throws me the error as below:
TWO ERRO ORA-01427: single-row subquery returns more than one row
Not sure what going on...any help appreciated.
Below is the select statement:
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN
HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID =
HAPF2.POSITION_DEFINITION_ID
AND
HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID =
PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' ||
PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN
PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN
PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND
HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;
Thanks
PK
Edited by: user539616 on Jun 30, 2009 6:30 PMHi,
The cursor has a different parameter? Maybe the query is not exactly the same. Could you check this?
This is your query (formatted):
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID = HAPF2.POSITION_DEFINITION_ID
AND HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID = PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' || PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;Tips: To put formatted code you must use {noformat}{noformat} tags, start tag and end tag are the same,you don't need to put '/' in the close tag.
Regards, -
Hi ,
i am getting Ora-01427 error when i ran below script . my sub query returns more
than 1 row . please help me in fixing this .
update registrant_address a set a.text_res_address_nbr =
(select c.street_number from registrant_address e , registrant b , z_polk_conv08172005 c
where e.key_registrant = b.key_registrant and b.key_registrant_old = c.registrant_id)
thanks,
KarHi ,
i am getting Ora-01427 error when i ran below script
. my sub query returns more
than 1 row . please help me in fixing this .
update registrant_address a set
a.text_res_address_nbr =
(select c.street_number from registrant_address e ,
registrant b , z_polk_conv08172005 c
where e.key_registrant = b.key_registrant and
b.key_registrant_old = c.registrant_id)
thanks,
Kar
i am getting Ora-01427 error when i ran below script
. my sub query returns more
than 1 row . please help me in fixing this .are you sure that you are getting ORA-01427, because ORA-01422 gives you the message 'Exact fetch returns more than one row' !!
There are different ways to cope up with this issue,
1. If you really don't care about a particular street_number, then go for rownum =1 in the where condition if the select statement.
2. If you care about returning the right value, then probably you need to find out an attribute or a combination of attributes in these three tables used in your select statement that gives you distinct identification for each row.
Hope this helps
Thanks -
ORA-01427 in C# but not in SQL Developer
Hello everyone!
I have a query that works perfectly when executed from SQL Developer. However, executing the same query from C# gives error ORA-01427.
I am using Oracle.DataAccess.dll version 2.111.6.20, which cannot be changed, because the software is distributed and all users would have to install the new driver.
-- part 1
with
mat_stats
as
(select
t1.nr,
t1.ver,
t4.stat,
count( distinct t4.kom_id) as cnt
from
table1 t1,
table2 t2,
table3 t3,
table4 t4
where
t3.spec_spec_id = t2.spec_id
and t1.man_id = t2.man_man_id
and t4.kom_id = t3.kom_kom_id
group by t1.nr, t1.ver, t4.stat
order by t1.nr, t1.ver, t4.stat )
-- part 2
select distinct
nr,
ver,
-- part 2a
(select cnt from mat_stats xres
where xres.nr=nr
and xres.ver=ver
and stat='OK') as ok_cnt,
-- part 2b
(select cnt from mat_stats xres
where xres.nr=nr
and xres.ver=ver
and stat='TOL') as tol_cnt
from mat_stats
The output from part 1 is
"nr" "ver" "stat" "cnt"
1 5 "NOK" 4
1 5 "TOL" 1
And the output of part2 is (SQL Developer)
"nr" "ver" "ok_cnt" "tol_cnt
1 5 "" 1
What am I doing wrong ? Or is this a known bug ?
Cheers,
Chrisnow if the sum is changing the value then I have to ask: are these hitting the same data sources?
let's change the query around a bit and see if you get the same result
try this query
with
mat_stats
as
SELECT 1 NR ,
5 VER ,
'NOK' STAT ,
4 CNT
FROM DUAL
UNION
SELECT 1 NR ,
5 VER ,
'TOL' STAT ,
1 CNT
FROM DUAL
-- part 2
select distinct
nr,
VER,
SUM(CASE STAT WHEN 'OK' THEN CNT ELSE 0 END) OVER() OK_CNT,
SUM(CASE STAT WHEN 'TOL' THEN CNT ELSE 0 END) OVER() tol_cnt
FROM MAT_STATS ;
NR VER OK_CNT TOL_CNT
1 5 0 1 note I just "faked" your data based on your initial results, so you ought to be able to be able to change the with clause back to yours.
Run a full select in C# and look over the result set (fill a datatable and do a row.count then compare to a full select in Developer and see if the row counts are the same. -
Class oracle.xml.sql.query.OracleXMLQuery not found in import
I tried to perform load java using a non-sys user :
loadjava -user user1/passwd -v -o -r Archive.java
but encountered the following error:
Errors in Archive:
ORA-29535: source requires recompilation
Archive:11: Class oracle.xml.sql.query.OracleXMLQuery not found in import.
Info: 1 errors
loadjava: 3 errors
But if I use sys user I don't have any error:
loadjava -user sys/manager -v -o -r Arachive.java
initialization complete
loading : Archive
creating : Archive
resolver :
resolving: Archive
Why is this so?
ANy security setup that I missed?
Thanks in advance.
Note:
my Archive.java file contains:
// Core Java Classes
import java.io.*;
import java.sql.*;
// Oracle Java classes
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.query.OracleXMLQuery;
null<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Azman Diron ([email protected]):
I tried to perform load java using a non-sys user :
loadjava -user user1/passwd -v -o -r Archive.java
but encountered the following error:
Errors in Archive:
ORA-29535: source requires recompilation
Archive:11: Class oracle.xml.sql.query.OracleXMLQuery not found in import.
Info: 1 errors
loadjava: 3 errors
But if I use sys user I don't have any error:
loadjava -user sys/manager -v -o -r Arachive.java
initialization complete
loading : Archive
creating : Archive
resolver :
resolving: Archive
Why is this so?
ANy security setup that I missed?
Thanks in advance.
Note:
my Archive.java file contains:
// Core Java Classes
import java.io.*;
import java.sql.*;
// Oracle Java classes
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.query.OracleXMLQuery;
<HR></BLOCKQUOTE>
Managed to solve this problem.
Drop all xml objects owned by sys and user1.
Reload xml objcets for user1 with -force option.
null -
ORA-01427 while trying INSERT working SQL
Hello,
I have really non-logical problem.
I'm using Oracle 10g.
I have a query that contains some subqueries, it's pretty normal query as milion similar:
SELECT a.field1,
(SELECT b.field2 FROM tab2 b WHERE b.key = a.key) field2
FROM tab1 a
Query works fine, returns expected amount of records but while I'm trying to save it somehow it returns me an error:
ORA-01427:single-row subquery returns more than one row
It would be normal if I'd have it executing SELECT statement. But SELECT works great - error occurs when I'm trying to save the results somehow - INSERT, CREATE TABLE AS or save it to file.
Please, help.
Thanks.hello solomon,
I am using oracle 10g on unix solaris,
when i try this code it will always return this error 'ORA-01427 single-row subquery returns more than one row'
SELECT REPLACE(a.party_key,'NG',''),
party_first_name,
party_last_name,
passport_number,
(SELECT party_type_DESC from party_type b where b.sub_id = a.sub_id),
birth_incorp_date,
is_online_account,
online_service_join_date,
online_login_name,
(select email_address from party_email where party_key = a.party_key),
is_call_center_account,
call_center_service_enrollment,
(select phone_num from party_phone where party_key = a.party_key)
mobile_phone,
a.row_update_date,
name_update_date,
password_update_date,
a.row_update_date,
a.row_update_date
from party a
where sub_id = 'NG';
what i intend to achieve is to extract some columns in party table including party_type_DESC from party_type,email_address from party_email and phone_num from party_phone.
note:
some columns in party table do not have email_address and phone_num.
can i know what i am not doing well in the code.
thanks for your understanding
Regards.
AbdurRahman
Maybe you are looking for
-
How to transfer an iphone's libraries from one pc to another one?
Hi all, I used to synch my 3gs iphone using my laptop (xp window). However, this laptop currently had started having problem with its hard drive so I decided to use another laptop (window 7) for synching my iphone in the future. I really do not want
-
All in one C4580 printer - not connecting via wireless
hi i've purchased this to have a wireless printer but i can only print via the USB port, which isnt much use! i've tried turning off all firewalls but still no luck. My wireless router works fine all round the house but i cannot get the printer to
-
Fast Refresh Materialized view on a 'View'
Hi, I am trying to create a materialized view with Refresh FAST option. This is based on a view. I am getting an error that there is no materialized view log on the table. But we cannot create a materialized view log on a view. Can you please let me
-
Sessions getting created after tablespace is offline
Hi all I am facing a situation where if I make SYSAUX tablespace offline, still session count keeps on increasing. Is that something expected? Thanks
-
Aspect Ratio Sort and Export (File Naming)
When I crop my photos, I sometimes find that some photos work best in the 4x5/8x10 crop and others in a 2x3/4x6 aspect ratio. Issue #1) How can I sort and find all of my images with a specific aspect ratio? When in the Library module and setting up a