ORA-19279 Error on XQuery
I'm having trouble getting subordinate tag data out of this structure:
<CASE_BATCH>
<CASEDETAIL>
<HEADER>
<PERSON_ID>214339</PERSON_ID>
</HEADER>
<ASSOC>
<AP_ID>166646</AP_ID>
<AP_NAME>
<LASTNAME>TEST</LASTNAME>
<FIRSTNAME>TEST</FIRSTNAME>
</AP_NAME>
</ASSOC>
<ASSOC>
<AP_ID>166647</AP_ID>
<AP_NAME>
<LASTNAME>TEST2</LASTNAME>
<FIRSTNAME>TEST2</FIRSTNAME>
</AP_NAME>
</ASSOC>
</CASEDETAIL>
</CASEBATCH>
One of the many XQueries I've tried is:
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',
id Number Path '/CASEDETAIL/ASSOC/AP_ID',
lastname varchar2(50) '/CASEDETAIL/ASSOC/AP_NAME/LASTNAME',
firstname varchar2(50) '/CASEDETAIL/ASSOC/AP_NAME/FIRSTNAME') b
where a.extnum = 214339 and
a.extnum = b.extnum
If I leave the b.extnum out of it the column and where clause, and set the xmlTable path down to 'CASE_BATCH/CASEDETAIL/ASSOC' and the b columns path as
'/ASSOC/PERSON_ID' then I return all data, regardless of where in the file it's located. That makes sense because I don't have the extnum in the where clause to filter out unrelated tags.
How can I make this work?
Here is an example of using the XMLTable() function to create a master-detail view over multiple levels of your XML data. This PURCHASEORDER table can be found in the OE (order entry) sample schema when you create a new database instance with DBCA. Notice the passing clause (i.e., passing m.items ) in the second XMLTable() function.
Send me email (geoff dot lee at oracle dot com) directly if you still have problems.
Regards,
Geoff
SQL> create or replace view PO_MASTER_DETAIL_VIEW
2 as
3 select m.REFERENCE,m.REQUESTOR,m.USERID,m.COSTCENTER,item.*
4 from PO_SL_BIX_TABLE,
5 xmltable
6 ('/PurchaseOrder' passing object_value
7 COLUMNS
8 REFERENCE varchar2(30) path 'Reference',
9 REQUESTOR varchar2(128) path 'Requestor',
10 USERID varchar(10) path 'User',
11 COSTCENTER varchar2(4) path 'CostCenter',
12 ITEMS xmltype path 'LineItems'
13 ) m,
14 xmltable
15 ('/LineItems/LineItem' passing m.items
16 COLUMNS
17 ITEMNO number(38) path '@ItemNumber',
18 DESCRIPTION varchar2(1024) path 'Description',
19 PARTNO varchar2(56) path 'Part/@Id',
20 QUANTITY number(38) path 'Part/@Quantity',
21 UNITPRICE number(12,2) path 'Part/@UnitPrice'
22 ) item
23 /
View created.
SQL>
SQL> describe PO_MASTER_DETAIL_VIEW
Name Null? Type
REFERENCE VARCHAR2(30)
REQUESTOR VARCHAR2(128)
USERID VARCHAR2(10)
COSTCENTER VARCHAR2(4)
ITEMNO NUMBER(38)
DESCRIPTION VARCHAR2(1024)
PARTNO VARCHAR2(56)
QUANTITY NUMBER(38)
UNITPRICE NUMBER(12,2)
SQL> select REFERENCE, ITEMNO, PARTNO
2 from PO_MASTER_DETAIL_VIEW
3 where USERID = 'SBELL'
4 and PARTNO in ( '37429121726', '37429122129', '715515009058' )
5 /
REFERENCE ITEMNO PARTNO
SBELL-20021009123335280PDT 7 715515009058
SBELL-20021009123335280PDT 11 37429121726
SBELL-20021009123338304PDT 9 37429122129
SBELL-20021009123336331PDT 2 715515009058
SBELL-2002100912333763PDT 19 37429122129
SBELL-2002100912333601PDT 1 715515009058
SBELL-20021009123336532PDT 2 37429121726
SBELL-20021009123338204PDT 12 715515009058
8 rows selected.
Similar Messages
-
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:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="A_B_C">
<xs:complexType>
<xs:sequence>
<xs:element name="A">
<xs:complexType>
<xs:sequence>
<xs:element name="B">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="1A"/>
<xs:enumeration value="1B"/>
<xs:enumeration value="2A"/>
<xs:enumeration value="2B"/>
<xs:enumeration value="2C"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:choice>
<xs:element name="D" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="D_ID" type="xs:string">
</xs:element>
<xs:element name="D_UQ_ID" type="xs:string">
</xs:element>
<xs:element name="D_TIME">
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:element>
<xs:choice>
<xs:element name="F">
<xs:complexType>
<xs:sequence>
<xs:element name="F_TYPE" type="xs:string">
</xs:element>
<xs:element name="F_SUBTYPE" type="xs:string">
</xs:element>
<xs:element name="G" minOccurs="0">
<xs:complexType>
<xs:choice>
<xs:element name="H">
<xs:complexType>
<xs:sequence>
<xs:element name="H_TYPE" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="H_MODE" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="H_SHAPE" minOccurs="0">
<xs:complexType>
<xs:choice>
<xs:element name="POLYGON">
<xs:complexType>
{color:#ff0000}*<xs:sequence maxOccurs="unbounded">*{color}
<xs:element name="SEQ_NUM" type="xs:unsignedInt">
<xs:annotation>
<xs:documentation>sequence number in the polygon</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="LAT" type="xs:float"/>
<xs:element name="LON" type="xs:float"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CIRCLE">
<xs:complexType>
<xs:sequence>
<xs:element name="LAT" type="xs:float"/>
<xs:element name="LON" type="xs:float"/>
<xs:element name="RAD" type="xs:float"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ELLIPSE">
<xs:complexType>
<xs:sequence>
<xs:element name="ORIENT">
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="360"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="MAJ_AX" type="xs:float">
</xs:element>
<xs:element name="MIN_AX" type="xs:float">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="E">
<xs:complexType/>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="C">
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
abc.xml file:
<?xml version="1.0" encoding="utf-8"?>
<A_B_C>
<A>
<B>1B</B>
</A>
<D>
<D_ID>D_0001</D_ID>
<D_UQ_ID>UQ_D_0001</D_UQ_ID>
<D_TIME>2007 FEB 11:11:11.11</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
<G>
<H>
<H_TYPE>Ipod</H_TYPE>
<H_MODE>SCANNING</H_MODE>
<H_SHAPE>
<POLYGON>
<SEQ_NUM>1</SEQ_NUM>
<LAT>10.1</LAT>
<LON>11.1</LON>
<SEQ_NUM>2</SEQ_NUM>
<LAT>20.2</LAT>
<LON>22.2</LON>
<SEQ_NUM>3</SEQ_NUM>
<LAT>30.3</LAT>
<LON>33.3</LON>
<SEQ_NUM>4</SEQ_NUM>
<LAT>40.4</LAT>
<LON>44.4</LON>
</POLYGON>
<CIRCLE>
<LAT>12.3</LAT>
<LON>45.6</LON>
<RAD>78.9</RAD>
</CIRCLE>
<ELLIPSE>
<ORIENT>99.90</ORIENT>
<MAJ_AX>111.10</MAJ_AX>
<MIN_AX>222.20</MIN_AX>
</ELLIPSE>
</H_SHAPE>
</H>
</G>
</F>
<E></E>
</D>
<D>
<D_ID>D_0002</D_ID>
<D_UQ_ID>UQ_D_0002</D_UQ_ID>
<D_TIME>2007 FEB 22:22:22.22</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
<G>
<H>
<H_TYPE>Ipod</H_TYPE>
<H_MODE>SCANNING</H_MODE>
<H_SHAPE>
<POLYGON>
<SEQ_NUM>1</SEQ_NUM>
<LAT>10.1</LAT>
<LON>11.1</LON>
<SEQ_NUM>2</SEQ_NUM>
<LAT>20.2</LAT>
<LON>22.2</LON>
<SEQ_NUM>3</SEQ_NUM>
<LAT>30.3</LAT>
<LON>33.3</LON>
<SEQ_NUM>4</SEQ_NUM>
<LAT>40.4</LAT>
<LON>44.4</LON>
</POLYGON>
<CIRCLE>
<LAT>12.3</LAT>
<LON>45.6</LON>
<RAD>78.9</RAD>
</CIRCLE>
<ELLIPSE>
<ORIENT>99.90</ORIENT>
<MAJ_AX>111.10</MAJ_AX>
<MIN_AX>222.20</MIN_AX>
</ELLIPSE>
</H_SHAPE>
</H>
</G>
</F>
<E></E>
</D>
<D>
<D_ID>D_0003</D_ID>
<D_UQ_ID>UQ_D_0003</D_UQ_ID>
<D_TIME>2007 FEB 33:33:33.33</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
<G>
<H>
<H_TYPE>Ipod</H_TYPE>
<H_MODE>SCANNING</H_MODE>
</H>
</G>
</F>
<E></E>
</D>
<D>
<D_ID>D_0004</D_ID>
<D_UQ_ID>UQ_D_0004</D_UQ_ID>
<D_TIME>2007 FEB 44:44:44.44</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
<G>
<H>
<H_TYPE>Ipod</H_TYPE>
<H_MODE>SCANNING</H_MODE>
<H_SHAPE>
<POLYGON>
<SEQ_NUM>1</SEQ_NUM>
<LAT>10.1</LAT>
<LON>11.1</LON>
<SEQ_NUM>2</SEQ_NUM>
<LAT>20.2</LAT>
<LON>22.2</LON>
<SEQ_NUM>3</SEQ_NUM>
<LAT>30.3</LAT>
<LON>33.3</LON>
<SEQ_NUM>4</SEQ_NUM>
<LAT>40.4</LAT>
<LON>44.4</LON>
</POLYGON>
<CIRCLE>
<LAT>12.3</LAT>
<LON>45.6</LON>
<RAD>78.9</RAD>
</CIRCLE>
<ELLIPSE>
<ORIENT>99.90</ORIENT>
<MAJ_AX>111.10</MAJ_AX>
<MIN_AX>222.20</MIN_AX>
</ELLIPSE>
</H_SHAPE>
</H>
</G>
</F>
<E></E>
</D>
<D>
<D_ID>D_0005</D_ID>
<D_UQ_ID>UQ_D_0005</D_UQ_ID>
<D_TIME>2007 FEB 55:55:55.55</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
</F>
<E></E>
</D>
<D>
<D_ID>D_0006</D_ID>
<D_UQ_ID>UQ_D_0006</D_UQ_ID>
<D_TIME>2007 FEB 66:66:66.66</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
<G>
<H>
<H_TYPE>Ipod</H_TYPE>
<H_MODE>SCANNING</H_MODE>
<H_SHAPE>
<POLYGON>
<SEQ_NUM>1</SEQ_NUM>
<LAT>10.1</LAT>
<LON>11.1</LON>
<SEQ_NUM>2</SEQ_NUM>
<LAT>20.2</LAT>
<LON>22.2</LON>
<SEQ_NUM>3</SEQ_NUM>
<LAT>30.3</LAT>
<LON>33.3</LON>
<SEQ_NUM>4</SEQ_NUM>
<LAT>40.4</LAT>
<LON>44.4</LON>
</POLYGON>
<CIRCLE>
<LAT>12.3</LAT>
<LON>45.6</LON>
<RAD>78.9</RAD>
</CIRCLE>
<ELLIPSE>
<ORIENT>99.90</ORIENT>
<MAJ_AX>111.10</MAJ_AX>
<MIN_AX>222.20</MIN_AX>
</ELLIPSE>
</H_SHAPE>
</H>
</G>
</F>
<E></E>
</D>
<D>
<D_ID>D_0007</D_ID>
<D_UQ_ID>UQ_D_0007</D_UQ_ID>
<D_TIME>2007 FEB 77:77:77.77</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
<G>
<H>
<H_TYPE>Ipod</H_TYPE>
<H_MODE>SCANNING</H_MODE>
</H>
</G>
</F>
<E></E>
</D>
<D>
<D_ID>D_0008</D_ID>
<D_UQ_ID>UQ_D_0008</D_UQ_ID>
<D_TIME>2007 FEB 88:88:88.88</D_TIME>
<F>
<F_TYPE>F_TYPE_TEST</F_TYPE>
<F_SUBTYPE>SUB_TEST</F_SUBTYPE>
<G>
<H>
<H_TYPE>Ipod</H_TYPE>
<H_MODE>SCANNING</H_MODE>
<H_SHAPE>
<POLYGON>
<SEQ_NUM>1</SEQ_NUM>
<LAT>10.1</LAT>
<LON>11.1</LON>
<SEQ_NUM>2</SEQ_NUM>
<LAT>20.2</LAT>
<LON>22.2</LON>
<SEQ_NUM>3</SEQ_NUM>
<LAT>30.3</LAT>
<LON>33.3</LON>
<SEQ_NUM>4</SEQ_NUM>
<LAT>40.4</LAT>
<LON>44.4</LON>
</POLYGON>
<CIRCLE>
<LAT>12.3</LAT>
<LON>45.6</LON>
<RAD>78.9</RAD>
</CIRCLE>
<ELLIPSE>
<ORIENT>88.80</ORIENT>
<MAJ_AX>111.10</MAJ_AX>
<MIN_AX>222.20</MIN_AX>
</ELLIPSE>
</H_SHAPE>
</H>
</G>
</F>
<E></E>
</D>
<C>TPS Report 4</C>
</A_B_C>
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 -
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 -
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,
Daianebelow 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 ; -
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,
ChidamTry 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 AMWelcome 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: 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
GroxyAs 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> -
ORA-29540: class oracle/xquery/OXQServer does not exist
I'm running 10g and initially had a problem when running XMTABLE that the error :-
"identifier 'SYS.DBMS_XQUERYINT' must be declared"
came up when I tried to execute anything relating to XQUERY
One of our DBAs very kindly looked into this and found the script :-
"$ORACLE_HOME/rdbms/admin/initxqry.sql"
This was executed, but now I get the error :-
ORA-29540: class oracle/xquery/OXQServer does not exist
Does anyone know what I am still missing out?
Thanks in anticipation of any advice anyone can offerThanks mdrake, we seem to gradually be getting there.
One thing I've now come across is :-
oracle.jdbc.driver.OracleSQLException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_LOB' must be declared
O
This is a "demo" trigger that caused this problem :-
CREATE OR REPLACE TRIGGER xml_inbox_trigger AFTER INSERT ON xmlinbox
FOR EACH ROW
DECLARE
XMLRECORD XMLType;
BEGIN
XMLRECORD := :new.XMLDATA;
INSERT INTO all_children
(childname) VALUES
(extractvalue (XMLRECORD, '*/child/name'));
IF :new.xmlfilename like 'boys%' THEN
INSERT INTO boys
(childname) VALUES
(extractvalue (XMLRECORD, '*/child/name'));
END IF;
IF :new.xmlfilename like 'boys%' THEN
INSERT INTO boys_wishlist SELECT
childname , artno , description ,price FROM
XMLTABLE (
'*/child' passing XMLRECORD
columns
childname varchar2(25) path '/name'
, artno number path '/wishlist/artno'
, description varchar2(25) path '/wishlist/description'
, price varchar2(10) path '/wishlist/price'
END IF;
IF :new.xmlfilename like 'girls%' THEN
INSERT INTO girls
(childname) VALUES
(extractvalue (XMLRECORD, '*/child/name'));
END IF;
END;
Do you think the above error is caused by something wrong with the above code, or something else wrong with our installation??
Thank you so much for your continued assistance -
Ora-03113 error with XMLTABLE inside subquery or view
I'm getting ORA-03113 error if I use a result of XMLTABLE inside a subquery of another query (whether XMLTABLE is inline, or from a view). Code below to reproduce this - vastly simplified and now rather meaningless - but produces same error. Has anyone saw this error re. XMLTABLE or know of metalink bugs on this ? I couldn't find anything. I'm having to use deprecated table(xmlsequence) instead, which doesn't get this error.
--DROP TABLE TEST
CREATE TABLE TEST(ID number(10), CUST_REF varchar2(50 char), XMLDATA XMLTYPE);
INSERT INTO TEST(ID, CUST_REF, XMLDATA) VALUES (1, 'XYZ',
XMLTYPE('<?xml version="1.0" encoding="utf-16"?>
<TESTXML
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:ABC-123:TESTXML">
<collections>
<TRANSACTION_COLLECTION>
<TRANSACTION>
<RECORD_ID>1</RECORD_ID>
<TRANSACTION_ID>7791786</TRANSACTION_ID>
<AMOUNT>335</AMOUNT>
<TYPE>I</TYPE>
<DC>DR</DC>
</TRANSACTION>
</TRANSACTION_COLLECTION>
</collections>
</TESTXML>'));
COMMIT;
CREATE VIEW TEST_XMLVIEW
AS
SELECT
ID,
CUST_REF,
xmltbl.RECORD_ID,
xmltbl.TRANSACTION_ID,
xmltbl.AMOUNT,
xmltbl.TYPE,
xmltbl.DC
FROM TEST,
XMLTable(XMLNamespaces(DEFAULT 'urn:ABC-123:TESTXML'),
'/TESTXML/collections/TRANSACTION_COLLECTION/TRANSACTION' PASSING TEST.XMLDATA
COLUMNS
"RECORD_ID" number(10) PATH 'RECORD_ID',
"TRANSACTION_ID" VARCHAR(200 CHAR) PATH 'TRANSACTION_ID',
"DC" VARCHAR(200 CHAR) PATH 'DC',
"TYPE" VARCHAR(200 CHAR) PATH 'TYPE',
"AMOUNT" NUMBER(38,8) PATH 'AMOUNT')
AS xmltbl;
WITH SUM_AMOUNTS (ID, CUST_REF, SUM_1, SUM_2, SUM_3)
AS
(SELECT ID, CUST_REF, SUM(AMOUNT) AS SUM_1, SUM(AMOUNT) AS SUM_2, SUM(AMOUNT) + SUM(AMOUNT) AS SUM_3
FROM TEST_XMLVIEW
GROUP BY ID, CUST_REF)
select
ID,
CUST_REF,
SUM_1,
SUM_2,
SUM_3
from SUM_AMOUNTS;
Version Details:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionHas anyone saw this error re. XMLTABLE or know of metalink bugs on this ? I couldn't find anything.Really?
Go to the trace directory and find the relevant trace/incident file.
On my system, I can see something like this :
ORA-07445: exception encountered: core dump [evaopn3()+656] [ACCESS_VIOLATION] [ADDR:0x0] [PC:0x234A5B6] [UNABLE_TO_READ] []Copy/paste that line into the ORA-00600/ORA-07445 look-up tool on My Oracle Support and run the search for your version.
You will find this article :
*ORA-7445 (evaopn3) [ID 860969.1]*
and at the bottom of the page, among the known related bugs, this one :
*Bug 12724375 : ORA-7445 [evaopn3] from XQuery with GROUP BY* -
Ora-00604 error and ora 01000 error while report generation.
hi all,
I am trying to generate the multiple reports of same template through a program.
While this job is running, i get the following error at the BIP console and the reports don't get generated.
[101711_044115578][][EXCEPTION] java.sql.SQLException: ORA-00604: error occurred
at recursive SQL level 1
ORA-01000: maximum open cursors exceeded
ORA-00604: error occurred at recursive SQL level 1
ORA-01000: maximum open cursors exceeded
ORA-01000: maximum open cursors exceeded
Kindly help.
Thanks.Lots of resources with a simple search to see what this is about, for example:
http://www.orafaq.com/wiki/ORA-01000
ORA-01000: maximum open cursors exceeded
Cause: A host language program attempted to open too many cursors. The initialization parameter OPEN_CURSORS determines the maximum number of cursors per user.
Action: Modify the program to use fewer cursors. If this error occurs often, shut down Oracle, increase the value of OPEN_CURSORS, and then restart Oracle.
open_cursors parameter
http://download.oracle.com/docs/cd/E11882_01/server.112/e25513/initparams160.htm#REFRN10137
Oracle support note:
OERR: ORA-1000 maximum open cursors exceeded (Doc ID 18591.1) -
Ora-00604,ora-01422 error while dropping the table
Hi gurus,
I am using Oracle 10g R2 on windows 2000 platform,while dropping the table the following error occured.
ORA-00604 : error occurred at recursive sql level 1.
ORA-01422: exact fetch returns more than requested number of rows.
Need urgent help.
Thanks in advanceIs there an AFTER EVENT trigger defined on this database? Can you check that?
Secondly, was this database migrated from earlier version? I remember having seen this problem on 9i (it was 9.2.0.1 or 9.2.0.2; I can't recall exactly). -
Ora 600 error Arguments [25012] [11]
hi,
i've an ORA-00600: error Arguments [25012], [2], [11], [], [], [], [], [] by DELETE FROM table WHERE filed = :b1
ther are only 8 file in database. (not 11)
Can anybody help, or give me an information about Bug number: 742709
OS NT 4 / SP6 ORACLE RDBMS Version: 8.0.5.2.1.
Thank in advice
JFATrace File Contents:
============================================================================================
[oracle@oem trace]$ more /d01/app/guest/diag/rdbms/db11g/db11g/incident/incdir_191809/db11g_smon_4198_i191809.trc
Dump file /d01/app/guest/diag/rdbms/db11g/db11g/incident/incdir_191809/db11g_smon_4198_i191809.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /d01/app/guest/product/11.2.0/dbhome_1
System name: Linux
Node name: oem.tap.com
Release: 2.6.18-164.el5xen
Version: #1 SMP Thu Sep 3 02:41:56 EDT 2009
Machine: i686
Instance name: db11g
Redo thread mounted by this instance: 1
Oracle process number: 13
Unix process pid: 4198, image: [email protected] (SMON)
*** 2010-10-15 12:05:24.395
*** SESSION ID:(16.1) 2010-10-15 12:05:24.395
*** CLIENT ID:() 2010-10-15 12:05:24.395
*** SERVICE NAME:(SYS$BACKGROUND) 2010-10-15 12:05:24.395
*** MODULE NAME:() 2010-10-15 12:05:24.395
*** ACTION NAME:() 2010-10-15 12:05:24.395
Dump continued from file: /d01/app/guest/diag/rdbms/db11g/db11g/trace/db11g_smon_4198.trc
ORA-00600: internal error code, arguments: [13013], [5001], [267], [8444108], [2], [8444108], [17], [], [], [], [], []
========= Dump for incident 191809 (ORA 600 [13013]) ========
*** 2010-10-15 12:05:24.399
dbkedDefDump(): Starting incident default dumps (flags=0x2, level=3, mask=0x0)
----- Current SQL Statement for this session (sql_id=dma0vxbwh325p) -----
update smon_scn_time set time_mp=:1, time_dp=:2, scn=:3, scn_wrp=:4, scn_bas=:5, num_mappings=:6, tim_scn_map=:7 where scn = (sele
ct min(scn) from smon_scn_time)
========================================================================================== -
Ora-01008 error with bind variable
Hi,
We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable. The program returns error in one of the databases but all others are successful. We've checked the column is same in all of them.
Exception in thread "main" java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-01008: not all variables bound
Could you please advise how to troubleshoot this issue?
RegardsWe aren't going to be able to help you if you won't post the database code that is giving the error.
And now we need the Java code that is constructing the query that you are using.
Your error is saying there is a second variable that you are not providing a value for.
And you said
>
We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable.
>
But you are using a string that is 23 characters long
"a3g34-b13fd-efaie-f83fk"How does 23 go into 20? -
Getting error-ORA-24381: error(s) in array DML
Hi i have written the following code to bulk insert into a database table.
I am getting an error while returning the result of the bulk insert query into the collection
I have tried to track it by using sql%bulk_exceptions.error_code.
But the error code that it is showing is just 1.
I trapped it using sqlerrm.
and that is showing-error(s) in array DML
What do i do?
DECLARE
CURSOR temp_rec_tap_cur
IS
SELECT *
FROM temp_records_tap;
TYPE temp_rec_tab IS TABLE OF temp_rec_tap_cur%ROWTYPE;
v_test_tab temp_rec_tab;
v_rec_num num_tab;
v_filename temp_records_tap.file_name%TYPE;
v_error_code tap_reject.error_code%type;
v_rej_value tap_reject.field_rej%type;
v_errors number;
BEGIN
SELECT file_name
INTO v_filename
FROM table1
WHERE ROWNUM<2;
OPEN temp_rec_tap_cur;
LOOP
BEGIN
FETCH temp_rec_tap_cur
BULK COLLECT INTO v_test_tab LIMIT 1000;
FORALL i IN v_test_tab.FIRST .. v_test_tab.LAST SAVE EXCEPTIONS
INSERT INTO tapdetail_tapin
VALUES v_test_tab (i)
RETURNING record_num
BULK COLLECT INTO v_rec_num;
EXCEPTION
WHEN DUP_VAL_ON_INDEX
THEN
NULL;
WHEN OTHERS
THEN
v_errors:=sql%bulk_exceptions.count;
for i in 1..v_errors
loop
dbms_output.put_line(sql%bulk_exceptions(i).error_code);
p3_errorlog ('TAPINDETAWARE', SQLERRM, v_filename);
end loop;
END;
--RAISE;
EXIT WHEN temp_rec_tap_cur%NOTFOUND;
END LOOP;
INSERT INTO table2
SELECT file_id, file_name, sender_pmn, recipient_pmn, call_date,
call_date_only, call_type, call_number, FIRST_RECORD,
service_type, service_code, home_bid, serve_bid,
chargeable_subs_type, imsi_min, msisdn_mdn, air_charges,
air_charges_sdr, air_time, national_call_charges,
national_call_charges_sdr, national_call_time,
international_call_charges, international_call_charges_sdr,
international_call_time, dir_assist_charges,
dir_assist_charges_sdr, dir_assist_time, other_charges,
other_charges_sdr, other_time, volume_charges,
volume_charges_sdr, volume_units, tot_charges, tot_charges_sdr,
tot_duration, state_tax, state_tax_sdr, local_tax,
local_tax_sdr, state_and_use_tax, state_and_use_tax_sdr, va_tax,
va_tax_sdr, other_tax, other_tax_sdr, charge_refund_indicator,
advised_charge_currency, advised_charge, advised_charge_sdr,
advised_charge_commission, advised_charge_commission_sdr,
exchange_rate, mcc, mnc, process_date, chargeable_units,
record_num, mscid,null,null,decode(call_type,0,'250',1,'251',5,'255'),null,'Duplicate Call'
from temp_records_tap
where record_num not in (select column_value from table(v_rec_num)) ;
EXCEPTION
WHEN OTHERS THEN
p3_errorlog ('TAP', SQLERRM, v_filename);
END;Edited by: user8731258 on Sep 14, 2010 2:58 AM
Edited by: user8731258 on Sep 14, 2010 3:01 AMWhat is the type declaration of num_tab and how is record_num defined?
ORA-24381: error(s) in array DML
Cause: One or more rows failed in the DML.indicates that you fail on the insert itself. Are the table definitions the same? Same primary/unique keys?
Edited by: MBr on 14-Sep-2010 03:16 -
PL/SQL: ORA-04052: error occurred when looking up remote object.
Hi All,
I'm getting the following error message while executing a PL/SQL Block.
PL/SQL: ORA-04052: error occurred when looking up remote object UPLDUSER.filestatushistory@FTS
ORA-00604: error occurred at recursive SQL level 1
ORA-03106: fatal two-task communication protocol error
ORA-02063: preceding line from FTSStatement
declare
v_coun number;
begin
select count(*) into v_coun
from updluser.filestatushistory@fts;
end;Back ground of the situation as follows,
My DataBase version 10.2.0.3 DB Name :DB1
Table Owner : UPLDUSER
Table Name : FILESTATUSHISTORY
I have a report user on the same database and I have grant all on the above table to report user
Report User : RPT_FTS
SQL> GRANT ALL ON FILESTATUSHISTORY_V TO RPT_FTS;Now Please find the below database details where I'm getting subjected error.
Database version : 9.2.0.8
DB Name : DB2
User Name : RPT_REPORTS
I Have create a dblink from RPT_REPORTS to RPT_FTS on DB1 and the dblink works fine. But getting the above error while running it.
but When I do the same other 10.2.0.3 db , the above PL/SQL block works fine without any problem.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Now the strange about this is that I have Created a new table on DB1 db like below;
SQL> CREATE TABLE UPLDUSER.ABC AS SELECT * FROM FILESTATUSHISTORY;and retry my code on DB2 (9.2.0.8) after changing the table to ABC and it worked. Now I don't know whats wrong with a original table(FILESTATUSHISTORY).
To over come the problem and a work-a-round method I create a view on the DB1 (RPT_FTS) like the below
SQL> CREATE VIEW FILESTATUSHISTORY AS SELECT * FROM UPLDUSER.FILESTATUSHISTORY;and was able to run the PL/SQL block Remotely.
Just wants To know what whould have been the cause for this .
Cheers
KanchanaHi Kanchana,
Perhaps following link of google search has answer to your query
ORA-04052. The search result contains some useful articles whose URLs I shan't post in the forums.
HTH!
*009*
Maybe you are looking for
-
Ctrl and left click not working in DW CS5
When Im working in design view for some reason my links are not working when I press ctrl and left click. To make them work I have to right click and select follow link. Its not a major problem because I can still carry on, but its annoying!
-
My macbook pro can't reboot after os 10.6.8 update.
The title said it all. Anyone experiencing the same?
-
Upgraded from iphoto9 to iphoto11 using ilife dvd, now it wont open!
i had iphoto 9 (i think) on mac and i just put ilife 11 dvd in to update the apps especially iphoto to 11. now every new and updated app seems to open fine except iphoto (the only one i use of course)- it wont open and says i need to update software
-
Why does Preview crash when I export photos after upgrading to Yosemite?
I recently upgraded to Yosemite and now Preview crashes constantly. It often crashes when I try to open a photo file and almost always crashes when I try to export a photo file. This is problematic since I have to deal with a lot of photo files for w
-
There is not any question, but wondering why Apple does not consider an optional feature to enable/disable small/ large caller picture! It was very attractive feature when my dear contacts was calling me, so sorry for myself to loos such a good previ