Oracle XMLTable function no rows returned
I have a following xml document stored in XML type table
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="urn:iso:std:iso:200:tech:xsd:101" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FIToFICstmrCdtTrf xmlns="urn:iso:std:iso:200:tech:xsd:101">
<CreditTx>
<PaymentID>
<InstrumentId>AAB000001</InstrumentId>
<Id>4730 2013-10-23 AAB000001</Id>
<TranxId>BULKTTXTDAAB000001</TranxId>
</PaymentID>
</CreditTx>
</FIToFICstmrCdtTrf>
</Document>
And i am trying to select
I am on Oracle Version 11.2.0.3SELECT payments.txid,
payments.endtoendid,
payments. instrid
FROM payment_load_xml,
XMLTable('for $i in /Document/FIToFICstmrCdtTrf/CdtTrfTxInf/PmtId
return $i'
PASSING OBJECT_VALUE
COLUMNS
instrid VARCHAR2(20) PATH 'InstrId' ,
endtoendid VARCHAR2(20) PATH 'EndToEndId' ,
txid VARCHAR2(20) PATH 'TxId'
)payments
I am getting no rows returned any ideas please
The document has a default namespace, so you have to declare it :
SELECT payments.txid,
payments.endtoendid,
payments. instrid
FROM payment_load_xml,
XMLTable(
XMLNamespaces(default 'urn:iso:std:iso:200:tech:xsd:101') ,
'for $i in /Document/FIToFICstmrCdtTrf/CdtTrfTxInf/PmtId
return $i'
PASSING OBJECT_VALUE
COLUMNS
instrid VARCHAR2(20) PATH 'InstrId' ,
endtoendid VARCHAR2(20) PATH 'EndToEndId' ,
txid VARCHAR2(20) PATH 'TxId'
) payments ;
and additionally, your paths don't point to anything in the sample document.
Similar Messages
-
Sending Email by Oracle Alert when no rows returned
Hello All,
I am having one problem.
In the Oracle Alert i wrote one query which is returing 0 rows.
But sometimes it will returns some rows.
And my requirement is that when this query doesn't return any rows , i want to send one email to user that there is no data
and if the data is present then i have to send the data.
But currently there is no data so i made one Oracle Alert and when i am running that Alert then it is showing me a one message and mail doesn't sent
Oracle Alert did not perform the summary action "My Test Alert" because no exceptions were returned for this action set.
Please Suggest
Thanks & RegardsWrite a second alert that fires near about the same time.
select 'send email'
from dual
where 0 = (select count(1) from your_table)
This alert will send a "no rows found" email.
Hope this helps,
Sandeep Gandhi -
XMLTable - 65535 limit on rows returned
Hi,
I've come across a problem with the Oracle XMLTable command as follows:
- I have an XML doc (approx 30Mb) which contains 79k entries
- I have this referenced in Oracle as a BFile
- If I count the number of rows returned by the XMLTable command it does not equal 79k - instead the number is 79k - 65535
Is there a limit on the number of rows XMLTable can handle (ie. < 2 ^ 16) or am I missing something?
declare
xbfile BFILE;
res BOOLEAN;
countrows number;
begin
xbfile := bfilename('XML_DIR', 'test.xml');
res := DBMS_XDB.createResource('/public/test.xml', xbfile);
select count(*) into countrows from XMLTable('for $i in doc("/public/test.xml") return $i/ROWSET/ROW'
columns ID INTEGER);
dbms_output.put_line('count=' || countrows);
end;SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
5 rows selected.
SQL> set autotrace on
SQL> select count(*)
2 from xmltable( '$d/ROWSET/ROW'
3 passing xmltype( cursor( select rownum from dual connect by level <= 70000 ) ) as "d"
4 columns rnum integer path 'ROWNUM'
5 )
6 /
COUNT(*)
70000
1 row selected.
Execution Plan
Plan hash value: 1051571446
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 29 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | VIEW | | 8168 | 29 (0)| 00:00:01 |
| 3 | VIEW | | 8168 | 29 (0)| 00:00:01 |
| 4 | COLLECTION ITERATOR PICKLER FETCH| XMLSEQUENCEFROMXMLTYPE | | | |
Statistics
70005 recursive calls
148263 db block gets
30391 consistent gets
0 physical reads
0 redo size
411 bytes sent via SQL*Net to client
385 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed -
XMLTABLE function not returning any values if xml has attribute "xmlns"
Hi,
XMLTABLE function not returning any values if xml has attribute "xmlns". Is there way to get the values if xml has attribute as "xmlns".
create table xmltest (id number(2), xml xmltype);
insert into xmltest values(1,
'<?xml version="1.0"?>
<emps>
<emp empno="1" deptno="10" ename="John" salary="21000"/>
<emp empno="2" deptno="10" ename="Jack" salary="310000"/>
<emp empno="3" deptno="20" ename="Jill" salary="100001"/>
</emps>');
insert into xmltest values(2,
'<?xml version="1.0"?>
<emps xmlns="http://emp.com">
<emp empno="1" deptno="10" ename="John" salary="21000"/>
<emp empno="2" deptno="10" ename="Jack" salary="310000"/>
<emp empno="3" deptno="20" ename="Jill" salary="100001"/>
</emps>');
commit;
SELECT a.*
FROM xmltest,
XMLTABLE (
'for $i in /emps/emp
return $i'
PASSING xml
COLUMNS empno NUMBER (2) PATH '@empno',
deptno NUMBER (3) PATH '@deptno',
ename VARCHAR2 (10) PATH '@ename',
salary NUMBER (10) PATH '@salary') a
WHERE id = 1;
The above query returning results but below query is not returning any results because of xmlns attribute.
SELECT a.*
FROM xmltest,
XMLTABLE (
'for $i in /emps/emp
return $i'
PASSING xml
COLUMNS empno NUMBER (2) PATH '@empno',
deptno NUMBER (3) PATH '@deptno',
ename VARCHAR2 (10) PATH '@ename',
salary NUMBER (10) PATH '@salary') a
WHERE id = 1;
how to get rid out of this problem.
Thanks,
-ManiAdded below one in xmltable, its working now.
XmlNamespaces(DEFAULT 'http://emp.com') -
Need to know how to limit the number of rows returned on Oracle
MS SQL Server has a command called 'set row count'.
We are trying to find similar one on Oracle.
What we are trying to do is that instead of using rownum in the query statement, we would like to find way to limit the number of rows returned. I understand that we can use JDBC resultSet object, but that's not what we want.
I know Oracle has one called arraysize, but this would not limit the number of rows returned either.
Pease help.
ThanksI understand that we can use JDBC resultSet object, but that's not what we want.I'm not sure which feature of ResultSet you use and which not.
But if this question has anything to do with JDBC (that's the forum where you put it), I'd recommend to use Statement.setMaxRows(). This will limit the count of rows which your statement will fetch into it's ResultSet. -
Oracle XML functions return tags for null columns.
I am currently writing a SOAP Message base on a SQL statement formatted as XML. However, I am having problems with Oracle XML functions not returning tags for null columns as seen in my example below. Is the a way to get Oracle XML functions to return empty tags for null column?
CREATE TABLE FOREXAMPLE_TABLE (COLUMN_1 VARCHAR2 (4000),
COLUMN_2 VARCHAR2 (4000),
COLUMN_3 VARCHAR2 (4000));
INSERT INTO FOREXAMPLE_TABLE (COLUMN_2)
VALUES ('This column is not null');
COMMIT;
SELECT XMLELEMENT ( "soap:Envelope",
XMLATTRIBUTES ( 'http://schemas.xmlsoap.org/soap/envelope/' AS "xmlns:soap"),
XMLELEMENT ( "soap:Body",
XMLATTRIBUTES ( 'http://Custom_Column/types/' AS "xmlns:ns1"),
XMLELEMENT ( "ns1:New_Instance",
XMLELEMENT ( "ns1:Input_XMLDoc",
XMLFOREST(fe.COLUMN_1 as "Column_1",
fe.COLUMN_2 as "Column_2",
fe.COLUMN_3 as "Column_3"))))) as xml
FROM FOREXAMPLE_TABLE fe
The results returned from the select statement.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://Custom_Column/types/"><ns1:New_Instance>
<ns1:Input_XMLDoc><Column_2>This column is not null</Column_2>
</ns1:Input_XMLDoc></ns1:New_Instance></soap:Body></soap:Envelope>
The desired results for the select statement.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://Custom_Column/types/"><ns1:New_Instance>
<ns1:Input_XMLDoc><Column_1></Column_1>
<Column_2>This column is not null</Column_2><Column_3></Column_3>
</ns1:Input_XMLDoc></ns1:New_Instance></soap:Body></soap:Envelope>
jeemanAn alternative may be be to use xmlconcat instead of xmlforest:
Time Start: 30.06.2007 18:52:41
PL/SQL procedure successfully completed.
michaels> select xmlelement
("soap:Envelope",
xmlattributes
('http://schemas.xmlsoap.org/soap/envelope/' as "xmlns:soap"),
xmlelement
("soap:Body",
xmlattributes ('http://Custom_Column/types/' as "xmlns:ns1"),
xmlelement ("ns1:New_Instance",
xmlelement ("ns1:Input_XMLDoc",
xmlconcat (xmlelement("Column_1", fe.column_1),
xmlelement("Column_2", fe.column_2),
xmlelement("Column_3", fe.column_3)
).extract('.').getstringval() as xml
from (select null column_1, 'This column is not null' column_2,
null column_3
from dual) fe
XML
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://Custom_Column/types/">
<ns1:New_Instance>
<ns1:Input_XMLDoc>
<Column_1/>
<Column_2>This column is not null</Column_2>
<Column_3/>
</ns1:Input_XMLDoc>
</ns1:New_Instance>
</soap:Body>
</soap:Envelope> -
Problem in Oracle Stored function?
Hi,
I have written this function in Oracle which takes every row of data from excel and updates the database.
CREATE OR REPLACE FUNCTION APD_MASS_UPLOAD_UNITS_FUNC
(PRODUCT_ID VARCHAR2,Product_Code VARCHAR2, str_Adpt_Grp VARCHAR2,str_Adpt_Type VARCHAR2,
str_PDC VARCHAR2,str_Release_ID VARCHAR2,str_Created_by VARCHAR2,
str_Last_Updated_By VARCHAR2, dt_created_Date VARCHAR2,dt_Last_Updated_Date VARCHAR2,
StrMonth1 VARCHAR2,strMth2 VARCHAR2,StrMth3 VARCHAR2,StrMth4 VARCHAR2,
StrMth5 VARCHAR2,StrMth6 VARCHAR2,Sample VARCHAR2)
RETURN VARCHAR2 IS
type Month_type is table of varchar(10) index by binary_integer;
str_month Month_Type;
Fac_ID VARCHAR2(20);
Org_ID VARCHAR2(20);
v_Fac_ID VARCHAR2(20);
v_Org_ID VARCHAR2(20);
Cnt_Number NUMBER;
i_POS NUMBER;
i_Month NUMBER;
i_UNIT NUMBER;
v_Count NUMBER;
i_Count NUMBER;
count_no NUMBER;
str_message varchar2(200);
tb_Spec_ID varChar2(20);
BEGIN
Select tblspecification.Spec_id into tb_Spec_ID
from tblspecification inner join tblrelease_xref
on tblspecification.spec_id = tblrelease_xref.spec_id
where tblspecification.spec_code = Product_code
And tblrelease_xref.release_id = APD_Get_Release_ID(str_PDC, str_Release_Id);
IF TRIM(tb_Spec_ID) IS NOT NULL THEN
IF Product_id <> tb_Spec_ID THEN
str_Message := 'Mismatch:Spec Id and Product Code not matching';
DBMS_OUTPUT.PUT_LINE(STR_MESSAGE);
RETURN str_Message;
END IF;
ELSE
str_Message := 'Spec_ID not found';
RETURN str_Message;
END IF;
-- dbms_output.put_line('hi1' );
IF TRIM(str_Message) IS NULL then
SELECT COUNT(*) INTO v_count
FROM TBLLINE_ADOPT_PLAN
WHERE SPEC_ID = Product_ID
AND ADOPT_GROUP = str_Adpt_Grp
AND ADOPT_TYPE = str_Adpt_Type
AND RELEASE_ID = APD_Get_Release_ID(str_PDC,str_Release_ID);
Count_No := v_count;
IF Count_No = 0 THEN
INSERT INTO TBLLINE_ADOPT_PLAN
(SPEC_ID,ADOPT_GROUP,ADOPT_TYPE,RELEASE_ID,SAMPLES,
CREATED_BY,CREATED_DATE,LAST_UPDATED_BY,LAST_UPDATED_DATE,SAMPLE_ONLY_IND, GRID_TYPE_CD) VALUES
(Product_ID,str_Adpt_Grp ,str_Adpt_Type,
APD_Get_Release_ID(str_PDC,str_Release_Id),0,str_Created_By,
TO_DATE(dt_Created_Date,'DD/MM/YYYY'),str_Last_Updated_By,
TO_DATE(dt_Last_Updated_Date,'DD/MM/YYYY'),'N','C');
COMMIT;
END IF;
str_Month(1) := strMonth1;
str_Month(2) := strMth2;
str_Month(3) := strMth3;
str_Month(4) := strMth4;
str_Month(5) := strMth5;
str_Month(6) := strMth6;
SELECT FACILITY_ID INTO v_Fac_ID
FROM TBLADOPT_GROUP_CSC
WHERE ADOPT_GROUP = str_Adpt_Grp;
Fac_ID := v_Fac_ID;
SELECT ORG_ID INTO Org_ID
FROM APD_DV_PRODUCT_V
WHERE SPEC_ID = Product_ID;
ORG_ID := v_ORG_ID;
SELECT COUNT(*) INTO v_Count
FROM TBLPROD_CSC
WHERE PROD_SPEC_ID = Product_ID;
IF Count_No = 0 THEN
INSERT INTO TBLPROD_CSC(PROD_SPEC_ID,CSC_FACILITY_ID,PROFIT_CENTER_CD,
DEFAULT_IND, CREATED_BY, CREATED_DATE, LAST_UPDATED_BY, LAST_UPDATED_DATE) VALUES
(Product_ID , Fac_ID,Org_id, 'N', str_Created_by ,To_date ( dt_Created_Date,'DD/MM/YYYY') ,
str_Last_updated_by , To_Date (dt_Last_Updated_Date ,'DD/MM/YYYY'));
COMMIT;
END IF;
FOR i_Count in 1..6 LOOP
i_Pos := Instr(str_month(i_Count),'-');
i_Month := TO_NUMBER(SUBSTR(str_Month(i_Count),1,i_Pos-1));
i_Unit := TO_NUMBER(SUBSTR(Str_Month(i_Count),i_Pos + 1));
Cnt_Number := GET_COUNT_UNITS(Product_ID,str_Adpt_Grp,str_Adpt_Type,str_Release_ID,str_PDC,str_Month(i_Count));
DBMS_OUTPUT.PUT_LINE(cNT_NUMBER);
IF Cnt_Number = 0 then
INSERT INTO TBLLINE_ADOPT_UNITS (SPEC_ID,ADOPT_GROUP,ADOPT_TYPE,MONTH,UNITS,CREATED_BY,
CREATED_DATE,LAST_UPDATED_BY,LAST_UPDATED_DATE) VALUES (Product_ID,str_Adpt_Grp,
str_Adpt_Type,i_Month,i_Unit,str_Created_By ,to_date(dt_Created_Date ,'DD/MM/YYYY'),
str_Last_Updated_By,to_date( dt_Last_Updated_Date ,'DD/MM/YYYY'));
COMMIT;
ELSIF Cnt_Number = 1 Then
UPDATE TBLLINE_ADOPT_UNITS A
SET A.UNITS = I_UNIT
WHERE A.SPEC_ID || A.ADOPT_GROUP IN
(SELECT B.SPEC_ID || B.ADOPT_GROUP
FROM TBLLINE_ADOPT_PLAN B
WHERE A.SPEC_ID = B.SPEC_ID AND
A.ADOPT_GROUP = B.ADOPT_GROUP AND
B.ADOPT_TYPE = str_Adpt_Type AND
B.ADOPT_GROUP = str_Adpt_Grp AND
B.SPEC_ID = Product_ID and
B.RELEASE_ID = APD_Get_Release_ID(str_PDC,str_Release_Id ) AND
A.MONTH = i_Month);
COMMIT;
ELSE
str_Message := 'Record count more than one';
RETURN str_Message;
END IF;
END LOOP;
IF TO_NUMBER(Sample) <> 0 Then
UPDATE TBLLINE_ADOPT_PLAN
SET SAMPLES = TO_NUMBER(Sample)
WHERE SPEC_ID = Product_ID AND
ADOPT_GROUP = str_Adpt_Grp AND
ADOPT_TYPE = str_Adpt_Type AND
RELEASE_ID = APD_Get_Release_ID(str_PDC,str_Release_Id);
COMMIT;
END IF;
str_Message := 'Updated';
END IF;
COMMIT;
DBMS_OUTPUT.PUT_LINE(STR_MESSAGE);
RETURN str_message;
END;
The problem is after I call this function from excel and after running when I check the table the record is not inserted.Pls help...Check the chapter on PL/SQL in http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf
The bottom of page 134 (in the current 1.4 version) has an example of calling a PL/SQL function.
-- cj
PS. General reminder to everyone, if you are using PHP 4.4, please upgrade the OCI8 code as also described in the manual above. -
How to get total number of rows return by query
hi all
i am using forms 6i with oracle 10G in windows environment....
i have a tabular form now i want to know that how many rows return by the query...like when user click on enter query and then give any search criteria and then execute query..it displays the records but i want to count the records that how many rows are return.............
hope you understant what i mean
Thanks in advance
RegardsU can use
"Select count(*) from <table> where <condition>"
<condition> is the where clause being used during "Execute Query"
this will give u the no of records in query.
And second option is to take a summary column. whose function is set "COUNT" and
"Summarized item" should contain a column that will never be blank. After execute query this column will give u no of records in block.
Regards.... -
No rows returned when using sql in XQuery.
Hi all,
I have a small table on a db with seven cols and three rows. I am doing the following xquery, but the db is returning an empty rowset when I know there sould be 3.
<WebPage>
for $i in sqlquery("select * from project")/row
return
<project>
{$i/title}
{$i/image}
{$i/icon}
{$i/version}
{$i/start_date}
{$i/home}
{$i/address}
</project>
</WebPage>
There is no problem with the db connection, as it is one I have used before for doing plain sql searches remotely. Does any one know why this would be happening?
Regards,
SimonHi Bart,
try this.....
To execute such XQuery queries that use the sqlquery function, you would need to initialize the Java connection information in the XQueryContext before executing the query. For example, your Java program would be something like this,
// get the connection (for example, using the thick JDBC Driver)
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc:oracle:@","scott","tiger");
// create a context using that connection..
XQueryContext ctx = new XQueryContext(conn);
// create a string from the file
Reader strm = new StringReader(
"FOR $i IN sqlquery(\"select * from scott.emp\")/ROW "+
" RETURN <EMP empno=\"{$i/EMPNO}\">$i/ENAME,$i/SALARY</EMP>");
// prepare the query
PreparedXQuery xq = ctx.prepareXQuery(strm);
// get a resultset
XQueryResultSet rset = xq.executeQuery();
while (rset.next())
XMLNode node = rset.getNode(); // get result nodes
System.out.println(" NODE "+ node.getNodeName());
node.print(System.out);
source:==>http://otn.oracle.com/sample_code/tech/xml/xmldb/jxqi.html
Good luck
Achim -
No rows returned in the BIS views
I am new to Discoverer. I had connected to Financials Intelligence responsibility using discoverer desktop. When I tried to create a workbook in General Ledger Business Area to display the GL accounts, I get no rows returned message. I get the same message for any kind of report I try to create not only in GL business area but also in any of the seeded business areas provided by the Oracle. I can query it in toad and see the data but it is not retrieved in discoverer. what could be the problem? is there any profile options to be setup for my username or am I missing something?
Any help is greatly appreciated
ThanksHere's the metalink note for those interested.
It's basically laying out all the steps to setup the info in Oracle Apps as alluded to by Simon and then perform a complete refresh of the BIS views in the database, bring in the new .eex file for changes, etc.
Russ
===========================================================
Applies to: Oracle Discoverer - Version: 10.1.2.48.18
This problem can occur on any platform.
Oracle Applications 11.5.10.2
Oracle Applications Concurrent Manager SymptomsUnable to retrieve any data on standard General Ledger (GL) business areas and standard workbooks after migrating the EUL from Discoverer 4.1 to 10.1.2 and upgrading Oracle Applications to 11.5.10.2.
These same workbooks and business areas worked fine before the upgrade to Discoverer 10.1.2.
A custom business area and custom workbooks return data, but none of the standard pre-seeded "BIS" or "Financials Intelligence General Ledger (GL) business areas return data when testing in Discoverer Plus, Viewer or Desktop.
ChangesMigrated the Discoverer EUL and Oracle Application Server environment from Discoverer 4.1.48.08 to 10.1.2.48.18. CauseIncomplete setup of Oracle E-Business Suite and Discoverer environment for Business Intelligence (BIS) and/or Financials Intelligence, including missing profile options for Oracle Applications Administrator and custom Super User responsibility.
SolutionTo implement the solution, please execute the following steps:
1. Login to Oracle Applications Systems Administration function as SYSADMIN user and set the profile option as described below:
a. Profile > System
b. Check the 'Site', 'Responsibility' and 'Profiles with No Values' checkboxes
c. Enter "Applications Administration' in 'Responsibility' field
d. Enter FII: GL BIS Discoverer access (if it does not display the profile option, please try wildcard option "FII%GL%BIS%" )
e. Then in the next screen, select 'Yes' from LOV under 'Site' and 'Responsibility' column
f. Save the settings
g. Again repeat the same steps for custom responsibility "My_Company General Ledger Super User"
2. Complete/confirm the following steps from Note 313418.1, Section 6, Post Installation Tasks
a) Step 4. Regenerate your Business Views - done throughNote 313418.1, Section 6, Post Installation Tasks
a) Step 4. Regenerate your Business Views - done through Oracle Applications Concurrent Manager as SYSADMIN user with the "Business Views Setup" responsibility.
b) Recommend all steps under 4 and steps under 5
c) Step 8. Refresh the Discoverer 10.1.2 End User Layer - via SYSADMIN user/responsibility - as described in note
d) Step 9 -> Need to make sure Applications Administrator responsibility has all
security and access to the EUL and business areas. Be sure to grant to responsibility
rather than SYSADMIN user since the "Applications Administrator" responsibility is used to perform Discoverer Administration tasks.
$ORACLE_HOME/bin/eulapi \
-CONNECT <EUL schema>/<password>@<db> \
-GRANT_PRIVILEGE \
-ROLE "Applications Administrator" \
-PRIVILEGE all_admin_privs
$ORACLE_HOME/bin/eulapi \
-CONNECT <EUL schema>/<password>@<db> \
-GRANT_PRIVILEGE \
-ROLE "Applications Administrator" \
-PRIVILEGE all_user_privs
AND
$ORACLE_HOME/bin/eulapi \
-CONNECT <EUL schema>/<password>@<db> \
-GRANT_PRIVILEGE \
- ROLE "Applications Administrator" \
-BUSINESS_AREA_ADMIN_ACCESS % \
-WILDCARD \
-LOG <log file name>
Note: The above commands need to be in one continuous line. For Unix/Linux, you may separate lines with continuation character "\"
3. Once all steps have been completed, the standard General Ledger (GL) workbooks and newly created workbooks based on standard GL usiness areas will return data.
Note: If you are unsure if you are encountering this specific issue, it is always beneficial to test the data via SQL using the same Oracle E-Business Suite user and responsibility.
The following reference will guide you how to accomplish this:
Note 279736.1 'How To Run SQL From An Apps Mode Discoverer Workbook In SQL*PLUS'
ReferencesNote 313418.1 - Using Discoverer 10.1.2 with Oracle E-Business Suite 11i
Note 279736.1 - How To Run SQL From An Apps Mode Discoverer Workbook In SQL*PLUS
Keywords'BUSINESS~AREA' 'PROFILES-SYSTEM' 'FII~~GL~BIS~DISCOVERER~ACCESS' 'DISCOVERER~4.1.48.08' 'BUSINESS~VIEWS' 'UPGRADE~TO~11.5.10.2' 'PROFILES-SYSTEM' 'UPGRADE~TO~10.1.2'
-------------------------------------------------------------------------------- -
Hi,
i m having difficulties numbering the rows returned..
im using rownum function, but it returns me duplicate records even after i distinct it.
and also it doesnt start from 0
ANy other way to number the row ?
EDIT: using oracle function : ROW_NUMBER() also give me the same issue
Edited by: Sosys on Dec 17, 2008 11:50 AMTHE query is big..
it's difficult to post and impossible to test by you..
just assume this :
NAME PHONE LOCATIOn
JOHN 111 NY
JOHN 111 NY
MARK 112 NJ
MARK 112 NJ
CAT 113 WA
and i want to put number from 1,2,3,4,5 in front..
NO NAME PHONE LOCATIOn
1 JOHN 111 NY
2 JOHN 111 NY
3 MARK 112 NJ
4 MARK 112 NJ
5 CAT 113 WA
How u do this ?
i used this :rank() over( order by NAME desc) NO,
and it will give me:
NO NAME PHONE LOCATIOn
1 JOHN 111 NY
1 JOHN 111 NY
2 MARK 112 NJ
2 MARK 112 NJ
3 CAT 113 WA
How to make it number from 1 to 5 ?
Thans. -
How to Customize the Message "No Row Returned" from a Report
Hi,
I've been trying to customize the Message "No Row Returned" from a Report.
First i followed the instructions in Note:183131.1 -
How to Customize the Message "No Row Returned" from a Report
But of course the OWA_UTIL.REDIRECT_URL in this solution did not work (in a portlet) and i found the metalink document 228620.1 which described how to fix it.
So i followed the "fix" in the document above and now my output is,..
"Portlet 38,70711 responded with content-type text/plain when the client was requesting content-type text/html"
So i search in Metalink for the above and come up with,...
Bug 3548276 PORTLET X,Y RESPONDED WITH CONTENT-TYPE TEXT/PLAIN INSTEAD OF TEXT/HTML
And i've read it and read it and read it and read it and can't make heads or tails of what it's saying.
Every "solution" seems to cause another problem that i have to fix. And all i want to do is customize the Message "No Row Returned" from a Report. Please,...does anyone know how to do this?My guess is that it only shows the number of rows it has retrieved. I believe the defailt is for it to only retrieve 50 rows and as you page through your report it retrieves more. So this would just tell you how many rows was retireved, but probably not how many rows the report would contain if you pages to the end. Oracle doesn't really have a notion of total number of rows until the whole result set has been materialized.
-
How to get the number of rows returned by a report?
Hi,
I'm developing my first application in APEX and so far everything seems fine, except I can't figure out this very simple thing: I have a report based on a PL/SQL block returning an SQL string. I'd like to have a message (something like "X rows returned") just before the report. The closest thing I could find was "X to Y out of Z" in the pagination styles, but that's not what I want. Also I don't think running the same query to get COUNT() is wise.
Any help would be appreciated.
Thanks,
KonstantinMy guess is that it only shows the number of rows it has retrieved. I believe the defailt is for it to only retrieve 50 rows and as you page through your report it retrieves more. So this would just tell you how many rows was retireved, but probably not how many rows the report would contain if you pages to the end. Oracle doesn't really have a notion of total number of rows until the whole result set has been materialized.
-
Why doesn't my XMLTable function work?
Hi,
I'm trying to read through my XML document using a XMLTable function, because a repetition of elements might occur. I wrote a SQL-script to test this function, but it does not give me the desired output. This is my script. I use a dummy table PETER_XML to pass the value to the XMLTable function. I would rather have done this directly with a PL/SQL variable, but that did not work.
CREATE TABLE PETER_XML (AVY XMLTYPE);
set serveroutput on size 100000
set echo on
set feedback on
declare
cursor c_avy is
SELECT XMLRESPONSE."DepartureStation" DEPARTURE,
XMLRESPONSE."FlightNumber" FLIGHTNR
FROM PETER_XML,
XMLTABLE(XMLNameSpaces('http://schemas.navitaire.com/WebServices' as "web",
'http://schemas.xmlsoap.org/soap/envelope/' as "soapenv",
'http://schemas.navitaire.com/WebServices/ServiceContracts/BookingService' as "book",
'http://schemas.navitaire.com/WebServices/DataContracts/Booking' as "book1",
'http://schemas.microsoft.com/2003/10/Serialization/Arrays' as "arr",
'http://schemas.navitaire.com/WebServices/DataContracts/Common/Enumerations' as "enum",
'http://schemas.navitaire.com/WebServices/ServiceContracts/BookingService' as "ns0",
'http://schemas.navitaire.com/WebServices/DataContracts/Booking' as "ns1" ),
'//GetAvailabilityRequest/TripAvailabilityRequest/AvailabilityRequests/AvailabilityRequest'
PASSING PETER_XML.AVY
COLUMNS
"DepartureStation" varchar2(3) PATH 'DepartureStation',
"FlightNumber" varchar2(4) PATH 'FlightNumber'
) XMLRESPONSE;
l_response clob := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://schemas.navitaire.com/WebServices" xmlns:book="http://schemas.navitaire.com/WebServices/ServiceContracts/BookingService" xmlns:book1="http://schemas.navitaire.com/WebServices/DataContracts/Booking" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:enum="http://schemas.navitaire.com/WebServices/DataContracts/Common/Enumerations">
<soapenv:Header>
<web:Signature>bnuOiHCVb3k=|Gx+eTRcZ5ABozAy8MosBFwagyUw7zrRXf1iprmw9Q4W17wt8SDpjYV2HwZRGIHYtE46UFBJw/aFyKVqjToEAfSTfh7cePm4r9JJwcIveDc75NuxnzoY14pKC+WLYDzE0MaALra4i/tI=</web:Signature>
<web:ContractVersion>340</web:ContractVersion>
</soapenv:Header>
<soapenv:Body>
<ns0:GetAvailabilityRequest xmlns:ns0 = "http://schemas.navitaire.com/WebServices/ServiceContracts/BookingService">
<ns1:TripAvailabilityRequest xmlns:ns1 = "http://schemas.navitaire.com/WebServices/DataContracts/Booking">
<ns1:AvailabilityRequests>
<ns1:AvailabilityRequest>
<ns1:DepartureStation>AMS</ns1:DepartureStation>
<ns1:ArrivalStation>CTA</ns1:ArrivalStation>
<ns1:BeginDate>2013-07-13T00:00:00</ns1:BeginDate>
<ns1:EndDate>2013-07-13T00:00:00</ns1:EndDate>
<ns1:CarrierCode>HV</ns1:CarrierCode>
<ns1:FlightNumber> 547</ns1:FlightNumber>
<ns1:FlightType>All</ns1:FlightType>
<ns1:PaxCount>1</ns1:PaxCount>
<ns1:Dow>Daily</ns1:Dow>
<ns1:CurrencyCode>EUR</ns1:CurrencyCode>
<ns1:DisplayCurrencyCode>EUR</ns1:DisplayCurrencyCode>
<!--ns1:SourceOrganization>COO</ns1:SourceOrganization-->
<ns1:MaximumConnectingFlights>0</ns1:MaximumConnectingFlights>
<ns1:AvailabilityFilter>Default</ns1:AvailabilityFilter>
<ns1:ProductClassCode>NG</ns1:ProductClassCode>
<ns1:SSRCollectionsMode>None</ns1:SSRCollectionsMode>
<ns1:InboundOutbound>Both</ns1:InboundOutbound>
<ns1:NightsStay>0</ns1:NightsStay>
<ns1:IncludeAllotments>true</ns1:IncludeAllotments>
<ns1:FareTypes>
<ns2:string xmlns:ns2 = "http://schemas.microsoft.com/2003/10/Serialization/Arrays">T</ns2:string>
</ns1:FareTypes>
<ns1:PaxPriceTypes>
<ns1:PaxPriceType>
<ns1:PaxType>ADT</ns1:PaxType>
</ns1:PaxPriceType>
</ns1:PaxPriceTypes>
<ns1:JourneySortKeys>
<ns2:JourneySortKey xmlns:ns2 = "http://schemas.navitaire.com/WebServices/DataContracts/Common/Enumerations">EarliestDeparture</ns2:JourneySortKey>
</ns1:JourneySortKeys>
<ns1:IncludeTaxesAndFees>false</ns1:IncludeTaxesAndFees>
<ns1:FareRuleFilter>Default</ns1:FareRuleFilter>
<ns1:LoyaltyFilter>MonetaryOnly</ns1:LoyaltyFilter>
<ns1:TravelClassCodeList>
<ns2:string xmlns:ns2 = "http://schemas.microsoft.com/2003/10/Serialization/Arrays">Y</ns2:string>
</ns1:TravelClassCodeList>
</ns1:AvailabilityRequest>
</ns1:AvailabilityRequests>
<ns1:LoyaltyFilter>MonetaryOnly</ns1:LoyaltyFilter>
</ns1:TripAvailabilityRequest>
</ns0:GetAvailabilityRequest>
</soapenv:Body>
</soapenv:Envelope>';
begin
dbms_output.put_line ('Start');
insert into peter_xml (avy) values ( XMLTYPE(l_response) );
dbms_output.put_line ('Insert processed ' || to_char(sql%rowcount) || ' rows.' );
for r_avy in c_avy loop
dbms_output.put_line ( 'Departure ' || r_avy.departure || ' Flightno. ' || r_avy.flightnr );
end loop;
end;
rollback;
The script runs fine, but the problem is that I do not get any output form the cursor for-loop. When I address the elements using 'ns1:etc' I get an error, which suggests that the function is actually reading the XML. Since it gave no output, I started including all these XMLNameSpaces.
Can anyone let me know what I'm missing?
And if I can pass the value with a PL/SQL variable, it would save me the use of a dummy table. That would be nice.
Thanks in advance.
PeterHi Peter,
Since it gave no output, I started including all these XMLNameSpaces.
All these namespaces have meaning, don't include them blindly, but if you do, use them.
The main XQuery expression doesn't reference any of the necessary namespaces.
Here's a simplified version that gives the expected output.
Please note that I only use the namespaces I need to resolve the XQuery :
declare
cursor c_avy (p_xmlresponse in xmltype) is
select x.DEPARTURE
, x.FLIGHTNR
from xmltable(
xmlnamespaces(
'http://schemas.xmlsoap.org/soap/envelope/' as "soap"
, 'http://schemas.navitaire.com/WebServices/ServiceContracts/BookingService' as "ns0"
, 'http://schemas.navitaire.com/WebServices/DataContracts/Booking' as "ns1"
, '/soap:Envelope/soap:Body/ns0:GetAvailabilityRequest/ns1:TripAvailabilityRequest/ns1:AvailabilityRequests/ns1:AvailabilityRequest'
passing p_xmlresponse
columns
DEPARTURE varchar2(3) path 'ns1:DepartureStation'
, FLIGHTNR varchar2(4) path 'ns1:FlightNumber'
) x ;
l_response clob := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://schemas.navitaire.com/WebServices" xmlns:book="http://schemas.navitaire.com/WebServices/ServiceContracts/BookingService" xmlns:book1="http://schemas.navitaire.com/WebServices/DataContracts/Booking" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:enum="http://schemas.navitaire.com/WebServices/DataContracts/Common/Enumerations">
<soapenv:Header>
<web:Signature>bnuOiHCVb3k=|Gx+eTRcZ5ABozAy8MosBFwagyUw7zrRXf1iprmw9Q4W17wt8SDpjYV2HwZRGIHYtE46UFBJw/aFyKVqjToEAfSTfh7cePm4r9JJwcIveDc75NuxnzoY14pKC+WLYDzE0MaALra4i/tI=</web:Signature>
<web:ContractVersion>340</web:ContractVersion>
</soapenv:Header>
<soapenv:Body>
<ns0:GetAvailabilityRequest xmlns:ns0 = "http://schemas.navitaire.com/WebServices/ServiceContracts/BookingService">
<ns1:TripAvailabilityRequest xmlns:ns1 = "http://schemas.navitaire.com/WebServices/DataContracts/Booking">
<ns1:AvailabilityRequests>
<ns1:AvailabilityRequest>
<ns1:DepartureStation>AMS</ns1:DepartureStation>
<ns1:ArrivalStation>CTA</ns1:ArrivalStation>
<ns1:BeginDate>2013-07-13T00:00:00</ns1:BeginDate>
<ns1:EndDate>2013-07-13T00:00:00</ns1:EndDate>
<ns1:CarrierCode>HV</ns1:CarrierCode>
<ns1:FlightNumber> 547</ns1:FlightNumber>
<ns1:FlightType>All</ns1:FlightType>
<ns1:PaxCount>1</ns1:PaxCount>
<ns1:Dow>Daily</ns1:Dow>
<ns1:CurrencyCode>EUR</ns1:CurrencyCode>
<ns1:DisplayCurrencyCode>EUR</ns1:DisplayCurrencyCode>
<!--ns1:SourceOrganization>COO</ns1:SourceOrganization-->
<ns1:MaximumConnectingFlights>0</ns1:MaximumConnectingFlights>
<ns1:AvailabilityFilter>Default</ns1:AvailabilityFilter>
<ns1:ProductClassCode>NG</ns1:ProductClassCode>
<ns1:SSRCollectionsMode>None</ns1:SSRCollectionsMode>
<ns1:InboundOutbound>Both</ns1:InboundOutbound>
<ns1:NightsStay>0</ns1:NightsStay>
<ns1:IncludeAllotments>true</ns1:IncludeAllotments>
<ns1:FareTypes>
<ns2:string xmlns:ns2 = "http://schemas.microsoft.com/2003/10/Serialization/Arrays">T</ns2:string>
</ns1:FareTypes>
<ns1:PaxPriceTypes>
<ns1:PaxPriceType>
<ns1:PaxType>ADT</ns1:PaxType>
</ns1:PaxPriceType>
</ns1:PaxPriceTypes>
<ns1:JourneySortKeys>
<ns2:JourneySortKey xmlns:ns2 = "http://schemas.navitaire.com/WebServices/DataContracts/Common/Enumerations">EarliestDeparture</ns2:JourneySortKey>
</ns1:JourneySortKeys>
<ns1:IncludeTaxesAndFees>false</ns1:IncludeTaxesAndFees>
<ns1:FareRuleFilter>Default</ns1:FareRuleFilter>
<ns1:LoyaltyFilter>MonetaryOnly</ns1:LoyaltyFilter>
<ns1:TravelClassCodeList>
<ns2:string xmlns:ns2 = "http://schemas.microsoft.com/2003/10/Serialization/Arrays">Y</ns2:string>
</ns1:TravelClassCodeList>
</ns1:AvailabilityRequest>
</ns1:AvailabilityRequests>
<ns1:LoyaltyFilter>MonetaryOnly</ns1:LoyaltyFilter>
</ns1:TripAvailabilityRequest>
</ns0:GetAvailabilityRequest>
</soapenv:Body>
</soapenv:Envelope>';
begin
for r_avy in c_avy (xmltype(l_response)) loop
dbms_output.put_line ( 'Departure ' || r_avy.departure || ' Flightno. ' || r_avy.flightnr );
end loop;
end;
Indeed, you don't need an intermediate table for this requirement. However, and depending on your db version, storing the XML in a binary XMLType table may improve performance dramatically.
For small contents, you probably won't see a difference between the two approaches, but just so you know in case you have to deal with big XMLs in the future. -
How can I limit the number of rows returned by a select stat
How can I limit the number of rows returned by a select
statement. I have a query where I return the number of stores
that are located in a given area.. I only want to return the
first twenty-five stores. In some instances there may be over
200 stores in a given location.
I know is SQL 7 that I can set the pagesize to be 25....
Anything similiar in Oracle 8i?
nullDebbie (guest) wrote:
: Chad Nale (guest) wrote:
: : How can I limit the number of rows returned by a select
: : statement. I have a query where I return the number of
: stores
: : that are located in a given area.. I only want to return the
: : first twenty-five stores. In some instances there may be
: over
: : 200 stores in a given location.
: : I know is SQL 7 that I can set the pagesize to be 25....
: : Anything similiar in Oracle 8i?
: If you are in Sql*Plus, you could add the statement
: WHERE rownum <= 25
: Used together with an appropriate ORDER BY you
: could get the first 25 stores.
Watch out. ROWNUM is run before ORDER BY so this would only
order the 25 selected
null
Maybe you are looking for
-
How to reduce Notification popup display time?
I have Notifiation center set to show banners. When I get a notification, an alert (pop up) appears in the upper right of the screen. The alert hangs around for a while. Seems like every time one of these displays, I need access to the area it is
-
Finding Font and Fontsize which fits in a Rectangle
I'm making a custom game which is made of several Rectangles of different size. All rectangles contains a String i.e "Blaster", "Monster Blue" and so on. I have made a zoom-function which zooms in on a special area the user selcts. All the Rectangles
-
Iphone 4 calendar closes after going forward three months
Hi there, I am puzzled by the fact that when I use the calendar on my iphone, I can only look three months in advance. If I click to go forward another month, the application closes and returns me to the home screen. Is there a way that I can set thi
-
Hi, i am using ColdFusion 8 on a Windows 2003 Server (R2). Locale of the operating system is Turkish. As usual with any java application server, in order to start ColdFusion server, i have to use -Duser.language=tr_TR JVM parameter (by modifying argu
-
Unable to add to existing network
I am trying to "add to an existing network", however, it keeps reverting back to creating a NEW network when I click 'next'. HELP? Also ... under PPPoE ... is the account name and password what I require to access my ISP? THANK YOU!