Query Returning ORA-19279

I've got an xml file that I'm loading into a view defined as an xmlType. The view name is eachFile with a single column of myType that is defined as an xmlType. The structure of the xml is:
<CASE_BATCH>
<CASE_COUNT>2</CASE_COUNT>
<XML_BATCH_TRANS>1012</XML_BATCH_TRANS>
<XML_BATCH_DATE>02/07/2007 14:46:14</XML_BATCH_DATE>
<CASEDETAIL>
<HEADER>
<CASE_TRANS>1044</CASE_TRANS>
<UPDATE_TYPE>I</UPDATE_TYPE>
<CASE>26968</CASE>
<PERSON_ID>197192</PERSON_ID>
+<NAME>
</NAME>
+<ADDRESS>
</ADDRESS>
+<VITAL_STATS>
</VITAL_STATS>
+<MEDICAL>
</MEDICAL>
+<RESIDENCY>
</RESIDENCY>
+<DESCRIPTION>
</DESCRIPTION>
+<SCHOOL>
</SCHOOL>
<OTHER>
</OTHER>
</HEADER>
<CASEDETAIL>
<HEADER>
<CASE_TRANS>1045</CASE_TRANS>
<UPDATE_TYPE>I</UPDATE_TYPE>
<CASE>26969</CASE>
<PERSON_ID>197193</PERSON_ID>
</<CASE_BATCH>
I've omitted non-essential data, but in general the structure is that within each <CASE_BATCH> tag there is the potential of multiple <CASE_DETAIL> tags, and each <CASE_DETAIL> tag has some data of which the <PERSON_ID> is what I need to retrieve.
I've tried several different approaches to retrieve <PERSON_ID> tag value, but nothing I try works, I either get no rows returned or an ORA-19279. What I'd like to do is open this up in a stored procedure as a cursor so I can loop through the subordinate data in the xml format and do some insertion/modification of relational tables.
Here's what I've tried that seemed to me to be the most promising:
select a.*
from eachFile,
xmltable('/CASE_BATCH'
passing eachfile.mytype
columns
extnum varchar2(30) PATH '/CASE_BATCH/CASEDETAIL/HEADER/PERSON_ID') a
How query an xml-based view knowing that it may return multiple rows?

I do need other columns at that level, but I've gotten that to work simply by adding additional column definitions at that level. I'm trying to do this process incrementally so I can tell when I break things. Now that I've gotten the first level of query to work, I need to do some queries against some of the lower levels. What I had in mind was to use the number retrieved as 'extnum' as a part of the where clause for additional queries. Unfortunately, now I can't get that level to work.
Here's what I've got now:
select B.*
from eachFile,
xmltable('/CASE_BATCH/CASEDETAIL'
passing eachfile.mytype
columns
extnum number PATH '/CASEDETAIL/HEADER/PERSON_ID') A,
xmltable('CASE_BATCH/CASEDETAIL'
passing eachfile.mytype
columns
extnum number PATH '/CASEDETAIL/HEADER/PERSON_ID',
firstName varchar2(30) PATH '/NAME/FIRSTNAME',
middleName varchar2(30) path '/NAME/MIDDLENAME',
lastName varchar2(30) path '/NAME/LASTNAME',
suffix varchar2(30) path '/NAME/SUFFIX') b
where
a.extnum = 214339 AND
a.extnum = b.extnum
This query as written returns the extnum value (The hard-coded value is one retrieved from the previous query that I'm just using to test with) but no name data. I have no doubt this is related to how you specitfy the path in both or either the xmlTable or the column definition, but I don't understand the correct way to specify it, especially when I'm using a comparative value that's at a higher node in the XML than the subordinate nodes data that I need to retrieve.
I've got a whole bunch of this type of query to write at lower and lower nodes in the XML structure, so once I get this one to work, I am (hopefully!) good to go. How can I use a higher node's value to query subordinate node data when there are multiples of the higher node?

Similar Messages

  • Multi-row sub query returns  ORA-00904 :invalid identifier error

    I am creating a report from two tables that I am not joining. I want a single line for every row in table1 that meets a date range. Table2 can contain none or many rows for each recored in table1. I want to get up to two fields from table2.
    I was using a case statement to check if there was data and then an in-line query or subquery. Once again, the idea is to have a single line on the report for each table1 record.
    I get this error with the code below. It seems the nested multi-row subquery can not see the a.cr_mas_cr_no identifier.
    ORA-00904: "a"."cr_mas_cr_no": invalid identifier
    Any help is greatly appreciated,
    Sam
    select
    a.cr_mas_cr_no "CRNO", a.cr_mas_type "TYPE", a.cr_mas_status "CR Status",
    a.cr_mas_date_logged "Logged date", a.CR_REL_REQ_APP_DATE "RTP approved",a.CR_REL_REQ_RTP_DATE "RTP Date",
    a.cr_accepted_date "Complete", a.cr_mas_submitted_by "Requester",
    select doc_user FROM crrm_cr_documents WHERE doc_cr_number =a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'BD' ) "Bus Design",
    (select doc_user FROM crrm_cr_documents WHERE doc_cr_number = a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'TD' ) "Tech Design",
    (select doc_user FROM crrm_cr_documents WHERE doc_cr_number = a.cr_mas_cr_no and rownum = 1 and DOC_TYPE = 'TE' ) "User acceptance test",
    case
    when (select count(appr_user) from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') > 0
    then (select appr_user from (select * from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    end
    "RTP #1",
    case
    when (select count(appr_user) from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') > 1
    then (select appr_user from (select * from crrm_cr_approvals where appr_cr_no = a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 2)
    end
    "RTP #2",
    a.CR_REL_REQ_RTP_BY "Released by",
    a.CR_ACCEPTED_BY "Post RTP User Acceptance",
    a.cr_mas_title "Title", a.cr_mas_id "ID"
    from
    crrm_crmaster a
    where
    (a.CR_REL_REQ_RTP_DATE >= :P1109_BEGDATE and (a.CR_REL_REQ_RTP_DATE <= :P1109_ENDDATE) and
    (a.cr_mas_status = 'Complete' or (a.cr_mas_status = 'Release Approved'and a.CR_REL_REQ_APP_DATE < :P1109_ENDDATE))
    Message was edited by:
    slavanaway

    Iceman,
    Thanks for the reply I will try your suggestion.
    I will try and explain why I think two subqueries (an in-line query with a subquery?) are required. I will use the creation of the column RTP #1 as the example as the RTP #2 column is only different in the rownum selected.
    Looking only at the lines that fail, here is my analysis. (If I rem out the two case lines the query runs, I just don't get two columns of data I need.) I will only examine the first case as the second is changed to extract the second approval via the rownum = 2 criteria. The first statement checks there is at least one RTP approval stored for the request and then gets the user who approved the request if the test is true.
    case when
    (select count(appr_user) from crrm_cr_approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP') > 0
    then
    The above part works fine and the correct count of approvals is returned.
    (select appr_user from (select * from crrm_cr_approvals where appr_cr_no=a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    end
    "RTP #1",
    I moved the parenthesis to the correct location. There can be multiple approvals for a given parent record. Some parent records need one, some need two approvals. If I replace
    (select appr_user from (select * from crrm_cr_approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP') where rownum = 1)
    with
    (select appr_user from approvals where appr_cr_no =a.cr_mas_cr_no and appr_type = 'RTP' and rownum = 1)
    The correct result is returned because it returns exactly one row as rownum=1 limits the query. When rownum = 2 then the query returns null as the rownum never gets to two as the rownum column is built via the set created by the second subquery.
    The subquery builds a set of approvals for a specific "cr_no" and appr_type of "RTP". the outer query then looks at the rownum of the second query
    Here is where I got the rownum information from;
    http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    So here is what I think is happening;
    1. Main query From and Where are processed. This should provide the "set" for the query
    2.The from subqueries for RTP #1 and RTP #2 should be able to access the a.cr_mas_cr_no field and build a set from the approvals table.
    3.The RTP #1/2 subquery (inline maybe a better description?) would then get the correct row from the from subquery.
    The error "invalid identifier" refers to the a.cr_mas_cr_no field. I assume it means it can not resolve the table alias inside the subquery.
    So maybe your grouping would help, I will try.
    Sam

  • Oracle query on dblinked SQL Server tables returns ORA-00904 error

    Hi,
    I have created a dblink to a SQL Server database from Oracle using Generic Connectivity.
    The following query returns ORA-00904 Invalid Identifier error in the WHERE clause (tblEmp.Empno)
    SELECT "EmpNo","EmpName", "DeptName"
    FROM tblEmp@sqlserver,
    tblDept@sqlserver
    WHERE tblDept.DeptNo = tblEmp.Empno
    I had to enclose the column names in double quotes due to case sensitivitiy of the columns, but I can't do the
    same for the WHERE clause.
    1) So, how do I fix this error ?
    2) Also how do I include Deptno column with table alias in the columns list?
    (Deptno is ambiguous in Emp and Dept tables)
    Regards,
    Sam

    Alex
    Because using the aliases all the time can become annoying and lead to disparate standards when used by multiple developers. For a one-off query I would go with aliases in the query but if the linked tables are going to be interrogated extensively I would prefer to create vanilla views of the underlying tables so that the aliases aren't necessary.
    Just my opinion, it feels a bit cleaner to do it this way - you only do the work once in creating the view and then you don't need to worry about the case sensitivity of the linked database. You can also refer to the source in the name of the view so you don't have to think about different source databases with the same table names.
    Cheers
    Ben

  • ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequ

    I have been working with XML files containing only one record. I downloaded instructions to create/insert/select and the statements below work fine for the XML files with one record. Now I have XML files with multiple records/sections, but the select statement returns ORA-19279. How would I change the create/insert/select statements to handle XML files with more than one record? There is still only one vendata section, but there are multiple VendorData sections.
    Thanks.
    1.     Create a table with an XML column:
    create table vendxml_col (
    vend_id number primary key,
    vend_doc XMLType);
    2.     Insert xml document:
    insert into vendxml_col values (1,
    XMLType(bfilename('ING_FEED', 'VenData.xml'),
    nls_charset_id('AL32UTF8')));
    3.     Query the xml columns in vendxml_col:
    select vend_id,
    a.cage, a.repl_cage, a.status, a.company1, a.company2, a.address1, a.address2,
    a.pobox, a.city, a.state, a.zip, a.country, a.phone, a.fax, a.cao, a.adpp,
    a.assoc, a.type, a.affil, a.sizex, a.pri_bus, a.type_bus, a.woman, a.sic,
    a.formerly, a.formerly2, a.comp1key, a.comp2key, a.Revseq, a.Source,
    a.RequestID
    FROM vendxml_col,
    XMLTABLE('/vendata'
    PASSING vendxml_col.vend_doc
    COLUMNS
         cage varchar2(5) PATH '/vendata/VendorData/cage',
         repl_cage varchar2(5) PATH '/vendata/VendorData/repl_cage',
         status varchar2(1) PATH '/vendata/VendorData/status',
         company1 varchar2(30) PATH '/vendata/VendorData/company1',
         company2 varchar2(30) PATH '/vendata/VendorData/company2',
         address1 varchar2(40) PATH '/vendata/VendorData/address1',
         address2 varchar2(40) PATH '/vendata/VendorData/address2',
         pobox varchar2(10) PATH '/vendata/VendorData/pobox',
         city varchar2(30) PATH '/vendata/VendorData/city',
         state varchar2(2) PATH '/vendata/VendorData/state',
         zip varchar2(20) PATH '/vendata/VendorData/zip',
         country varchar2(20) PATH '/vendata/VendorData/country',
         phone varchar2(20) PATH '/vendata/VendorData/phone',
         fax varchar2(20) PATH '/vendata/VendorData/fax',
         cao varchar2(20) PATH '/vendata/VendorData/cao',
         adpp varchar2(20) PATH '/vendata/VendorData/adpp',
         assoc varchar2(20) PATH '/vendata/VendorData/assoc',
         type varchar2(1) PATH '/vendata/VendorData/type',
         affil varchar2(1) PATH '/vendata/VendorData/affil',
         sizex varchar2(1) PATH '/vendata/VendorData/sizex',
         pri_bus varchar2(1) PATH '/vendata/VendorData/pri_bus',
         type_bus varchar2(1) PATH '/vendata/VendorData/type_bus',
         woman varchar2(1) PATH '/vendata/VendorData/woman',
         sic varchar2(4) PATH '/vendata/VendorData/sic',
         formerly varchar2(5) PATH '/vendata/VendorData/formerly',
         formerly2 varchar2(5) PATH '/vendata/VendorData/formerly2',
         comp1key varchar2(30) PATH '/vendata/VendorData/comp1key',
         comp2key varchar2(30) PATH '/vendata/VendorData/comp2key',
         Revseq varchar2(1) PATH '/vendata/VendorData/Revseq',
         Source varchar2(3) PATH '/vendata/VendorData/Source',
         RequestID varchar2(3) PATH '/vendata/VendorData/RequestID'
    ) a
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 9 13:28:00 2011
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>select * from V$VERSION;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    Edited by: user8058903 on Jun 9, 2011 11:28 AM

    Welcome to the XML DB forums.
    As everything in your sample XML is coming from the VendorData node, you can just include that in the XQuery string parm such as shown below. As you didn't include any sample XML, I just built a really simple test case with two VendorData nodes. As the note says, I used WITH to simulate your table/data because I was too lazy to create and populate a table in my playground.
    WITH vendxml_col AS
    (SELECT 1 vend_id,
            XMLTYPE('<vendata><VendorData><cage>c1</cage></VendorData>
            <VendorData><cage>c2</cage></VendorData></vendata>') vend_doc
       FROM dual)
    -- Above WITH used to simulate your table/data.  You only care about below
    SELECT vend_id, a.cage
      FROM vendxml_col,
           XMLTABLE('/vendata/VendorData'
                    PASSING vendxml_col.vend_doc
                    COLUMNS
                    cage    VARCHAR2(5) PATH 'cage') a;
       VEND_ID CAGE
             1 c1
             1 c2

  • ORA-19279 How do I write a query to return the data?

    I have XMLType tables in Oracle 11. I insert XML data from documents and each table only contains one XML document. I can write queries to return outer tags and inner tags but not outer and inner tags in the same result set. There can be one to many InvoiceLineRet tags to each InvoiceRet tag.
    Any and all help is appreciated.
    Mike
    This works and returns RefNumber for the invoice at the InvoiceRet level.
    SELECT
    a.RefNumber
    FROM InvoiceQueryRs xt,
    XMLTable('//InvoiceRet' PASSING xt.OBJECT_VALUE COLUMNS
    RefNumber VARCHAR2(255) PATH 'RefNumber') a;
    This works and returns the two columns from the InvoiceLineRet level.
    SELECT
    b.ILR_ItemRef_FullName,
    b.ILR_Desc
    FROM InvoiceQueryRs xt,
    XMLTable('//InvoiceLineRet' PASSING xt.OBJECT_VALUE COLUMNS
    ILR_ItemRef_FullName VARCHAR2(255) PATH 'ItemRef/FullName',
    ILR_Desc VARCHAR2(2000) PATH 'Desc') b
    But a query like this does not work.
    SELECT
    b.RefNumber,
    b.ILR_ItemRef_FullName,
    b.ILR_Desc
    FROM InvoiceQueryRs xt,
    XMLTable('//InvoiceRet' PASSING xt.OBJECT_VALUE COLUMNS
    RefNumber VARCHAR2(255) PATH 'RefNumber',
    ILR_ItemRef_FullName VARCHAR2(255) PATH 'InvoiceLineRet/ItemRef/FullName',
    ILR_Desc VARCHAR2(2000) PATH 'InvoiceLineRet/Desc') b
    This query returns data but every row has the same RefNumber.
    SELECT
    a.RefNumber,
    b.ILR_ItemRef_ListID,
    b.ILR_ItemRef_FullName,
    b.ILR_Desc
    FROM InvoiceQueryRs xt,
    XMLTable('//InvoiceRet' PASSING xt.OBJECT_VALUE COLUMNS
    RefNumber VARCHAR2(255) PATH 'RefNumber') a,
    XMLTable('//InvoiceLineRet' PASSING xt.OBJECT_VALUE COLUMNS
    ILR_ItemRef_ListID VARCHAR2(255) PATH 'ItemRef/ListID',
    ILR_ItemRef_FullName VARCHAR2(255) PATH 'ItemRef/FullName',
    ILR_Desc VARCHAR2(2000) PATH 'Desc') b
    Example of the XML:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- Created with Liquid XML Studio 1.0.8.0 (http://www.liquid-technologies.com) -->
    <TEST>
         <InvoiceRet>
              <TxnID>D924-1210085400</TxnID>
              <TimeCreated>2008-05-06T10:50:00-05:00</TimeCreated>
              <TimeModified>2008-07-21T10:54:42-05:00</TimeModified>
              <EditSequence>1215638595</EditSequence>
              <TxnNumber>10398</TxnNumber>
              <CustomerRef>
                   <ListID>80000278-1209483158</ListID>
                   <FullName>Majestic Entries</FullName>
              </CustomerRef>
              <ARAccountRef>
                   <ListID>80000009-1185470478</ListID>
                   <FullName>Accounts Receivable</FullName>
              </ARAccountRef>
              <TemplateRef>
                   <ListID>80000019-1190228214</ListID>
                   <FullName>Compudoc</FullName>
              </TemplateRef>
              <TxnDate>2008-05-06</TxnDate>
              <RefNumber>22333</RefNumber>
              <BillAddress>
                   <Addr1>Majetic Entries</Addr1>
              </BillAddress>
              <BillAddressBlock>
                   <Addr1>Majetic Entries</Addr1>
              </BillAddressBlock>
              <IsPending>false</IsPending>
              <IsFinanceCharge>false</IsFinanceCharge>
              <DueDate>2008-05-06</DueDate>
              <ShipDate>2008-05-06</ShipDate>
              <Subtotal>391.50</Subtotal>
              <ItemSalesTaxRef>
                   <ListID>8000004F-1185996977</ListID>
                   <FullName>NC 7.25%</FullName>
              </ItemSalesTaxRef>
              <SalesTaxPercentage>7.25</SalesTaxPercentage>
              <SalesTaxTotal>5.73</SalesTaxTotal>
              <AppliedAmount>-397.23</AppliedAmount>
              <BalanceRemaining>0.00</BalanceRemaining>
              <IsPaid>true</IsPaid>
              <IsToBePrinted>false</IsToBePrinted>
              <IsToBeEmailed>false</IsToBeEmailed>
              <CustomerSalesTaxCodeRef>
                   <ListID>80000001-1185469345</ListID>
                   <FullName>Tax</FullName>
              </CustomerSalesTaxCodeRef>
              <InvoiceLineRet>
                   <TxnLineID>D926-1210085400</TxnLineID>
                   <ItemRef>
                        <ListID>80000059-1199714336</ListID>
                        <FullName>Labor:Non-Contract Labor Ken</FullName>
                   </ItemRef>
                   <Desc>Technical Labor performed by Ken Allen:
    Network Problem with Internet and intranet found two routers connected together and the one set for DHCP was bad we changed out their bad one with our small netgear router.</Desc>
                   <Quantity>1.5</Quantity>
                   <Rate>125.00</Rate>
                   <ClassRef>
                        <ListID>8000000D-1200208143</ListID>
                        <FullName>KA</FullName>
                   </ClassRef>
                   <Amount>187.50</Amount>
                   <ServiceDate>2008-04-28</ServiceDate>
                   <SalesTaxCodeRef>
                        <ListID>80000002-1185469345</ListID>
                        <FullName>Non</FullName>
                   </SalesTaxCodeRef>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>D927-1210085400</TxnLineID>
                   <ItemRef>
                        <ListID>80000029-1185470511</ListID>
                        <FullName>Labor:Non-Contract Labor Rick</FullName>
                   </ItemRef>
                   <Desc>Technical Labor performed by Rick Wagoner: Assisted with above troubleshooting</Desc>
                   <Quantity>1</Quantity>
                   <Rate>125.00</Rate>
                   <ClassRef>
                        <ListID>80000004-1185998300</ListID>
                        <FullName>RW</FullName>
                   </ClassRef>
                   <Amount>125.00</Amount>
                   <ServiceDate>2008-04-28</ServiceDate>
                   <SalesTaxCodeRef>
                        <ListID>80000002-1185469345</ListID>
                        <FullName>Non</FullName>
                   </SalesTaxCodeRef>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>D928-1210085400</TxnLineID>
                   <ItemRef>
                        <ListID>80000050-1185997340</ListID>
                        <FullName>Parts and Supplies</FullName>
                   </ItemRef>
                   <Desc>Parts and Supplies: Netgear router</Desc>
                   <Quantity>1</Quantity>
                   <Rate>79.00</Rate>
                   <ClassRef>
                        <ListID>80000007-1186694551</ListID>
                        <FullName>Parts</FullName>
                   </ClassRef>
                   <Amount>79.00</Amount>
                   <SalesTaxCodeRef>
                        <ListID>80000001-1185469345</ListID>
                        <FullName>Tax</FullName>
                   </SalesTaxCodeRef>
              </InvoiceLineRet>
         </InvoiceRet>
         <InvoiceRet>
              <TxnID>ED59-1216758177</TxnID>
              <TimeCreated>2008-07-22T16:22:57-05:00</TimeCreated>
              <TimeModified>2008-07-26T11:21:48-05:00</TimeModified>
              <EditSequence>1217085708</EditSequence>
              <TxnNumber>11203</TxnNumber>
              <CustomerRef>
                   <ListID>80000278-1209483158</ListID>
                   <FullName>Majestic Entries</FullName>
              </CustomerRef>
              <ARAccountRef>
                   <ListID>80000009-1185470478</ListID>
                   <FullName>Accounts Receivable</FullName>
              </ARAccountRef>
              <TemplateRef>
                   <ListID>80000019-1190228214</ListID>
                   <FullName>Compudoc</FullName>
              </TemplateRef>
              <TxnDate>2008-07-22</TxnDate>
              <RefNumber>22479</RefNumber>
              <BillAddress>
                   <Addr1>Majetic Entries</Addr1>
              </BillAddress>
              <BillAddressBlock>
                   <Addr1>Majetic Entries</Addr1>
              </BillAddressBlock>
              <IsPending>false</IsPending>
              <IsFinanceCharge>false</IsFinanceCharge>
              <DueDate>2008-07-22</DueDate>
              <ShipDate>2008-07-22</ShipDate>
              <Subtotal>839.00</Subtotal>
              <ItemSalesTaxRef>
                   <ListID>8000004F-1185996977</ListID>
                   <FullName>NC 7.25%</FullName>
              </ItemSalesTaxRef>
              <SalesTaxPercentage>7.25</SalesTaxPercentage>
              <SalesTaxTotal>33.64</SalesTaxTotal>
              <AppliedAmount>0.00</AppliedAmount>
              <BalanceRemaining>872.64</BalanceRemaining>
              <IsPaid>false</IsPaid>
              <IsToBePrinted>true</IsToBePrinted>
              <IsToBeEmailed>false</IsToBeEmailed>
              <CustomerSalesTaxCodeRef>
                   <ListID>80000001-1185469345</ListID>
                   <FullName>Tax</FullName>
              </CustomerSalesTaxCodeRef>
              <InvoiceLineRet>
                   <TxnLineID>ED5B-1216758177</TxnLineID>
                   <ItemRef>
                        <ListID>80000050-1185997340</ListID>
                        <FullName>Parts and Supplies</FullName>
                   </ItemRef>
                   <Desc>Parts and Supplies - Linksys Router</Desc>
                   <Quantity>1</Quantity>
                   <Rate>89.00</Rate>
                   <Amount>89.00</Amount>
                   <SalesTaxCodeRef>
                        <ListID>80000001-1185469345</ListID>
                        <FullName>Tax</FullName>
                   </SalesTaxCodeRef>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED5C-1216758177</TxnLineID>
                   <Desc>Suspect that the phone switch is attempting to act as a DHCP server for the network. per Terry, the reason that the phone switch was on the network was to supply VOIP to the warehouse phone lines. This was not working and is no longer needed. We removed the connection between the phone switch and the network.</Desc>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED5D-1216758177</TxnLineID>
                   <Desc>Removed the Netgear router and the D-Link router. The D-Link had lost all settings and we could not log into the Netgear even after resetting to factory defaults.</Desc>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED5E-1216758177</TxnLineID>
                   <Desc>Installed a new Lnksys router to replace the D-Link and Netgear faulty routers.</Desc>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED5F-1216758177</TxnLineID>
                   <Desc>Ensured that all computers were connecting properly. Ensured that all computers printed to the Savin printer correctly.</Desc>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED60-1216758177</TxnLineID>
                   <Desc>Worked with Time Warner Cable to resolve customer location and static IP.</Desc>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED64-1216758177</TxnLineID>
                   <ItemRef>
                        <ListID>80000028-1185470511</ListID>
                        <FullName>Labor:Non-Contract Labor Kareem</FullName>
                   </ItemRef>
                   <Desc>Analyzed and resolved Internet connectivity problems after loss of service from Time Warner Cable.</Desc>
                   <Quantity>3</Quantity>
                   <Rate>125.00</Rate>
                   <Amount>375.00</Amount>
                   <ServiceDate>2008-07-22</ServiceDate>
                   <SalesTaxCodeRef>
                        <ListID>80000002-1185469345</ListID>
                        <FullName>Non</FullName>
                   </SalesTaxCodeRef>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED68-1216758177</TxnLineID>
                   <ItemRef>
                        <ListID>8000005D-1216758445</ListID>
                        <FullName>Labor:Non-Contract Labor Mike</FullName>
                   </ItemRef>
                   <Desc>Analyzed and resolved Internet connectivity problems after loss of service from Time Warner Cable.</Desc>
                   <Quantity>3</Quantity>
                   <Rate>125.00</Rate>
                   <Amount>375.00</Amount>
                   <ServiceDate>2008-07-22</ServiceDate>
                   <SalesTaxCodeRef>
                        <ListID>80000001-1185469345</ListID>
                        <FullName>Tax</FullName>
                   </SalesTaxCodeRef>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED94-1216758177</TxnLineID>
                   <Desc>Terry called, cannot connect to internet. Everyone but Terry can connect. Terry is getting a 172 IP address on his laptop. Walked him through putting a static IP on his laptop so that he could be functional. I went to their site and talked with the NEC phone switch management company. They said the switch does not have DHCP capabilities. I could not duplicate Terry's issue using my laptop. The phone switch is now totally disconnected from the network since the VOIP setup for the warehouse was not functional. Validated that the TWC modem is not DHCP.</Desc>
                   <ServiceDate>2008-07-23</ServiceDate>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>ED95-1216758177</TxnLineID>
                   <Desc>Requires further diagnostics on Friday the 25th (if Terry is available) - need his laptop on-site to diagnose the problem.</Desc>
              </InvoiceLineRet>
              <InvoiceLineRet>
                   <TxnLineID>EE30-1216758177</TxnLineID>
                   <Desc>Communicated with Terry on 7/24/2008 via email. He is using DHCP and connecting correctly. Removing the final connection from the phone switch to the network appears to have corrected the problem.</Desc>
                   <ServiceDate>2008-07-24</ServiceDate>
              </InvoiceLineRet>
         </InvoiceRet>
    </TEST>

    Never mind. I figured it out.

  • ORA-19279: Query dynamic type mismatch: expected singleton sequence

    Hi,
    I have my xml stored in the table 'xml_table’
    The content of XML is a follows:
    <COMPANY NAME="ABC">
    <DEPARTMENT_NAME>Paris</DEPARTMENT_NAME>
    <ADDRESS>Rue de nevers</ADDRESS>
    <DEPARTMENT_NAME>London</DEPARTMENT_NAME>
    <ADDRESS>Northampton Square</ADDRESS>
    </COMPANY>
    I would like to query the xml to get the output like that:
    COMPANY_NAME | DEPARTMENT_NAME | ADDRESS
    ABC | Paris | rue de nevers
    ABC | London | Northampton Square
    However when I execute the query:
    SELECT t.company_name, t.address, t.department_name
    FROM xml_table p,
    XMLTable('/COMPANY' PASSING p.OBJECT_VALUE
    COLUMNS company_name PATH '@NAME',
    address VARCHAR2(100) PATH '/COMPANY/ADDRESS',
    department_name VARCHAR2(100) PATH '/COMPANY/DEPARTMENT_NAME') t
    I am getting error:
    ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
    What can be wrong with the query? Howe should it be modified to get desired output?
    Thank for help
    Groxy

    As was mentioned... Enclosing the tags for each department in a DEPARTMENT tag would make this easier and more effiecient but here's an alternative approach if modifying the XML is not an option
    SQL> with COMPANY_XML as
      2  (
      3    select XMLTYPE(
      4  '<COMPANY NAME="ABC">
      5     <DEPARTMENT_NAME>Paris</DEPARTMENT_NAME>
      6     <ADDRESS>Rue de nevers</ADDRESS>
      7     <DEPARTMENT_NAME>London</DEPARTMENT_NAME>
      8     <ADDRESS>Northampton Square</ADDRESS>
      9  </COMPANY>') as OBJECT_VALUE from dual
    10  )
    11  select R.*
    12    from COMPANY_XML,
    13         XMLTABLE
    14         (
    15            'for $COMP in $COMPANY/COMPANY
    16               for $DEPT at $DEPTIDX in $COMP/DEPARTMENT_NAME
    17                 return <RESULT>
    18                         <NAME>{fn:data($COMP/@NAME)}</NAME>
    19                         {
    20                           $COMP/DEPARTMENT_NAME[$DEPTIDX],
    21                           $COMP/ADDRESS[$DEPTIDX]
    22                         }
    23                       </RESULT>'
    24            passing OBJECT_VALUE as "COMPANY"
    25        ) r
    26  /
    COLUMN_VALUE
    <RESULT><NAME>ABC</NAME><DEPARTMENT_NAME>Paris</DEPARTMENT_NAME><ADDRESS>Rue de
    nevers</ADDRESS></RESULT>
    <RESULT><NAME>ABC</NAME><DEPARTMENT_NAME>London</DEPARTMENT_NAME><ADDRESS>Northa
    mpton Square</ADDRESS></RESULT>This above step creates a document for all tags with a particular index and then we can apply a columns cause to get the results..
    SQL>   with COMPANY_XML as
      2  (
      3    select XMLTYPE(
      4  '<COMPANY NAME="ABC">
      5     <DEPARTMENT_NAME>Paris</DEPARTMENT_NAME>
      6     <ADDRESS>Rue de nevers</ADDRESS>
      7     <DEPARTMENT_NAME>London</DEPARTMENT_NAME>
      8     <ADDRESS>Northampton Square</ADDRESS>
      9  </COMPANY>') as OBJECT_VALUE from dual
    10  )
    11  select R.*
    12    from COMPANY_XML,
    13         XMLTABLE
    14         (
    15            'for $COMP in $COMPANY/COMPANY
    16               for $DEPT at $DEPTIDX in $COMP/DEPARTMENT_NAME
    17                 return <RESULT>
    18                         <NAME>{fn:data($COMP/@NAME)}</NAME>
    19                         {
    20                           $COMP/DEPARTMENT_NAME[$DEPTIDX],
    21                           $COMP/ADDRESS[$DEPTIDX]
    22                         }
    23                       </RESULT>'
    24            passing OBJECT_VALUE as "COMPANY"
    25            columns
    26            NAME            VARCHAR(10),
    27            DEPARTMENT_NAME VARCHAR2(24),
    28            ADDRESS         VARCHAR2(24)
    29        ) r
    30  /
    NAME       DEPARTMENT_NAME          ADDRESS
    ABC        Paris                    Rue de nevers
    ABC        London                   Northampton Square
    SQL>

  • A In-line view query works with 8.1.6 but returns ORA-1008 with 8.1.7

    Hello Gurus,
    The following query works fine with 8.1.6 but returns
    ORA-1008: not all variables bound
    with 8.1.7.
    Here is the query:
    SELECT y.node_id , y.parent_node_id
    FROM ( SELECT x.node_id
    ,x.parent_node_id
    FROM ( SELECT a.node_id
    ,a.parent_node_id
    FROM xor_hs_base_details a
    WHERE a.node_id <>
    a.parent_node_id
    AND a.base_id=1
    ) x
    CONNECT BY PRIOR x.node_id =
    x.parent_node_id
    START WITH x.parent_node_id = 1
    ) y
    WHERE y.node_id IN ( SELECT node_id
    FROM xor_hs_transactions
    WHERE hierarchy_id = 1
    AND created_by
    = 'system'
    AND committed_on IS NULL
    Any ideas??
    TIA.
    ...Atul

    After having a closer look at metalink it seems to be obvious, that Forms 6i (8.0.6.) only supports user exits generated with the 8.0.6. precompiler.
    If this is the case new questions follow:
    Is there a way to get a 8.0.6. precompiler?
    Is it possible to connect to a 8.1.5. database with such a user exit? Does anybody have corresponding experiences?
    Our customer uses a 8.1.7. database. What about connecting to that database with the user exit?
    /Ralph

  • 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

  • How can I fix a xquery resulting error ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence  - got multi-item sequence

    Hello,
    How can I improve the XQuery below in order to obtain a minimised return to escape from both errors ORA-19279 and ORA-01706?
    XQUERY for $book in  fn:collection("oradb:/HR/TB_XML")//article let $cont := $book/bdy  where  $cont   [ora:contains(text(), "(near((The,power,Love),10, TRUE))") > 0] return $book
    ERROR:
    ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence
    - got multi-item sequence
    XQUERY for $book in  fn:collection("oradb:/HR/TB_XML")//article let $cont := $book/bdy  where  $cont   [ora:contains(., "(near((The,power,Love),10, TRUE))") > 0] return $book//bdy
    /*ERROR:
    ORA-01706: user function result value was too large
    Regards,
    Daiane

    below query works for 1 iteration . but for multiple sets i am getting following error .
    When you want to present repeating groups in relational format, you have to extract the sequence of items in the main XQuery expression.
    Each item is then passed to the COLUMNS clause to be further shredded into columns.
    This should work as expected :
    select x.*
    from abc t
       , xmltable(
           xmlnamespaces(
             default 'urn:swift:xsd:fin.970.2011'
           , 'urn:swift:xsd:mtmsg.2011' as "ns0"
         , '/ns0:FinMessage/ns0:Block4/Document/MT970/F61a/F61'
           passing t.col1
           columns F61ValueDate                Varchar(40) Path 'ValueDate'
                 , DebitCreditMark             Varchar(40) Path 'DebitCreditMark'
                 , Amount                      Varchar(40) Path 'Amount'
                 , TransactionType             Varchar(40) Path 'TransactionType'
                 , IdentificationCode          Varchar(40) Path 'IdentificationCode'                 
                 , ReferenceForTheAccountOwner Varchar(40) Path 'ReferenceForTheAccountOwner'
                 , SupplementaryDetails        Varchar(40) Path 'SupplementaryDetails'       
         ) x ;

  • ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence

    Hi ,
    I executed the below query in database version 11.2.0.3.0, it throws the error like "ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence"
    with PAYMENT_XML as (
          select XMLTYPE(
            '<Document>
            <pain.002.001.02>
                <GrpHdr>
                      <MsgId>CITIBANK/20091204-PSR/4274</MsgId>
                      <CreDtTm>2009-12-04T09:36:00</CreDtTm>
               </GrpHdr>
                <OrgnlGrpInfAndSts>
                <OrgnlMsgId>10002</OrgnlMsgId>
                <OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
                <OrgnlNbOfTxs>20</OrgnlNbOfTxs>
                <OrgnlCtrlSum>7000</OrgnlCtrlSum>
                <GrpSts>PART</GrpSts>
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                </StsRsnInf>
              </OrgnlGrpInfAndSts>
              <OrgnlGrpInfAndSts>
                <OrgnlMsgId>10001</OrgnlMsgId>
                <OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
                <OrgnlNbOfTxs>202</OrgnlNbOfTxs>
                <OrgnlCtrlSum>9000</OrgnlCtrlSum>
                <GrpSts>PART</GrpSts>
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                  <AddtlStsRsnInf>Formated</AddtlStsRsnInf>
                </StsRsnInf>
              </OrgnlGrpInfAndSts>
          </pain.002.001.02>
      </Document>') as OBJECT_VALUE1
       from dual
      select R.*
      from PAYMENT_XML,
           XMLTABLE(
           'for $COMP in $COMPANY/Document/pain.002.001.02
              for $DEPT at $DEPTIDX in $COMP/OrgnlGrpInfAndSts
               return <RESULT>
                        <NAME>{fn:data($COMP/GrpHdr/MsgId)}</NAME>
                          $DEPT/OrgnlMsgId,
                          $DEPT/OrgnlNbOfTxs,
                          $DEPT/OrgnlCtrlSum,
                          $DEPT/GrpSts,
                          $DEPT/StsRsnInf/AddtlStsRsnInf
                      </RESULT>'
           passing OBJECT_VALUE1 as "COMPANY"
           columns
             NAME            VARCHAR(10)  path 'NAME',
             OrgnlMsgId      VARCHAR2(24) path 'OrgnlMsgId',
             ORGNLNBOFTXS    VARCHAR2(24) path 'OrgnlNbOfTxs',
             ORGNLCTRLSUM    NUMBER       path 'OrgnlCtrlSum',
             GRPSTS          VARCHAR2(24) path 'GrpSts',
             ADDTLSTSRSNINF  VARCHAR2(40) path 'AddtlStsRsnInf'
         ) r
    Errors comes this part :
                <StsRsnInf>
                  <AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
                  <AddtlStsRsnInf>Formated</AddtlStsRsnInf>
                </StsRsnInf>
    if i put the single statement for this xml element <AddtlStsRsnInf> it works fine if more than one element comes it raised the error.
    i want the output like the below format : want to merge the element value with (, comma)  delimiter with single coloumn value
    NAME
    ORGNLMSGID
    ORGNLNBOFTXS
    ORGNLCTRLSUM
    GRPSTS
    ADDTLSTSRSNINF
    CITIBANK/2
    10002
    20
    7,000
    PART
    ACK - FILE PARTIALLY SUCCESSFUL
    CITIBANK/2
    10001
    202
    9,000
    PART
    ACK - FILE PARTIALLY SUCCESSFUL, Formated
    Thanks is advance for reply
    Thanks,
    Chidam

    Try with XQuery string-join() function :
    ADDTLSTSRSNINF  VARCHAR2(40) path 'string-join(AddtlStsRsnInf, ", ")'

  • How to overcome ORA-19279 error

    Hi,
    I have oracle 11.2.2 and following xml is loaded in xmltype table and trying to retrive data and getting following error, please anyone could help me to fix this error
    <?xml version="1.0" encoding="utf-8"?>
    <agents count="1382">
    <agent>
    <name>Nancy Palmer</name>
    <email>[email protected]</email>
    <agentid>MLSL:00525350</agentid>
    <officeid>58</officeid>
    <website>http://www.nancypalmer.com</website>
    <photo>https://sites.e-agents.com/Uploads/68/41/6841/Agents/agent_8418_NANCY_PALMER_COLOR_HEAD_SHOT_HIGH_QUALITY_2011.jpg</photo>
    <phone_direct>6504344313</phone_direct>
    <phone_cell>6504920200</phone_cell>
    <mod_time>2012-08-31T05:15:06.933</mod_time>
    </agent>
    <agent>
    <name>Genella Williamson</name>
    <email>[email protected]</email>
    <agentid>MLSL:00755754</agentid>
    <officeid>58</officeid>
    <website>http://www.apr.com/genella</website>
    <photo>https://sites.e-agents.com/Uploads/68/41/6841/Agents/agent_8426_genella.jpg</photo>
    <phone_direct>6504344319</phone_direct>
    <phone_cell>6507870839</phone_cell>
    <mod_time>2010-10-30T15:15:07.603</mod_time>
    </agent>
    <agent>
    <name>Diana Langley</name>
    <email>[email protected]</email>
    <agentid>MLSL:01256202,SFAR:805608</agentid>
    <officeid>50</officeid>
    <website>http://www.apr.com/DLangley</website>
    <photo>https://sites.e-agents.com/Uploads/68/41/6841/Agents/agent_7848_dlangley.jpg</photo>
    <phone_direct/>
    <phone_cell/>
    <mod_time>2011-06-06T05:15:06.587</mod_time>
    </agent>
    </agents>
    query usered to reterive data
    SELECT count, NAME, email,
           officeid, website,
           photo, phone_direct,
           phone_cell, mod_date
      FROM TEMP_XML tx,
           XMLTable('/agents'
                    PASSING tx.xml_data 
                    columns count        varchar2(30) path '@count',
                            NAME         VARCHAR2(100) path 'agent/name',
                             email        VARCHAR2(100) path 'agent/email',
                             officeid     VARCHAR2(100) path 'agent/officeid',
                             website      VARCHAR2(100) path 'agent/website',
                             photo        VARCHAR2(100) path 'agent/photo',
                             phone_direct      VARCHAR2(100) path 'agent/phone_direct',
                             phone_cell      VARCHAR2(100) path 'agent/phone_cell',
                             mod_date      VARCHAR2(100) path 'agent/mod_date'
    recieved error
    ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
    19279. 00000 -  "XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence"
    *Cause:    The XQuery sequence passed in had more than one item.
    *Action:   Correct the XQuery expression to return a single item sequence.Thanks in advance
    Best Regards,

    use
    SELECT count,
           NAME,
           email,
           officeid,
           website,
           photo,
           phone_direct,
           phone_cell,
           mod_date
      FROM TEMP_XML tx,
           XMLTable('agents' PASSING tx.xml_data
                    columns count varchar2(30) path '@count',
                    xml_part xmltype path '*') x,
           XMLTable('agent' PASSING x.xml_part
                    columns NAME VARCHAR2(100) path 'name',
                    email VARCHAR2(100) path 'email',
                    officeid VARCHAR2(100) path 'officeid',
                    website VARCHAR2(100) path 'website',
                    photo VARCHAR2(100) path 'photo',
                    phone_direct VARCHAR2(100) path 'phone_direct',
                    phone_cell VARCHAR2(100) path 'phone_cell',
                    mod_date VARCHAR2(100) path 'mod_date') y

  • ORA-19279 error extracting one-to-many sequence

    I have an xml table built from a registered schema that I'm trying to extract data from using a view. The lowest level is a polygon with multiple vertices -- vertices number, latitude, and longitude. The xml file lists data as
    POLYGON
    SEQ_NUM
    LAT
    LON
    SEQ_NUM
    LAT
    LON
    SEQ_NUM
    LAT
    LON
    /POLYGON
    The method I use to extract the data returns an ORA-19279 error: "XQuery dymanic type mismatch: expected singleton sequence - got multi-item sequence." The error is pointing to the polygon data; however the polygon sequence tag in the xsd file has the attribute of maxOccurs="unbounded".
    Below is the xsd file, a samlpe xml file and the Select statement I use.
    ABC.xsd file:
    &lt;?xml version="1.0"?&gt;
    &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" attributeFormDefault="unqualified"&gt;
    &lt;xs:element name="A_B_C"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="A"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="B"&gt;
    &lt;xs:simpleType&gt;
    &lt;xs:restriction base="xs:string"&gt;
    &lt;xs:enumeration value="1A"/&gt;
    &lt;xs:enumeration value="1B"/&gt;
    &lt;xs:enumeration value="2A"/&gt;
    &lt;xs:enumeration value="2B"/&gt;
    &lt;xs:enumeration value="2C"/&gt;
    &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
    &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:choice&gt;
    &lt;xs:element name="D" maxOccurs="unbounded"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="D_ID" type="xs:string"&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="D_UQ_ID" type="xs:string"&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="D_TIME"&gt;
    &lt;xs:simpleType&gt;
    &lt;xs:restriction base="xs:string"/&gt;
    &lt;/xs:simpleType&gt;
    &lt;/xs:element&gt;
    &lt;xs:choice&gt;
    &lt;xs:element name="F"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="F_TYPE" type="xs:string"&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="F_SUBTYPE" type="xs:string"&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="G" minOccurs="0"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:choice&gt;
    &lt;xs:element name="H"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="H_TYPE" type="xs:string" minOccurs="0"&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="H_MODE" type="xs:string" minOccurs="0"&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="H_SHAPE" minOccurs="0"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:choice&gt;
    &lt;xs:element name="POLYGON"&gt;
    &lt;xs:complexType&gt;
    {color:#ff0000}*&lt;xs:sequence maxOccurs="unbounded"&gt;*{color}
    &lt;xs:element name="SEQ_NUM" type="xs:unsignedInt"&gt;
    &lt;xs:annotation&gt;
    &lt;xs:documentation&gt;sequence number in the polygon&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="LAT" type="xs:float"/&gt;
    &lt;xs:element name="LON" type="xs:float"/&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="CIRCLE"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="LAT" type="xs:float"/&gt;
    &lt;xs:element name="LON" type="xs:float"/&gt;
    &lt;xs:element name="RAD" type="xs:float"/&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="ELLIPSE"&gt;
    &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
    &lt;xs:element name="ORIENT"&gt;
    &lt;xs:simpleType&gt;
    &lt;xs:restriction base="xs:float"&gt;
    &lt;xs:minInclusive value="0"/&gt;
    &lt;xs:maxInclusive value="360"/&gt;
    &lt;/xs:restriction&gt;
    &lt;/xs:simpleType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="MAJ_AX" type="xs:float"&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="MIN_AX" type="xs:float"&gt;
    &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;/xs:choice&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;/xs:choice&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="E"&gt;
    &lt;xs:complexType/&gt;
    &lt;/xs:element&gt;
    &lt;/xs:choice&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="C"&gt;
    &lt;/xs:element&gt;
    &lt;/xs:choice&gt;
    &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;/xs:schema&gt;
    abc.xml file:
    &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;A_B_C&gt;
    &lt;A&gt;
    &lt;B&gt;1B&lt;/B&gt;
    &lt;/A&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0001&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0001&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 11:11:11.11&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;G&gt;
    &lt;H&gt;
    &lt;H_TYPE&gt;Ipod&lt;/H_TYPE&gt;
    &lt;H_MODE&gt;SCANNING&lt;/H_MODE&gt;
    &lt;H_SHAPE&gt;
    &lt;POLYGON&gt;
    &lt;SEQ_NUM&gt;1&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;10.1&lt;/LAT&gt;
    &lt;LON&gt;11.1&lt;/LON&gt;
    &lt;SEQ_NUM&gt;2&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;20.2&lt;/LAT&gt;
    &lt;LON&gt;22.2&lt;/LON&gt;
    &lt;SEQ_NUM&gt;3&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;30.3&lt;/LAT&gt;
    &lt;LON&gt;33.3&lt;/LON&gt;
    &lt;SEQ_NUM&gt;4&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;40.4&lt;/LAT&gt;
    &lt;LON&gt;44.4&lt;/LON&gt;
    &lt;/POLYGON&gt;
    &lt;CIRCLE&gt;
    &lt;LAT&gt;12.3&lt;/LAT&gt;
    &lt;LON&gt;45.6&lt;/LON&gt;
    &lt;RAD&gt;78.9&lt;/RAD&gt;
    &lt;/CIRCLE&gt;
    &lt;ELLIPSE&gt;
    &lt;ORIENT&gt;99.90&lt;/ORIENT&gt;
    &lt;MAJ_AX&gt;111.10&lt;/MAJ_AX&gt;
    &lt;MIN_AX&gt;222.20&lt;/MIN_AX&gt;
    &lt;/ELLIPSE&gt;
    &lt;/H_SHAPE&gt;
    &lt;/H&gt;
    &lt;/G&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0002&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0002&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 22:22:22.22&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;G&gt;
    &lt;H&gt;
    &lt;H_TYPE&gt;Ipod&lt;/H_TYPE&gt;
    &lt;H_MODE&gt;SCANNING&lt;/H_MODE&gt;
    &lt;H_SHAPE&gt;
    &lt;POLYGON&gt;
    &lt;SEQ_NUM&gt;1&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;10.1&lt;/LAT&gt;
    &lt;LON&gt;11.1&lt;/LON&gt;
    &lt;SEQ_NUM&gt;2&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;20.2&lt;/LAT&gt;
    &lt;LON&gt;22.2&lt;/LON&gt;
    &lt;SEQ_NUM&gt;3&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;30.3&lt;/LAT&gt;
    &lt;LON&gt;33.3&lt;/LON&gt;
    &lt;SEQ_NUM&gt;4&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;40.4&lt;/LAT&gt;
    &lt;LON&gt;44.4&lt;/LON&gt;
    &lt;/POLYGON&gt;
    &lt;CIRCLE&gt;
    &lt;LAT&gt;12.3&lt;/LAT&gt;
    &lt;LON&gt;45.6&lt;/LON&gt;
    &lt;RAD&gt;78.9&lt;/RAD&gt;
    &lt;/CIRCLE&gt;
    &lt;ELLIPSE&gt;
    &lt;ORIENT&gt;99.90&lt;/ORIENT&gt;
    &lt;MAJ_AX&gt;111.10&lt;/MAJ_AX&gt;
    &lt;MIN_AX&gt;222.20&lt;/MIN_AX&gt;
    &lt;/ELLIPSE&gt;
    &lt;/H_SHAPE&gt;
    &lt;/H&gt;
    &lt;/G&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0003&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0003&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 33:33:33.33&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;G&gt;
    &lt;H&gt;
    &lt;H_TYPE&gt;Ipod&lt;/H_TYPE&gt;
    &lt;H_MODE&gt;SCANNING&lt;/H_MODE&gt;
    &lt;/H&gt;
    &lt;/G&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0004&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0004&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 44:44:44.44&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;G&gt;
    &lt;H&gt;
    &lt;H_TYPE&gt;Ipod&lt;/H_TYPE&gt;
    &lt;H_MODE&gt;SCANNING&lt;/H_MODE&gt;
    &lt;H_SHAPE&gt;
    &lt;POLYGON&gt;
    &lt;SEQ_NUM&gt;1&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;10.1&lt;/LAT&gt;
    &lt;LON&gt;11.1&lt;/LON&gt;
    &lt;SEQ_NUM&gt;2&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;20.2&lt;/LAT&gt;
    &lt;LON&gt;22.2&lt;/LON&gt;
    &lt;SEQ_NUM&gt;3&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;30.3&lt;/LAT&gt;
    &lt;LON&gt;33.3&lt;/LON&gt;
    &lt;SEQ_NUM&gt;4&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;40.4&lt;/LAT&gt;
    &lt;LON&gt;44.4&lt;/LON&gt;
    &lt;/POLYGON&gt;
    &lt;CIRCLE&gt;
    &lt;LAT&gt;12.3&lt;/LAT&gt;
    &lt;LON&gt;45.6&lt;/LON&gt;
    &lt;RAD&gt;78.9&lt;/RAD&gt;
    &lt;/CIRCLE&gt;
    &lt;ELLIPSE&gt;
    &lt;ORIENT&gt;99.90&lt;/ORIENT&gt;
    &lt;MAJ_AX&gt;111.10&lt;/MAJ_AX&gt;
    &lt;MIN_AX&gt;222.20&lt;/MIN_AX&gt;
    &lt;/ELLIPSE&gt;
    &lt;/H_SHAPE&gt;
    &lt;/H&gt;
    &lt;/G&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0005&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0005&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 55:55:55.55&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0006&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0006&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 66:66:66.66&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;G&gt;
    &lt;H&gt;
    &lt;H_TYPE&gt;Ipod&lt;/H_TYPE&gt;
    &lt;H_MODE&gt;SCANNING&lt;/H_MODE&gt;
    &lt;H_SHAPE&gt;
    &lt;POLYGON&gt;
    &lt;SEQ_NUM&gt;1&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;10.1&lt;/LAT&gt;
    &lt;LON&gt;11.1&lt;/LON&gt;
    &lt;SEQ_NUM&gt;2&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;20.2&lt;/LAT&gt;
    &lt;LON&gt;22.2&lt;/LON&gt;
    &lt;SEQ_NUM&gt;3&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;30.3&lt;/LAT&gt;
    &lt;LON&gt;33.3&lt;/LON&gt;
    &lt;SEQ_NUM&gt;4&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;40.4&lt;/LAT&gt;
    &lt;LON&gt;44.4&lt;/LON&gt;
    &lt;/POLYGON&gt;
    &lt;CIRCLE&gt;
    &lt;LAT&gt;12.3&lt;/LAT&gt;
    &lt;LON&gt;45.6&lt;/LON&gt;
    &lt;RAD&gt;78.9&lt;/RAD&gt;
    &lt;/CIRCLE&gt;
    &lt;ELLIPSE&gt;
    &lt;ORIENT&gt;99.90&lt;/ORIENT&gt;
    &lt;MAJ_AX&gt;111.10&lt;/MAJ_AX&gt;
    &lt;MIN_AX&gt;222.20&lt;/MIN_AX&gt;
    &lt;/ELLIPSE&gt;
    &lt;/H_SHAPE&gt;
    &lt;/H&gt;
    &lt;/G&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0007&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0007&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 77:77:77.77&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;G&gt;
    &lt;H&gt;
    &lt;H_TYPE&gt;Ipod&lt;/H_TYPE&gt;
    &lt;H_MODE&gt;SCANNING&lt;/H_MODE&gt;
    &lt;/H&gt;
    &lt;/G&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;D&gt;
    &lt;D_ID&gt;D_0008&lt;/D_ID&gt;
    &lt;D_UQ_ID&gt;UQ_D_0008&lt;/D_UQ_ID&gt;
    &lt;D_TIME&gt;2007 FEB 88:88:88.88&lt;/D_TIME&gt;
    &lt;F&gt;
    &lt;F_TYPE&gt;F_TYPE_TEST&lt;/F_TYPE&gt;
    &lt;F_SUBTYPE&gt;SUB_TEST&lt;/F_SUBTYPE&gt;
    &lt;G&gt;
    &lt;H&gt;
    &lt;H_TYPE&gt;Ipod&lt;/H_TYPE&gt;
    &lt;H_MODE&gt;SCANNING&lt;/H_MODE&gt;
    &lt;H_SHAPE&gt;
    &lt;POLYGON&gt;
    &lt;SEQ_NUM&gt;1&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;10.1&lt;/LAT&gt;
    &lt;LON&gt;11.1&lt;/LON&gt;
    &lt;SEQ_NUM&gt;2&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;20.2&lt;/LAT&gt;
    &lt;LON&gt;22.2&lt;/LON&gt;
    &lt;SEQ_NUM&gt;3&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;30.3&lt;/LAT&gt;
    &lt;LON&gt;33.3&lt;/LON&gt;
    &lt;SEQ_NUM&gt;4&lt;/SEQ_NUM&gt;
    &lt;LAT&gt;40.4&lt;/LAT&gt;
    &lt;LON&gt;44.4&lt;/LON&gt;
    &lt;/POLYGON&gt;
    &lt;CIRCLE&gt;
    &lt;LAT&gt;12.3&lt;/LAT&gt;
    &lt;LON&gt;45.6&lt;/LON&gt;
    &lt;RAD&gt;78.9&lt;/RAD&gt;
    &lt;/CIRCLE&gt;
    &lt;ELLIPSE&gt;
    &lt;ORIENT&gt;88.80&lt;/ORIENT&gt;
    &lt;MAJ_AX&gt;111.10&lt;/MAJ_AX&gt;
    &lt;MIN_AX&gt;222.20&lt;/MIN_AX&gt;
    &lt;/ELLIPSE&gt;
    &lt;/H_SHAPE&gt;
    &lt;/H&gt;
    &lt;/G&gt;
    &lt;/F&gt;
    &lt;E&gt;&lt;/E&gt;
    &lt;/D&gt;
    &lt;C&gt;TPS Report 4&lt;/C&gt;
    &lt;/A_B_C&gt;
    SELECT statement:
    SELECT a_level.a_class
    , d_level.D_UQ_ID
    , d_level.D_TIME
    , h_level.SEQ_NUM
    , h_level.LAT
    , h_level.LON
    FROM ABC_XML,
    XMLTABLE('/A_B_C'
    PASSING ABC_XML.ABC_SPEC
    COLUMNS
    A_CLASS VARCHAR2(4000 BYTE) PATH '/A_B_C/A/B'
    , D XMLTYPE PATH 'D'
    ) a_level,
    XMLTABLE ('/D'
    PASSING a_level.D
    COLUMNS
    D_UQ_ID varchar2(4000) PATH 'D_UQ_ID'
    , D_TIME varchar2(4000) PATH 'D_TIME'
    , POLYGON XMLTYPE PATH 'F/G/H/H_SHAPE/POLYGON'
    ) d_level
    XMLTABLE('/POLYGON'
    passing d_level.POLYGON
    COLUMNS
    SEQ_NUM NUMBER PATH 'SEQ_NUM'
    , LAT NUMBER PATH 'LAT)'
    , LON NUMBER PATH 'LON'
    ) h_level;
    As you see I need to return data from three levels of data (a, d and h). I can remark out the bottom level (h_level) and the statement runs returning 8 rows from the xml file above (which is correct). The h_level XMLTABLE reference returns the ORA-19279 error. The full statement should return 20 rows of data.

    Yes. I looked at that string.
    Never mind on this one. You helped solve the problem in another string
    XMLTable 'For $i in ... return ROW' clause help needed

  • Query help - ORA-01403

    Hello,
    I have a query region which is returning ORA-01403. I've looked online for help and found that the error occurs when you do a SELECT INTO and nothing is returned.
    The query works if I don't do a SELECT INTO -- just a regular select outside of a PL/SQL program works. What am I doing wrong?
    select count(*) INTO TOTAL_COUNT
    from tbl_items, lookup_items, lookup_headings
    where tbl_items.item_id = lookup_items.item_id
    and lookup_items.heading_id = lookup_headings.heading_id
    and tbl_items.sector_id = htmldb_util.get_session_state('SL_SECTOR')
    and lookup_items.heading_id = 1
    and lookup_headings.section_id = htmldb_util.get_session_state('SL_SECTION');
    Thanks,
    Nora

    Nora,
    You don't need your INTO.
    If all you want to do is create a report region which displays the result of your query (and in this case, the count of the rows between your joined tables), the reporting engine of Application Express will automagically take your query, describe your select clause, and format it for you in your report.
    You would use INTO if you wanted to stuff the result into some variable. But you don't want to do that in this case.
    Joel

  • The Query returns a JBO Sql Exeptions of Invalid number

    Here is the query which returns the Invalid number exception on a R12 environment -
    SELECT feb.entity_id,
    rel.parent_entity_id,
    fetl.entity_name,
    pfetl.entity_name parent_entity_name,
    ccytl.currency_code,
    ccytl.name AS currency_name,
    fettl.entity_type_name,
    fettl.entity_type_code,
    rel.cons_relationship_id,
    decode( fettl.entity_type_code,
    'E', to_number(''),
    decode( operassoc.parent_entity_id,
    to_number(''), rel.ownership_percent,
    to_number(''))) ownership_percent,
    ttl.treatment_name,
    cttl.curr_treatment_name,
    decode( fettl.entity_type_code,
    'O', 'Y',
    'X', 'Y',
    decode( rel.cons_relationship_id,
    '', 'Y',
    'N')) AS details_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'O', decode(feb.entity_id,
    operassoc.child_entity_id, 'N',
    'Y'),
    'Y') AS add_entity_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'C', decode( rel.cons_relationship_id,
    '', 'N',
    'Y'),
    decode( operassoc.parent_entity_id,
    '', 'Y',
    'N')) AS move_remove_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'C', decode( rel.cons_relationship_id,
    '', decode( childassoc.child_entity_id,
    '', 'N',
    'Y'),
    'Y'),
    decode( operassoc.parent_entity_id,
    '', 'Y',
    'N')) AS create_update_icon_displayed,
    decode( fettl.entity_type_code,
    'E', 'N',
    'C', decode( rel.cons_relationship_id,
    '', 'N',
    'Y'),
    decode( operassoc.parent_entity_id,
    '', 'Y',
    'N')) AS update_update_icon_displayed,
    imageattr.entity_image,
    decode(imageattr.entity_image, '', 'N', 'Y') entity_image_displayed,
    rel.end_date,
    decode(rel.cons_relationship_id, :0, 'Y', 'N') blue_dot_displayed,
    decode(operassoc.parent_entity_id, '', 'Ownership', 'ParentText') ownership_switcher
    FROM FEM_ENTITIES_B feb,
    FEM_ENTITIES_TL fetl,
    FEM_ENTITIES_TL pfetl,
    GCS_ENTITY_CONS_ATTRS eca,
    FND_CURRENCIES_TL ccytl,
    FEM_ENTITIES_ATTR fetea,
    FEM_DIM_ATTRIBUTES_B fetda,
    FEM_DIM_ATTR_VERSIONS_B fet_dav,
    FEM_ENTITY_TYPES_TL fettl,
    GCS_CONS_RELATIONSHIPS rel,
    GCS_TREATMENTS_TL ttl,
    GCS_CURR_TREATMENTS_TL cttl,
    (SELECT operea.entity_id AS parent_entity_id,
    operea.dim_attribute_numeric_member AS child_entity_id
    FROM FEM_ENTITIES_ATTR operea,
    FEM_DIM_ATTRIBUTES_B operda,
    FEM_DIM_ATTR_VERSIONS_B oper_dav
    WHERE operda.attribute_varchar_label = 'OPERATING_ENTITY'
    AND operda.attribute_id = operea.attribute_id
    AND oper_dav.attribute_id = operda.attribute_id
    AND oper_dav.default_version_flag = 'Y'
    AND oper_dav.version_id = operea.version_id) operassoc,
    (SELECT operea.entity_id AS parent_entity_id,
    operea.dim_attribute_numeric_member AS child_entity_id
    FROM FEM_ENTITIES_ATTR operea,
    FEM_DIM_ATTRIBUTES_B operda,
    FEM_DIM_ATTR_VERSIONS_B oper_dav
    WHERE operda.attribute_varchar_label = 'OPERATING_ENTITY'
    AND operda.attribute_id = operea.attribute_id
    AND oper_dav.attribute_id = operda.attribute_id
    AND oper_dav.default_version_flag = 'Y'
    AND oper_dav.version_id = operea.version_id) childassoc,
    (SELECT imageea.entity_id,
    imageea.varchar_assign_value AS entity_image
    FROM FEM_ENTITIES_ATTR imageea,
    FEM_DIM_ATTRIBUTES_B imageda,
    FEM_DIM_ATTR_VERSIONS_B image_dav
    WHERE imageda.attribute_varchar_label = 'IMAGE_NAME'
    AND imageda.attribute_id = imageea.attribute_id
    AND image_dav.attribute_id = imageda.attribute_id
    AND image_dav.default_version_flag = 'Y'
    AND image_dav.version_id = imageea.version_id) imageattr
    WHERE feb.entity_id = fetl.entity_id
    AND fetl.language = userenv('LANG')
    AND eca.entity_id (+)= feb.entity_id
    AND eca.hierarchy_id (+)= :1
    AND ccytl.currency_code (+)= eca.currency_code
    AND ccytl.language (+)= userenv('LANG')
    AND fetea.entity_id = feb.entity_id
    AND fetea.attribute_id = fetda.attribute_id
    AND fetda.attribute_varchar_label = 'ENTITY_TYPE_CODE'
    AND fet_dav.attribute_id = fetda.attribute_id
    AND fet_dav.default_version_flag = 'Y'
    AND fet_dav.version_id = fetea.version_id
    AND fettl.entity_type_code = fetea.dim_attribute_varchar_member
    AND fettl.language = userenv('LANG')
    AND rel.child_entity_id (+)= feb.entity_id
    AND rel.hierarchy_id (+)= :2
    AND rel.actual_ownership_flag (+)= 'Y'
    AND pfetl.entity_id (+)= rel.parent_entity_id
    AND pfetl.language (+)= userenv('LANG')
    AND ttl.treatment_id (+)= rel.treatment_id
    AND ttl.language (+)= userenv('LANG')
    AND cttl.curr_treatment_id (+)= rel.curr_treatment_id
    AND cttl.language (+)= userenv('LANG')
    AND operassoc.child_entity_id (+)= rel.child_entity_id
    AND operassoc.parent_entity_id (+)= rel.parent_entity_id
    AND childassoc.parent_entity_id (+)= feb.entity_id
    AND imageattr.entity_id (+)= feb.entity_id
    AND (rel.start_date IS NULL OR rel.start_date <= nvl(:3, rel.start_date))
    AND (rel.end_date IS NULL OR rel.end_date >= nvl(:4, rel.end_date))
    ORDER BY decode( operassoc.parent_entity_id,
    '', decode( entity_type_code,
    'O', 2,
    'C', 3,
    'E', 4,
    999),
    1),
    entity_name
    Same query returns correct results in 11i environment.
    This query fails at the executeQueryForCollection method.
    Any ideas why?
    Thanks - Alpi
    Edited by: user581082 on Sep 17, 2009 1:16 AM

    Here is the full Error Stack -
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT     feb.entity_id,
         rel.parent_entity_id,
         fetl.entity_name,
         pfetl.entity_name parent_entity_name,
         ccytl.currency_code,
         ccytl.name AS currency_name,
         fettl.entity_type_name,
         fettl.entity_type_code,
         rel.cons_relationship_id,
         decode(     fettl.entity_type_code,
              'E', to_number(''),
              decode(     operassoc.parent_entity_id,
                   to_number(''), rel.ownership_percent,
                   to_number(''))) ownership_percent,
         ttl.treatment_name,
         cttl.curr_treatment_name,
         decode(     fettl.entity_type_code,
              'O', 'Y',
              'X', 'Y',
              decode(     rel.cons_relationship_id,
                   '', 'Y',
                   'N')) AS details_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'O', decode(feb.entity_id,
    operassoc.child_entity_id, 'N',
    'Y'),
              'Y') AS add_entity_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'C', decode(     rel.cons_relationship_id,
                        '', 'N',
                        'Y'),
              decode(     operassoc.parent_entity_id,
                   '', 'Y',
                   'N')) AS move_remove_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'C', decode(     rel.cons_relationship_id,
                        '', decode(     childassoc.child_entity_id,
                                  '', 'N',
                                  'Y'),
                        'Y'),
              decode(     operassoc.parent_entity_id,
                   '', 'Y',
                   'N')) AS create_update_icon_displayed,
         decode(     fettl.entity_type_code,
              'E', 'N',
              'C', decode(     rel.cons_relationship_id,
                        '', 'N',
                        'Y'),
              decode(     operassoc.parent_entity_id,
                   '', 'Y',
                   'N')) AS update_update_icon_displayed,
         imageattr.entity_image,
         decode(imageattr.entity_image, '', 'N', 'Y') entity_image_displayed,
         rel.end_date,
         decode(rel.cons_relationship_id, :0, 'Y', 'N') blue_dot_displayed,
         decode(operassoc.parent_entity_id, '', 'Ownership', 'ParentText') ownership_switcher
    FROM     FEM_ENTITIES_B feb,
         FEM_ENTITIES_TL fetl,
         FEM_ENTITIES_TL pfetl,
         GCS_ENTITY_CONS_ATTRS eca,
         FND_CURRENCIES_TL ccytl,
         FEM_ENTITIES_ATTR fetea,
         FEM_DIM_ATTRIBUTES_B fetda,
         FEM_DIM_ATTR_VERSIONS_B fet_dav,
         FEM_ENTITY_TYPES_TL fettl,
         GCS_CONS_RELATIONSHIPS rel,
         GCS_TREATMENTS_TL ttl,
         GCS_CURR_TREATMENTS_TL cttl,
         (SELECT     operea.entity_id AS parent_entity_id,
              operea.dim_attribute_numeric_member AS child_entity_id
         FROM     FEM_ENTITIES_ATTR operea,
              FEM_DIM_ATTRIBUTES_B operda,
              FEM_DIM_ATTR_VERSIONS_B oper_dav
         WHERE     operda.attribute_varchar_label = 'OPERATING_ENTITY'
         AND     operda.attribute_id = operea.attribute_id
         AND     oper_dav.attribute_id = operda.attribute_id
         AND     oper_dav.default_version_flag = 'Y'
         AND     oper_dav.version_id = operea.version_id) operassoc,
         (SELECT     operea.entity_id AS parent_entity_id,
              operea.dim_attribute_numeric_member AS child_entity_id
         FROM     FEM_ENTITIES_ATTR operea,
              FEM_DIM_ATTRIBUTES_B operda,
              FEM_DIM_ATTR_VERSIONS_B oper_dav
         WHERE     operda.attribute_varchar_label = 'OPERATING_ENTITY'
         AND     operda.attribute_id = operea.attribute_id
         AND     oper_dav.attribute_id = operda.attribute_id
         AND     oper_dav.default_version_flag = 'Y'
         AND     oper_dav.version_id = operea.version_id) childassoc,
         (SELECT     imageea.entity_id,
              imageea.varchar_assign_value AS entity_image
         FROM     FEM_ENTITIES_ATTR imageea,
              FEM_DIM_ATTRIBUTES_B imageda,
              FEM_DIM_ATTR_VERSIONS_B image_dav
         WHERE     imageda.attribute_varchar_label = 'IMAGE_NAME'
         AND     imageda.attribute_id = imageea.attribute_id
         AND     image_dav.attribute_id = imageda.attribute_id
         AND     image_dav.default_version_flag = 'Y'
         AND     image_dav.version_id = imageea.version_id) imageattr
    WHERE     feb.entity_id = fetl.entity_id
    AND     fetl.language = userenv('LANG')
    AND     eca.entity_id (+)= feb.entity_id
    AND     eca.hierarchy_id (+)= :1
    AND     ccytl.currency_code (+)= eca.currency_code
    AND     ccytl.language (+)= userenv('LANG')
    AND     fetea.entity_id = feb.entity_id
    AND     fetea.attribute_id = fetda.attribute_id
    AND     fetda.attribute_varchar_label = 'ENTITY_TYPE_CODE'
    AND     fet_dav.attribute_id = fetda.attribute_id
    AND     fet_dav.default_version_flag = 'Y'
    AND     fet_dav.version_id = fetea.version_id
    AND     fettl.entity_type_code = fetea.dim_attribute_varchar_member
    AND     fettl.language = userenv('LANG')
    AND     rel.child_entity_id (+)= feb.entity_id
    AND     rel.hierarchy_id (+)= :2
    AND rel.actual_ownership_flag (+)= 'Y'
    AND     pfetl.entity_id (+)= rel.parent_entity_id
    AND     pfetl.language (+)= userenv('LANG')
    AND     ttl.treatment_id (+)= rel.treatment_id
    AND     ttl.language (+)= userenv('LANG')
    AND     cttl.curr_treatment_id (+)= rel.curr_treatment_id
    AND     cttl.language (+)= userenv('LANG')
    AND     operassoc.child_entity_id (+)= rel.child_entity_id
    AND     operassoc.parent_entity_id (+)= rel.parent_entity_id
    AND     childassoc.parent_entity_id (+)= feb.entity_id
    AND     imageattr.entity_id (+)= feb.entity_id
    AND     (rel.start_date IS NULL OR rel.start_date <= nvl(:3, rel.start_date))
    AND     (rel.end_date IS NULL OR rel.end_date >= nvl(:4, rel.end_date))
    ORDER BY     decode(     operassoc.parent_entity_id,
                   '', decode(     entity_type_code,
                             'O', 2,
                             'C', 3,
                             'E', 4,
                             999),
                   1),
              entity_name) QRSLT WHERE PARENT_ENTITY_ID = :6
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:896)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2845)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
         at OA.jspService(_OA.java:212)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:797)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01722: invalid number
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1062)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:857)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4511)
         at oracle.apps.gcs.setup.hierarchy.server.EntitiesVOImpl.executeQueryForCollection(EntitiesVOImpl.java:106)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.activateRowSetState(ViewRowSetImpl.java:4925)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3792)
         at oracle.jbo.server.ViewRowSetImpl.activateIteratorState(ViewRowSetImpl.java:4960)
         at oracle.jbo.server.OAJboViewObjectImpl.activateInternalRowSets(Unknown Source)
         at oracle.jbo.server.OAJboApplicationModuleImpl.activateState(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateState(OAApplicationModuleImpl.java:3066)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateState(ApplicationModuleImpl.java:7053)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateAMState(ApplicationModuleImpl.java:6961)
         at oracle.jbo.server.Serializer.activate(Serializer.java:274)
         at oracle.jbo.server.DBSerializer.activateRootAM(DBSerializer.java:330)
         at oracle.jbo.server.ApplicationModuleImpl.activateFromStack(ApplicationModuleImpl.java:5768)
         at oracle.jbo.server.ApplicationModuleImpl.activateState(ApplicationModuleImpl.java:5628)
         at oracle.jbo.server.ApplicationModuleImpl.activateStateForUndo(ApplicationModuleImpl.java:7697)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateStateForUndo(OAApplicationModuleImpl.java:2159)
         at oracle.apps.gcs.setup.hierarchy.server.HierarchyAMImpl.activateStateForUndo(HierarchyAMImpl.java:10364)
         at oracle.apps.gcs.setup.hierarchy.webui.HierUploadCO.processFormRequest(HierUploadCO.java:89)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2841)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
         at OA.jspService(_OA.java:212)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:797)
    java.sql.SQLException: ORA-01722: invalid number
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:966)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1062)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:857)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4511)
         at oracle.apps.gcs.setup.hierarchy.server.EntitiesVOImpl.executeQueryForCollection(EntitiesVOImpl.java:106)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.activateRowSetState(ViewRowSetImpl.java:4925)
         at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3792)
         at oracle.jbo.server.ViewRowSetImpl.activateIteratorState(ViewRowSetImpl.java:4960)
         at oracle.jbo.server.OAJboViewObjectImpl.activateInternalRowSets(Unknown Source)
         at oracle.jbo.server.OAJboApplicationModuleImpl.activateState(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateState(OAApplicationModuleImpl.java:3066)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateState(ApplicationModuleImpl.java:7053)
         at oracle.jbo.server.ApplicationModuleImpl.doActivateAMState(ApplicationModuleImpl.java:6961)
         at oracle.jbo.server.Serializer.activate(Serializer.java:274)
         at oracle.jbo.server.DBSerializer.activateRootAM(DBSerializer.java:330)
         at oracle.jbo.server.ApplicationModuleImpl.activateFromStack(ApplicationModuleImpl.java:5768)
         at oracle.jbo.server.ApplicationModuleImpl.activateState(ApplicationModuleImpl.java:5628)
         at oracle.jbo.server.ApplicationModuleImpl.activateStateForUndo(ApplicationModuleImpl.java:7697)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.activateStateForUndo(OAApplicationModuleImpl.java:2159)
         at oracle.apps.gcs.setup.hierarchy.server.HierarchyAMImpl.activateStateForUndo(HierarchyAMImpl.java:10364)
         at oracle.apps.gcs.setup.hierarchy.webui.HierUploadCO.processFormRequest(HierUploadCO.java:89)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2841)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1835)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:533)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:421)
         at OA.jspService(_OA.java:212)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:335)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:797)

  • How to find out which sub query returns more than one row

    Hi all,
    Can any one give me clue ,how to find out which sub query returns more than one row in the following query .
    /* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */
    SELECT a.*, ROWNUM AS rnm
      FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org",
                            prxm.mbr_idntfr AS "Beneficiary ID",
                               md.last_name
                            || ', '
                            || md.first_name AS "Beneficiary Name",
                            pci.idntfr AS "Tracking No.",
                            TO_CHAR (TRUNC (req.pa_rqst_date),
                                     'MM/dd/yyyy'
                                    ) AS "Request Date",
                            sts.status_name AS "Status",
                            req.pa_rqst_sid AS "Request #",
                            prxm.mbr_sid AS "Mbr_sid",
                            TO_CHAR
                                  (TRUNC (req.pa_revision_date),
                                   'MM/dd/yyyy'
                                  ) AS "Last Updated",
                            TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE",
                            prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID",
                            pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View",
                            DECODE
                               ((SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                0, (SELECT prxplo.prvdr_lctn_idntfr
                                      FROM pa_request_x_provider_location prxplo
                                     WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                       AND prxplo.oprtnl_flag = 'A'
                                       AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT prxplo.prvdr_lctn_idntfr
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "NPI/ID",
                            DECODE
                               ((SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT    pd.last_name
                                              || ', '
                                              || pd.first_name
                                              || ' '
                                              || pd.middle_name
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "Prvdr Name",
                            TO_CHAR (psd.from_date,
                                     'MM/dd/yyyy'
                                    ) AS "Srvc From Date",
                            TO_CHAR (req.validity_start_date,
                                     'MM/DD/YYYY'
                                    ) AS "Due Date",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>Left",
                            req.pa_mode_type_lkpcd AS "Source",
                            TO_CHAR (TRUNC (wmdtl.rtng_date),
                                     'MM/dd/yyyy'
                                    ) AS "Assigned On",
                            NVL (wmdtl.assigned_to_user_name,
                                 'Not Assigned'
                                ) AS "Assigned To",
                            req.org_unit_sid AS "OrgUnitSid",
                            TO_CHAR
                                 (wmdtl.modified_date,
                                  'MM/dd/yyyy hh24:mi:ss'
                                 ) AS "WTRD_MODIFIED_DATE",
                            TO_CHAR (wmdtl.rtng_date,
                                     'MM/dd/yyyy'
                                    ) AS "WTRD_RTNG_DATE",
                            req.status_cid AS "PA_STATUS_CID",
                            TO_CHAR (req.modified_date,
                                     'MM/dd/yyyy'
                                    ) AS "PA_REQ_MODIFIED_DATE",
                            prs.state_pa_srvc_type_code
                                                     AS "STATE_PA_SRVC_TYPE_CODE",
                            wmdtl.wm_pa_task_rtng_dtl_sid
                                                        AS "WM_TASK_RTNG_DTL_SID",
                            wmdtl.assigned_to_user_acct_sid
                                              AS "WTRD_Assigned_to_user_acct_sid",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>LeftSort",
                            wmdtl.assigned_to_org_unit_sid
                                                  AS "WTRD_Assigned_to_OrgUntSid",
                            DECODE
                               ((SELECT COUNT (*)
                                   FROM pa_request_status prs
                                  WHERE prs.pa_rqst_sid = req.pa_rqst_sid
                                    AND prs.status_cid = 5
                                    AND prs.oprtnl_flag = 'I'),
                                0, 'N',
                                'Y'
                               ) AS "SHOW_UTILIZATION"
                       FROM   pa_request req,
                             pa_certification_identifier pci,
                             status sts,
                             pa_request_x_member prxm,
                             wm_pa_task_routing_detail wmdtl,
                             pa_service_date psd,
                             org_unit ou,
                             pa_request_service prs,
                             pa_request_x_provider_location prxpl,
                             provider_location pl,
                             provider_detail pd,
                             provider p,
                             mbr_dmgrphc md
                      WHERE req.oprtnl_flag = 'A'
                        AND req.status_cid NOT IN
                                     (20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101)
                        AND req.org_unit_sid IN
                               (3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145,
                                3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149,
                                3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153,
                                3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157,
                                3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161,
                                3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165,
                                3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169,
                                3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173,
                                3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177,
                                3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181,
                                3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185,
                                3101, 3186, 3102, 3187, 3103, 3003, 75000104,
                                75000108, 2006, 75000103, 75000102, 75000113,
                                75000111, 75000109, 2001, 2009, 75000105,
                                75000107, 2004, 2010, 2013, 2014, 2005, 2011,
                                75000112, 2002, 1001, 2012, 75000106, 2007,
                                75000101, 2003, 75000110, 2008, 3001, 3002, 3019,
                                3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023,
                                3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027,
                                3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031,
                                3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035,
                                3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039,
                                3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043,
                                3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047,
                                3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051,
                                3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055,
                                3140, 3056, 3141)
                        AND req.pa_rqst_sid = prs.pa_rqst_sid
                        AND prs.oprtnl_flag = 'A'
                        AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid
                        AND psd.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = pci.pa_rqst_sid
                        AND pci.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxm.pa_rqst_sid
                        AND prxm.oprtnl_flag = 'A'
                        AND md.oprtnl_flag = 'A'
                        AND md.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE
                        AND prxm.mbr_sid = md.mbr_sid
                        AND ou.org_unit_sid = req.org_unit_sid
                        AND ou.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND pci.pa_rqst_sid = prxm.pa_rqst_sid
                        AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid
                        AND pci.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxpl.pa_prvdr_type_lkpcd = 'RR'
                        AND prxpl.oprtnl_flag = 'A'
                        AND req.status_cid = sts.status_cid
                        AND sts.status_type_cid = 3
                        AND sts.oprtnl_flag = 'A'
                        AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid
                        AND p.prvdr_sid = pd.prvdr_sid
                        AND p.prvdr_sid = pl.prvdr_sid
                        AND pd.oprtnl_flag = 'A'
                        AND pd.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE
                        AND wmdtl.subsystem_task_sid = req.pa_rqst_sid
                        AND wmdtl.subsystem_lkpcd = 'PA'
                        AND wmdtl.oprtnl_flag = 'A'
                        AND req.pa_rqst_date > (SYSDATE - 365)
                                       ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC,
                            "Beneficiary Name" ASC) a
    WHERE ROWNUM < 102;regards,
    P Prakash
    Edited by: BluShadow on 17-May-2011 15:01
    added {noformat}{noformat} tags around the code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    833560 wrote:
    Can any one give me clue ,how to find out which sub query returns more than one row in the following query .This is why smaller, simpler queries are easier to work with than huge ones - when something like this goes wrong smaller queries are much eaiser to debug. Unfortunately using smaller, easier-to-work with queries is not always an option
    Ganesh is right - you will have to dissect the big query bit by bit until you find the offending subquery. If there is another way I would like to find out about it too.
    The easiest way to do this is probably to use block comments to isolate parts of the query bit by bit until you find the offending part. If you carefully examine the subqueries you might be able to figure out which one is returning multiple rows without commenting everything
    Good luck!

Maybe you are looking for

  • Playback/screen problem

    When playing back ALL of my videos (iTunes purchased, such as "Boundin"; home movies exported to ipod using QT7; DVD's exported to H264 using Handbrake), there is a 'break' in the picture about 2-3 mm fron the top of the screen. This 'break' in the p

  • How do I set up Safari to my default e-mail client?

    How do I set up Safari to my default e-mail client?

  • Help with XI Pro

    I recently boughtbthe Student version of XI pro. I downloaded it and received files. I can not figure out how to use it in order to access files to make changes, Edits Etc.. Please help Frustrated!!

  • Camera RAW pixel artifact issue

    This is something that has been bothering me for a while and I don't understand how other people don't see it.. Mainly due to the fact that you need to be zoomed in about 300% or more on an image to see it. I have only seen Lightroom 3 rendered jpeg

  • Will an Airpot Express Help my Connection?

    I have a Verizon FiOS Router that handles only up to G I believe. I pay for 50/25Mbps and get those speeds when wired, but I do not have any wired computers in my home. The router is behind my TV and usually has my Macbook Air, iPhone, a second home