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>

Similar Messages

  • 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, ", ")'

  • 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

  • XQuery dynamic type mismatch

    Hi all, I am new to xmldb and XQuery. Having trouble with relational xmltable quering... Any help is appriciated.
    I want the following output
    id info loc
    4 stuff2 1
    5 stuff3 1
    6 stuff1 1
    7 stuff4 2
    etc....
    The problem if feel is loc does not have a relation to transaction in the data. But I get an error "XQuery dynamic type mismatch"....
    I have created a basic example below:
    SELECT a.*
    FROM "testTable",
    XMLTABLE('/root/org/transaction'
    PASSING testTable.column
    COLUMNS
    id varchar2(2) PATH '@id',
    info varchar2(50) PATH '/info',
    loc varchar2(2) PATH '@loc'
    ) a
    <root>
    <org loc="1">
    <Transaction id="4"><info>stuff2</info></Transaction>
    <Transaction id="5"><info>stuff3</info></Transaction>
    <Transaction id="6"><info>stuff1</info></Transaction>
    </org>
    <org loc="2">
    <Transaction id="7"><info>stuff4</info></Transaction>
    <Transaction id="8"><info>stuff5</info></Transaction>
    </org>
    <org loc="3">
    <Transaction id="9"><info>stuff6</info></Transaction>
    <Transaction id="10"><info>stuff7</info></Transaction>
    </org>
    </root>
    Thanks again for any help.
    Edited by: user8820504 on Jan 14, 2010 2:27 PM

    You need two distinct tables, one that maps Transactions and one that maps Orgs. Then join them on id. Something like this:
    SQL> with testTable as (
      2  select xmltype('<root>
      3  <org loc="1">
      4  <Transaction id="4"><info>stuff2</info></Transaction>
      5  <Transaction id="5"><info>stuff3</info></Transaction>
      6  <Transaction id="6"><info>stuff1</info></Transaction>
      7  </org>
      8  <org loc="2">
      9  <Transaction id="7"><info>stuff4</info></Transaction>
    10  <Transaction id="8"><info>stuff5</info></Transaction>
    11  </org>
    12  <org loc="3">
    13  <Transaction id="9"><info>stuff6</info></Transaction>
    14  <Transaction id="10"><info>stuff7</info></Transaction>
    15  </org>
    16  </root>') doc
    17  from dual)
    18  SELECT id, info, loc
    19  FROM testTable,
    20       XMLTABLE('/root/org/Transaction'
    21       PASSING testTable.doc
    22       COLUMNS
    23       id varchar2(2) PATH '@id',
    24       info varchar2(50) PATH 'info',
    25       tr xmltype PATH '.'
    26        ) trans ,
    27       XMLTABLE('/root/org'
    28       PASSING testTable.doc
    29       COLUMNS
    30       loc varchar2(2) PATH '@loc',
    31       trs xmltype PATH 'Transaction'
    32        ) orgs
    33  where extractValue(orgs.trs,'/Transaction[@id="'||id||'"]/@id') is not null ;
    ID INFO                                               LO
    4  stuff2                                             1
    5  stuff3                                             1
    6  stuff1                                             1
    7  stuff4                                             2
    8  stuff5                                             2
    9  stuff6                                             3
    10 stuff7                                             3
    Selezionate 7 righe.Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/10/crittografia-in-plsql-utilizzando-dbms_crypto/]

  • 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

  • Ora-00932 inconsistent data type expected date got number

    Hi all,
    I have got an error ora-00932 inconsistent data type expected date got number in the below part of query.
    NVL (TRUNC (wdj.date_completed), '14-NOV-2012')
    BETWEEN NVL (TRUNC(:p_wo_completion_date_from),
    NVL (TRUNC(wdj.date_completed), '14-NOV-2012')
    AND TRUNC(:p_wo_completion_date_to)
    can u please help me to resolve the error mentioned.
    Thanks in advance.
    Regards,
    Ravi

    NVL(TRUNC (wdj.date_completed),to_date('14-NOV-2012','dd-MON-yyyy'))
         BETWEEN
              NVL (
                    TRUNC(to_date(:p_wo_completion_date_from,'mm/dd/yyyy hh12:mi:ss am')),
                   NVL (TRUNC(to_date(wdj.date_completed,'mm/dd/yyyy hh12:mi:ss am')),
                              to_date('14-NOV-2012','dd-MON-yyyy'))
            AND TRUNC(to_date(:p_wo_completion_date_to,'mm/dd/yyyy hh12:mi:ss am'))

  • 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?

  • ORA-00932: inconsistent data types: expected NUMBER got BINARY

    ORA-00932: inconsistent data types: expected NUMBER got BINARY
    Hi,
    Could anyone help in resolving my problem?
    I ‘m developing cmp beans in Jbuilder X,
    My database is Oracle 10g, running on Linux and Application server is Oracle10gAs. Running on Windows.
    I can deploy my Entity EJB’s OK and look then up using finder methods as long as I’ve created the data directly in the database using SQL*Plus for instance.
    In the database I have my primary keys defined as type NUMBER
    In my EJB the corresponding number fields get mapped as java.math.BigDecimal.
    which according to the Oracle JDBC specification is how they are mapped.
    Problem:
    When I try to create a new database entity through my EJB entity bean I get:-
    Error "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY".
    The value of the number being used as the primary key in this example is 10.
    Eg:-
    BigDecimal pk = new BigDecimal(10);
    TestBean test = home.create(pk);
    The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
    The jdbc driver defined in my application.xml is
    oracle.jdbc.driver.OracleDriverand url="jdbc:oracle:thin..." in the connection.
    I’ve even tried mapping a datatype as described in the Oracle FAQ’s but this didn’t work.
    21.     I'm trying to deploy a CMP entity bean with a field type BigDecimal and the table creation fails with an error. How do I work around this?
    You have to perform the following steps prior to deploy your application.
    o     Define the mapping for java.math.BigDecimal in the database-schemas/oracle.xml as follows:
    <type-mapping type="java.math.BigDecimal" name="number(20,8)" />o     Use this schema in your data-source as follows:-
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="OracleDS"
    ejb-location="jdbc/OracleDS"
    schema="database-schemas/oracle.xml"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="scott"
    password="tiger"
    url="jdbc:oracle:thin:@localhost:1521:DEBU"
    clean-available-connections-threshold="30"
    rac-enabled="false"
    inactivity-timeout="30"
    />

    Further clarification of my problem.
    Originally I said the error occurred when deploying EJB's
    Correction: I can deploy them OK on the application server However the Error message occurs when I try to create a new EJB entity, the only value required is the Primary key which I pass as type BidDecimal.
    If I create entries directly in the database my EJB findByPrimaryKey can find entities OK.
    But I cant create new ones through EJB.
    What realy baffels me is why I'm able to read data through the connection but not write.
    The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
    The jdbc driver defined in my application.xml is
    oracle.jdbc.driver.OracleDriver
    and url="jdbc:oracle:thin..." in the connection.

  • SQL Query - type mismatch

    This is a post from yesterday that spiraled down the wrong track.
    I have this line
    s.execute("SELECT * FROM Packlists WHERE Packlist = '" + plNum + "'");
    where plNum is an int. I have also tried long, short, double, etc. I always get a type mismatch error though. I have tried substituting real values for the variable. Packlist is a Long Integer field in an Access database

    s.execute("SELECT * FROM Packlists WHERE Packlist = " + plNum);

  • ORA-20001: Query must begin with SELECT or WITH

    Hi,
    On a page we have a hidden item :P3_SQL in which we save the dynamic sql query.
    We have a report region of SQL QUERY type whose source is this item :P3_SQL.
    This used to work fine in apex 3.*. We have upgraded our application to 4.0.1 and now we get this error.
    ORA-20001: Query must begin with SELECT or WITH
    I have a workaround for this, but just wanted to make sure somebody recognizes this as a bug in our latest apex version.
    Thanks
    Knut

    Hello Knut,
    I'm not sure if you encountered a bug or an improved validation of your query. If you had just ":P3_SQL" as source, this obviously is neither a correct query nor is it a function returning a query. I guess your workaround is actually encapsulating ":P3_SQL" in a block that returns the value. This is the intended way, not a bug. You just were lucky it was not validated and worked in previous versions.
    If my assumption was wrong, please post both working and non-working solution and a more precise description on when this error actually occurs.
    Thanks,
    Udo

  • Type Mismatch error while saving a BPC Report using eTools

    Hi,
    Iam getting a 'type mismatch' error when trying to save a BPC Excel  workbook using eTools>Save Dynamic Template >Company>eExcel. I am saving it as an .xlsx file.
    Can anyone please help out and let me know why I am getting this error.
    Thanks
    Arvind

    Hi,
    You need to save the file as .xls extension.

  • Type Mismatch error

    Hi,
    Iam getting a 'type mismatch' error when trying to save a BPC Excel Ecel workbook using eTools>Save Dynamic Template >Company>eExcel. I am saving it as an .xlsx file.
    Can anyone please help out and let me know why I am getting this error.
    Thanks
    Arvind

    Hi Arvind,
    You need to save the template as .xls file. This will work properly.

  • "Type mismatch" error in IE7/8 when using custom Actions Menu Image

    Hi all,
    in APEX 4.2: when using a custom image in the "Actions Menu Image" attribute in an interactive report, I get a "Type mismatch" error in IE7/8 when refreshing the report through PPR (filtering, sorting, paginating etc.). When I leave the "Actions Menu Image" field empty, everything works fine. The error doesn't seem to happen in IE9 (unless using compatibility mode), or in any non-IE browser.
    I've been able to reproduce the issue in an application on apex.oracle.com:
    http://apex.oracle.com/pls/apex/f?p=69347:1
    Some debugging seems to indicate that the following line in widget.interactiveReport.js is the culprit:
    lTemp.parentNode.replaceChild($x('apexir_WORKSHEET'), lTemp);Does anybody know if this is a known issue, or if there is some workaround?
    Thanks,
    Tobias

    Hi,
    Great solution Paul! It cost me a while before I found out the Action Menu Image was causing my interactive reports to stop refreshing in IE10 and not other browsers. Your solution works great, I've implemented it with a few minor adjustments:
    - Put the css in report template (for some reason it didn't work in our own application stylesheet)
    - replace  'url("/c/action_dropdown.gif")' with 'url("&APP_IMAGE_PREFIX./<path_to_image>")'
    - place one dynamic action on page 0: after refresh of '#apexir_DATA_PANEL' , set event scope to "Dynamic".
    - Let the Dynamic action also fire on page load.
    - To make sure the dynamic action only works for pages with an interactive report add condition of type 'Exists' with expression:
    select 1
    from   dual
    where  :APP_PAGE_ID in (select page_id
                                            from   apex_application_page_ir
                                            where  application_id = :APP_ID
    Best regards,
    Vincent Deelen

Maybe you are looking for

  • Sharepoint 2013 Public Facing Website With Managed Metadata Navigation on Office365 E3 Trial Online

    Warning: I am a complete novice in sharepoint I have subscribed to office365 online trial Enterprise edition to learn sharepoint I have created a Public facing Website Through the site-collection setting -> navigation created a new metadata group nam

  • Call function problem

    Hello I'm calling a remote function: CALL FUNCTION 'Z_RFC_TEST' DESTINATION i_rfc-host At first it worked. But now I always get the error: "FUNCTION MODULE Z_RFC_TEST not found. Any idea what this could be? Greets.

  • Software error

    While I'm burning a DVD, at the end of the process it stop and give me the following message, how can I fix it, in order to finissh the process and get the DVD burned? "internal sofware error:.\ Vobulator\Blockplanner\Blockplanner.ccp, line 215" I'm

  • Mapping error when multiple occurs

    ahi friends iam doing fail to idoc secinario in that iam using split function(UDF) for splitting. it is working good my problem is iam using MATMAS03 . in that E1MACM segment is repeting multiple times . in E1MARCM segment i have 1 z segment ane some

  • Documents of Object Oriented ABAP

    I need some documentation of Object Oriented ABAP, Please send the same