Multiple Queries Slower
I am having an issue where the performance slows down drastically if i have multiple queries ( Running around 4 queries ) running at the same time. The performance is good when i have only one query running.
When i run the queries individually one after an another it takes about 10 secs for each of them to return.
When i run the queries together then it take more than a couple of minutes for all of them to return.
Any tips suggestions for any changes in oracle parameters to improve performance, when multiple queries are running at the same time. Another thing, the CPU is not being used to its full capacity. The CPU is somewhere in the 10 to 20% usage.
Thanks,
Jay.
Jayachandra, I think there is a good chance you need to tune one or more of the queries in question as they are probably running poorly using more resources than necessary. Individually they seem OK because total time is short but when combined the poor resource utilization is showing up.
If running CBO
run an explain plan on each query.
update the statistics
re-run the explain plans and look for differences
If different retime the queries, you may already be done
If not different or you spot something that looks wrong such as a full table scan where you think an index should be used then follow standard tuning practice to see what you can get.
Then once you know the SQL are as good as they are going to get look at the buffer pool to make sure it is just not too small. Many DBA just immediately make the buffer pool bigger if query performance is not good enough, however, this is usually not the correct solution and I believe you should never over-allocate resources because you might need them somewhere else.
HTH -- Mark D Powell --
Similar Messages
-
Report with Multiple queries too slow in BI Publisher 11g
Hi, I have a report in 11g where i need to create multiple queries to show them in report. I tried to combine everything in one query, but i found that the query is too huge and hard to understand and maintain. I created 3 data sets and linked them together. In SQL dev, the main query is returning about 315 records and first detail query returns less than 100 records and second detail query is returning one record which is BLOB. Each query returns data within a couple of seconds from SQL Developer. The entire report from BI Publisher should be just 21 page PDF output. Did anyone face performance issues while running reports with multiple queries in 11g? I ran reports that have single query which returned 10K pages PDF and never had an issue while everthing is in one query. This is the first time Iam attempting to create multiple queries. Can someone help me understand what i might be doing wrong or missing here. Thank you.
Isn't there a way for you to do this via a Package/Procedure versus having multiple queries?
Per the BI Publisher guide,
Following are recommended guidelines for building data models:
Reduce the number of data sets or queries in your data model as much as possible. In general, the fewer data sets and queries you have, the faster your data model will run. While multiquery data models are often easier to understand, single-query data models tend to execute more quickly. It is important to understand that in parent-child queries, for every parent, the child query is executed.
You should only use multiquery data models in the following scenarios:
To perform functions that the query type, such as a SQL query, does not support directly.
To support complex views (for example, distributed queries or GROUP BY queries).
To simulate a view when you do not have or want to use a view.
Thanks,
Bipuser -
Multiple Queries in Workbook - Refresh Screen Shows Up for Every Query
We have multiple queries in a workbook. All of these queries have the exact same selections for the variable selection screen. When all the queries are refreshed once, the selection screen used to show up once and all the queries are refreshed with the same selections.
We were on BI 7.0 and SP10. We recently moved to SP12. Since the SP12 installation, the multiple query refresh pops-up the selection screen for every query. It is nothing like "multiple query refresh" at once since the user has to click "execute" button for every single query. It is interesting to note that the selection screen only contains hierarchy variables and hierarchy node variables. The other variables of selection screen do not show up. I couldn't find any OSS note on this topic. Please let me know if anyone has any comments on this issue. I will assign points to useful posts.hi Sameer,
try to update front end patch to latest version ?
Using the BI 7.x Add-On for SAP GUI 7.10 - Requirements
hope this helps. -
Multiple queries in reports with XSL-FO and without BI Publisher
Hello,
I'm trying to find out how to create a complex report in APEX for printing. The report contains multiple queries in different layout, images and static text.
I don't have the possibility to use BI Publisher and I'm not an XSL-FO expert. However I'm trying to find out if it's possible at all not using BI Publisher.
I'm having the impression that multiple report queries and layouts in APEX can only be used in combination with BI Publisher. I'd be glad if someone could give me an example of how to do multiple queries and layout in a single report only using XSL-FO.
Thanks in advance,
Jan WillemHello,
I'm trying to find out how to create a complex report in APEX for printing. The report contains multiple queries in different layout, images and static text.
I don't have the possibility to use BI Publisher and I'm not an XSL-FO expert. However I'm trying to find out if it's possible at all not using BI Publisher.
I'm having the impression that multiple report queries and layouts in APEX can only be used in combination with BI Publisher. I'd be glad if someone could give me an example of how to do multiple queries and layout in a single report only using XSL-FO.
Thanks in advance,
Jan Willem -
Multiple Queries on Interactive Report
hi all,
Can i run multiple queries based on some condition in creating an interactive report?? I mean
i want to run a single query as
if :P12_QUERY == 1 then
first query
else if :P12_QUERY == 2 then
second query
end if;
Please provide me the syntax if its possible. Plz help me in this regard.
With Regards,
Sunil BhatiaHello,
You will need to create a pipeline function and use it in your query. But both your queries have to return the same dataset.
Example:
function choose_query(v_query_type integer) return some_type pipelined
is
v_query varchar2(4000);
v_cur sys_refcursor;
v_row some_type;
begin
if :P12_QUERY == 1 then
v_query := 'select ....';
else if :P12_QUERY == 2 then
v_query := 'select ....';
end if;
open v_cur for v_query;
loop
v_row := some_type(null, null, null);
fetch v_cur into v_row;
exit when v_cur%notfound;
pipe row (v_row);
end loop;
close v_cur;
end;In interactive report you have to set query:
select * from table(choose_query(:P12_QUERY ))
Best Regards, Kostya Proskudin -
How to execute multiple queries in one stored procedure.
Hi,
I am Kumar,
How to execute multiple queries in one stored procedure.
here is the my requirements,
1. get the max value from one table and sum of the that value.
2. insert the values and also sum of the max value.
using stored procedure
I am using SQL server 2000 database.
Please help me.
Advance thanks
by,
KumarThis is not a java question and it is not even a problem: your only problem is
1) lack of knowledge
2) lack of interest to find a manual
But you are going to have to change both by actually reading a book or a manual that explains the stored procedure language of SQL Server. It is the same as Sybase I think, so you could also look for a manual for that DBMS. -
Bursting a report with multiple queries
Hi,
I need to set-up bursting in BIP for a report with multiple queries. The output format is pdf and delivery is through e-mail. Since the queries need to be linked, I'm trying to do this using data template. I've set-up split and burst based on a field (store_id) from the first query which is used as a bind variable in the subsequent queries. So I'd ideally want the report to be split based on store_id. The report works fine if I use a parameter for store_id and view the output by store_id. When I try to schedule the report for bursting, it generates and e-mails the reports but only the last report appears to have correct data output while the others have only the output from the first query (and all other queries appear to return nothing in the report).
Any suggestions on what could be the issue here? Thanks!
Here is the data template for the report:
<dataTemplate name="Report" description="Report" dataSourceRef="ReportDB">
<dataQuery>
<sqlStatement name="STORE_VENDOR">
<![CDATA[SELECT STORE.STORE_ID Q1_STORE_ID, VENDOR.VENDOR_ID Q1_VENDOR_ID, VENDOR.VENDOR_DESC Q1_VENDOR_DESC, PERSON.NAME Q1_NAME
FROM STORE, SERVICE_TICKET, VENDOR, ROLE, ROLE_TYPE, PERSON, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
WHERE (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
AND (SERVICE_TICKET.SOURCE_ID = VENDOR.SOURCE_ID AND SERVICE_TICKET.VENDOR_ID = VENDOR.VENDOR_ID)
AND (STORE.SOURCE_ID = ROLE.SOURCE_ID AND STORE.STORE_ID = ROLE.STORE_ID)
AND (ROLE.SOURCE_ID = ROLE_TYPE.SOURCE_ID AND ROLE.ROLE_TYPE_ID = ROLE_TYPE.TYPE_ID AND ROLE_TYPE.TYPE_DESC = 'PIC')
AND (ROLE.SOURCE_ID = PERSON.SOURCE_ID AND ROLE.PERSON_ID = PERSON.PERSON_ID)
AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
GROUP BY STORE.STORE_ID, VENDOR.VENDOR_ID, VENDOR.VENDOR_DESC, PERSON.NAME
ORDER BY STORE.STORE_ID]]>
</sqlStatement>
<sqlStatement name="WO">
<![CDATA[SELECT STORE.STORE_ID Q3_STORE_ID, 'Nightly Cleaning' Q3_NIGHTLY_CLEANING, 'Nightly Cleaning' Q3_DESCRIPTION, SERVICE_TICKET.TICKET_ID Q3_TICKET_ID, TO_CHAR(SERVICE_TICKET.END_DATE, 'MM/DD/YYYY') Q3_END_DATE, 'Excellent' Q3_QUALITY_RATING_1, 'Satisfactory' Q3_QUALITY_RATING_2, 'Unsatisfactory' Q3_QUALITY_RATING_3
FROM SERVICE_TICKET, STORE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
WHERE (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
AND STORE.STORE_ID = :Q1_STORE_ID
AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4']]>
</sqlStatement>
<sqlStatement name="SERVC_TYPE_1">
<![CDATA[SELECT STORE.STORE_ID Q4_STORE_ID, ZONE.ZONE_DESC Q4_ZONE_DESC, SERVICE_TICKET_LINE.SERVICE_COST Q4_SERVICE_COST, SERVICE_TICKET_LINE.TICKET_ID Q4_TICKET_ID, TO_CHAR(SERVICE_TICKET_LINE.WO_END_DATE, 'MM/DD/YYYY') Q4_WO_END_DATE, 'Excellent' Q4_QUALITY_RATING_1, 'Satisfactory' Q4_QUALITY_RATING_2, 'Unsatisfactory' Q4_QUALITY_RATING_3
FROM SERVICE_TICKET_LINE, SERVICE_TICKET, STORE, SERVICE_TYPE, ZONE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
WHERE (SERVICE_TICKET.SOURCE_ID = SERVICE_TICKET_LINE.SOURCE_ID AND SERVICE_TICKET.TICKET_ID = SERVICE_TICKET_LINE.TICKET_ID)
AND (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
AND (SERVICE_TICKET_LINE.SOURCE_ID = SERVICE_TYPE.SOURCE_ID AND SERVICE_TICKET_LINE.SERVICE_TYPE_ID = SERVICE_TYPE.TYPE_ID)
AND (SERVICE_TICKET_LINE.SOURCE_ID = ZONE.SOURCE_ID AND SERVICE_TICKET_LINE.ZONE_ID = ZONE.ZONE_ID)
AND SERVICE_TYPE.TYPE_DESC = 'ABC'
AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
AND STORE.STORE_ID = :Q1_STORE_ID
AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
ORDER BY SERVICE_TICKET_LINE.SOURCE_ID, SERVICE_TICKET_LINE.TICKET_ID, SERVICE_TICKET_LINE.LINE_ID]]>
</sqlStatement>
<sqlStatement name="SERVC_TYPE_2">
<![CDATA[SELECT STORE.STORE_ID Q5_STORE_ID, ZONE.ZONE_DESC Q5_ZONE_DESC, SERVICE_TICKET_LINE.SERVICE_COST Q5_SERVICE_COST, SERVICE_TICKET_LINE.TICKET_ID Q5_TICKET_ID, TO_CHAR(SERVICE_TICKET_LINE.WO_END_DATE, 'MM/DD/YYYY') Q5_WO_END_DATE, 'Excellent' Q5_QUALITY_RATING_1, 'Satisfactory' Q5_QUALITY_RATING_2, 'Unsatisfactory' Q5_QUALITY_RATING_3
FROM SERVICE_TICKET_LINE, SERVICE_TICKET, STORE, SERVICE_TYPE, ZONE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
WHERE (SERVICE_TICKET.SOURCE_ID = SERVICE_TICKET_LINE.SOURCE_ID AND SERVICE_TICKET.TICKET_ID = SERVICE_TICKET_LINE.TICKET_ID)
AND (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
AND (SERVICE_TICKET_LINE.SOURCE_ID = SERVICE_TYPE.SOURCE_ID AND SERVICE_TICKET_LINE.SERVICE_TYPE_ID = SERVICE_TYPE.TYPE_ID)
AND (SERVICE_TICKET_LINE.SOURCE_ID = ZONE.SOURCE_ID AND SERVICE_TICKET_LINE.ZONE_ID = ZONE.ZONE_ID)
AND SERVICE_TYPE.TYPE_DESC = 'XYZ'
AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
AND STORE.STORE_ID = :Q1_STORE_ID
AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
ORDER BY SERVICE_TICKET_LINE.SOURCE_ID, SERVICE_TICKET_LINE.TICKET_ID, SERVICE_TICKET_LINE.LINE_ID]]>
</sqlStatement>
<sqlStatement name="SERVC_TYPE_3">
<![CDATA[SELECT STORE.STORE_ID Q6_STORE_ID, ZONE.ZONE_DESC Q6_ZONE_DESC, 'Excellent' Q6_QUALITY_RATING_1, 'Satisfactory' Q6_QUALITY_RATING_2, 'Unsatisfactory' Q6_QUALITY_RATING_3, 'One' Q6_QTY_MISSING_1, 'Two' Q6_QTY_MISSING_2, '3 or More' Q6_QTY_MISSING_3
FROM SERVICE_TICKET_LINE, SERVICE_TICKET, STORE, SERVICE_TYPE, ZONE, PERIOD PERIOD_FROM, PERIOD PERIOD_TO
WHERE (SERVICE_TICKET.SOURCE_ID = SERVICE_TICKET_LINE.SOURCE_ID AND SERVICE_TICKET.TICKET_ID = SERVICE_TICKET_LINE.TICKET_ID)
AND (SERVICE_TICKET.SOURCE_ID = STORE.SOURCE_ID AND SERVICE_TICKET.STORE_ID = STORE.STORE_ID)
AND (SERVICE_TICKET_LINE.SOURCE_ID = SERVICE_TYPE.SOURCE_ID AND SERVICE_TICKET_LINE.SERVICE_TYPE_ID = SERVICE_TYPE.TYPE_ID)
AND (SERVICE_TICKET_LINE.SOURCE_ID = ZONE.SOURCE_ID AND SERVICE_TICKET_LINE.ZONE_ID = ZONE.ZONE_ID)
AND SERVICE_TYPE.TYPE_DESC = 'PQR'
AND SERVICE_TICKET.START_DATE BETWEEN PERIOD_FROM.START_DATE AND PERIOD_TO.END_DATE
AND STORE.STORE_ID = :Q1_STORE_ID
AND PERIOD_FROM.PERIOD_DESC = 'Cal Week 1'
AND PERIOD_TO.PERIOD_DESC = 'Cal Week 4'
ORDER BY SERVICE_TYPE.TYPE_ID]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_STORE_VENDOR" source="STORE_VENDOR">
<element name="Q1_STORE_ID" value="Q1_STORE_ID"/>
<element name="Q1_VENDOR_ID" value="Q1_VENDOR_ID"/>
<element name="Q1_VENDOR_DESC" value="Q1_VENDOR_DESC"/>
<element name="Q1_NAME" value="Q1_NAME"/>
</group>
<group name="G_WO" source="WO">
<element name="Q3_NIGHTLY_CLEANING" value="Q3_NIGHTLY_CLEANING"/>
<element name="Q3_DESCRIPTION" value="Q3_DESCRIPTION"/>
<element name="Q3_TICKET_ID" value="Q3_TICKET_ID"/>
<element name="Q3_END_DATE" value="Q3_END_DATE"/>
<element name="Q3_QUALITY_RATING_1" value="Q3_QUALITY_RATING_1"/>
<element name="Q3_QUALITY_RATING_2" value="Q3_QUALITY_RATING_2"/>
<element name="Q3_QUALITY_RATING_3" value="Q3_QUALITY_RATING_3"/>
</group>
<group name="G_SERVC_TYPE_1" source="SERVC_TYPE_1">
<element name="Q4_ZONE_DESC" value="Q4_ZONE_DESC"/>
<element name="Q4_SERVICE_COST" value="Q4_SERVICE_COST"/>
<element name="Q4_TICKET_ID" value="Q4_TICKET_ID"/>
<element name="Q4_WO_END_DATE" value="Q4_WO_END_DATE"/>
<element name="Q4_QUALITY_RATING_1" value="Q4_QUALITY_RATING_1"/>
<element name="Q4_QUALITY_RATING_2" value="Q4_QUALITY_RATING_2"/>
<element name="Q4_QUALITY_RATING_3" value="Q4_QUALITY_RATING_3"/>
</group>
<group name="G_SERVC_TYPE_2" source="SERVC_TYPE_2">
<element name="Q5_ZONE_DESC" value="Q5_ZONE_DESC"/>
<element name="Q5_SERVICE_COST" value="Q5_SERVICE_COST"/>
<element name="Q5_TICKET_ID" value="Q5_TICKET_ID"/>
<element name="Q5_WO_END_DATE" value="Q5_WO_END_DATE"/>
<element name="Q5_QUALITY_RATING_1" value="Q5_QUALITY_RATING_1"/>
<element name="Q5_QUALITY_RATING_2" value="Q5_QUALITY_RATING_2"/>
<element name="Q5_QUALITY_RATING_3" value="Q5_QUALITY_RATING_3"/>
</group>
<group name="G_SERVC_TYPE_3" source="SERVC_TYPE_3">
<element name="Q6_ZONE_DESC" value="Q6_ZONE_DESC"/>
<element name="Q6_QUALITY_RATING_1" value="Q6_QUALITY_RATING_1"/>
<element name="Q6_QUALITY_RATING_2" value="Q6_QUALITY_RATING_2"/>
<element name="Q6_QUALITY_RATING_3" value="Q6_QUALITY_RATING_3"/>
<element name="Q6_QTY_MISSING_1" value="Q6_QTY_MISSING_1"/>
<element name="Q6_QTY_MISSING_2" value="Q6_QTY_MISSING_2"/>
<element name="Q6_QTY_MISSING_3" value="Q6_QTY_MISSING_3"/>
</group>
</dataStructure>
</dataTemplate>Hello user6428199,
When you use ":Q1_STORE_ID" in your queries, BI Publisher looks for a report parameter named Q1_STORE_ID. Change all your report queries to get data for all the store_id's available. As you are bursting the report using the store_id as the bursting key, BI Publisher will split the report based on the stored_id and delivers content based on it. No matter how many queries you may have, BI Publisher will loop through all the store_id's available and all the queries will return data for that particular id in a report.
Thanks,
Machaan -
Multiple queries with 1 connection
Can I execute multiple queries with one connection?
//Example -
<%
String firstconn;
Class.forName("org.gjt.mm.mysql.Driver");
// create connection string
firstconn = "jdbc:mysql://localhost/profile?user=mark&password=mstringham";
// pass database parameters to JDBC driver
Connection aConn = DriverManager.getConnection(firstconn);
// query statement
Statement firstSQLStatement = aConn.createStatement();
String firstquery = "UPDATE auth_users SET last_log='" + rightnow + "'WHERE name='" + username + "' ";
// get result code
int firstSQLStatus = firstSQLStatement.executeUpdate(firstquery);
// close connection
firstSQLStatement.close();
%>
Now, instead of building a new connection for each query, can I use the same connection info for another query?
if so - how do you do this?
thanks for any help.
MarkCreate multiple statement objects from your connection. It's a good idea to close these in a finally block after you're done with them
Connection conn = null;
Statement stmt1 = null;
Statement stmt2 = null;
try {
conn = DriverManager.getConnection();
stmt1 = conn.createStatement();
// some sql here
stmt2 = conn.createStatement();
// some more sql here
} finally {
if ( stmt1 != null ) stmt1.close();
if ( stmt2 != null ) stmt2.close(); -
Can we use multiple queries on one template
Can we use multiple queries on one template
Hi,
if you're using data templates for your data set, you
can put multiple queries in the XML data template.
The queries may then be linked (or not) by the "link
name" tag ...
Grtz.Following you answer here...do you know eventually how/if possible to preview a report (with XMLP Desktop) that is using data templates for the data set?
Thanks,
Liviu -
Multiple queries in a single report?
I'm having some issues with the ColdFusion Report Builder...
I have a database table called "Items" that includes fields
for Reviewer and Status. I want to create a report that will list a
reviewer, then express the number of items where the Status is
"open" as a total or record count. I want to do the same for total
items, and then express the number of "open" items as a percentage.
For example:
REVIEWER, OPEN ITEMS, TOTAL ITEMS, PERCENT OPEN
John Doe, 10, 20, 50%
Jane Smith, 15, 60, 25%
...and so on.
So far I've only been able to get my report to display the
recordcount of the entire query. In order troubleshoot the problem
I created a regular cfm page to do the same thing. Here's what I
did:
<cfquery name="getreviewers"
datasource="#APPLICATION.datasource#">
SELECT DISTINCT Reviewer
FROM Items
ORDER BY Reviewer
</cfquery>
<cfoutput query="getreviewers">
<cfquery name="getopenitems"
datasource="#APPLICATION.datasource#">
SELECT Status
FROM Items
WHERE Status='open'
AND Reviewer = '#Reviewer#'
</cfquery>
<cfset open = getopenitems.recordcount>
<cfquery name="getallitems"
datasource="#APPLICATION.datasource#">
SELECT Status
FROM Items
WHERE Reviewer = '#Reviewer#'
</cfquery>
<cfset all = getallitems.recordcount>
<cfset percent = (open / all) * 100>
#getreviewers.DR_Item_Reviewer#, #open#, #all#,
#Round(percent)#%
</cfoutput>
That worked great, but as you can see I had to nest a couple
of queries inside a <cfoutput>. I don't know how to
incorporate this into the report builder, as it seems you can only
specify a single query. Another thing that occurs to me is perhaps
I'm going about this the wrong way. Is there perhaps a function
that will display things the way I want them without fussing with
multiple queries? Any help would be greatly appreciated. Thanks in
advance.It seems like you are trying to do a subreport. You can nest
reports within the report feature...just check out the subreport
feature under the help section. If that doesn't help let me
know. -
How do I display data from Multiple Queries in a spreadsheet?
I am running Oracle forms 10g as a kicker to export a report (rdf 10.1.2.0.2) to PDF or Excel Spreadsheet - User's choice.
Doesn't matter if I have desformat = SPREADSHEET, DELIMITEDDATA, or DELIMITED; I still get only the first query displayed when I run in spreadsheet format.
How do I display data from Multiple Queries in a spreadsheet? Is this possible?
Thanks in advance!Hi adam,
did you search the forum? You will find a lot of threads handling the problem of Excel file access.
In short: you need to use ActiveX (the RGT also uses ActiveX under the hood)!
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
BI Publisher Report in Oracle Apps 11i having multiple queries.
Hi,
I would like to know whether it is possible to have multiple queries in a data definition File.
QUERY1 - To find the last run date of a particular concurrent program
SELECT max(fcr.request_date) last_run_date
FROM apps.fnd_concurrent_requests fcr,
apps.fnd_concurrent_programs fcp,
apps.fnd_concurrent_programs_tl fcpt
where fcr.concurrent_program_id = fcp.concurrent_program_id
and fcp.concurrent_program_id = fcpt.concurrent_program_id
and fcpt.user_concurrent_program_name = 'Get Transfer Alert Details'Now based on the last run date value I will have my main query Query 2
QUERY 2-------------------------
select to_char(psah.creation_date,'DD-MON-YYYY HH24:MI:SS') appr_date,
(select papf.full_name
from per_all_people_f papf ,
fnd_user fu
where 1 = 1
and fu.user_name = psah.user_name
and papf.person_id = fu.employee_id
and papf.current_employee_flag = 'Y'
and trunc(sysdate) between effective_start_date and effective_end_date ) bu_hr_appr,
papf.full_name emp_name,
papf.employee_number emp_num,
(select hoin.org_information3||'.'|| hoin.org_information5
from hr_organization_information hoin
where 1 = 1
and hoin.organization_id = to_number(xxc_hr_ocsi_pkg.GET_TXN_VALUE(psah.approval_history_id,psth.transaction_history_id,'ASSIGN','P_ORGANIZATION_ID','NEW'))
and hoin.org_information_context = 'Company Cost Center' ) nbucc,
(select hoio.org_information3||'.'|| hoio.org_information5
from hr_organization_information hoio
where 1 = 1
and hoio.organization_id = to_number(xxc_hr_ocsi_pkg.GET_TXN_VALUE(psah.approval_history_id,psth.transaction_history_id,'ASSIGN','P_ORGANIZATION_ID','OLD'))
and hoio.org_information_context = 'Company Cost Center') obucc,
papf_hr.full_name hr_name,
papf_hr.email_address hr_mail,
papf_cre.first_name cre,
papf_cre.email_address cre_email,
DECODE(xxc_hr_ocsi_pkg.GET_TXN_VALUE(psah.approval_history_id,psth.transaction_history_id,'SAL','P_ATTRIBUTE_CATEGORY','NEW'),
'Commission Sales Plan',
(select flv.meaning
from fnd_lookup_values flv
where 1 = 1
and flv.lookup_type = 'XXHR_ANNUAL_COMMISSIO_PLAN_TYP'
and flv.enabled_flag = 'Y'
and flv.lookup_code = xxc_hr_ocsi_pkg.GET_TXN_VALUE(psah.approval_history_id,psth.transaction_history_id,'SAL','P_ATTRIBUTE1','NEW')),'NA') csp,
to_char(trunc(sysdate),'DD-MON-YYYY HH24:MI:SS') current_date,
fnd_global.conc_request_id request_id,
psth.last_update_date
from apps.pqh_ss_transaction_history psth ,
apps.pqh_ss_approval_history psah,
apps.per_all_people_f papf ,
apps.per_all_assignments_f paaf,
apps.per_all_people_f papf_cre,
apps.per_all_people_f papf_hr
where 1 = 1
and psth.process_name = 'HR_TRANSFER_JSP_PRC'
and psth.transaction_history_id = psah.transaction_history_id
and psah.action = 'APPROVED'
and psah.creation_date = (select max(psah1.creation_date)
from apps.pqh_ss_approval_history psah1
where 1 = 1
and psah1.transaction_history_id = psah.transaction_history_id
and psah.action = psah1.action
and psah.approval_history_id = psah1.approval_history_id
and (select count (1)
from apps.pqh_ss_approval_history psah
where psah.transaction_history_id = psth.transaction_history_id
and action = 'APPROVED'
) > 1
and psah.approval_history_id = (select max(psah1.approval_history_id)
from pqh_ss_approval_history psah1
where 1= 1
and psah1.transaction_history_id = psah.transaction_history_id
and psah1.action = psah.action
and psth.selected_person_id = papf.person_id
and papf.current_employee_flag = 'Y'
and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and papf.person_id = paaf.person_id
and paaf.primary_flag = 'Y'
and paaf.assignment_type = 'E'
and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
and to_number(paaf.ass_attribute7) = papf_hr.person_id
and trunc(sysdate) between papf_hr.effective_start_date and papf_hr.effective_end_date
and psth.creator_person_id = papf_cre.person_id
and trunc(sysdate) between papf_cre.effective_start_date and papf_cre.effective_end_date
and psth.last_update_date > :last_run_dateEdited by: 936671 on Jul 2, 2012 4:09 AMFor examples and details please refer to the Guide: http://docs.oracle.com/cd/E10415_01/doc/bi.1013/e12187/T421739T434255.htm
Specifically, look for the following chapters
The Data Template Definition
How to Define a Data Link Between Queries -
Question about templates with multiple queries
I am just starting out with BI Publisher, v.10.1.3.2. I have a report that has multiple queries, but my template is just based on 1 query. How can I make the template use more than one query?
Thanks!!<!-- BI Publisher Report Data Template --!>
<!-- Report: -->
<!-- defaultPackage - the PL/SQL package name to resolve any lexical
references, group filters, or data triggers defined in the template. -->
<dataTemplate name="dataTemplateName" description="DESCRIPTION" dataSourceRef="ORCL" defaultPackage="<SCHEMA>.<PACKAGE>" version="1.0">
<properties>
<property name="include_parameters" value="True|False"></property>
<property name="include_null_Element" value="True|False"></property>
<property name="xml_tag_case" value="upper|lower"></property>
<property name="db_fetch_size" value="500"></property>
<property name="scalable_mode" value="on|off"></property>
<property name="include_rowsettag" value="true|false"></property>
<property name="debug_mode" value="on|off"></property>
</properties>
<parameters>
<parameter name="IDENTIFIER" dataType="character|date|number" defaultValue="0" include_in_output="true|false"></parameter>
</parameters>
<!-- Flexfield support for queries against Oracle Applications database -->
<lexicals>
<lexical></lexical>
</lexicals>
<dataQuery>
<xml name="xml_query_name" expressionPath="Xpath_expression">
<url method="GET|POST" realm="auth_name" username="" password="">file:///d:/windir/filename.xml</url>
</xml>
<sqlStatement name="query_name">
<![CDATA[
SELECT
FROM
WHERE
]]>
</sqlStatement>
</dataQuery>
<!-- If you have multiple queries, you must link them to create the -->
<!-- appropriate data output. In the data template, there are two methods -->
<!-- for linking queries: using bind variables or using the <link> element -->
<!-- to define the link between queries. -->
<link parentQuery="parent_query_name" parentColumn="col" childQuery="child_query_name" childColumn="col" condition="= < <= > >="></link>
<dataTrigger name="beforeReport" source="<package_name>.<function_name>"></dataTrigger>
<!-- (Required for multiple queries) Defines the structure of the output -->
<!-- XML. Consists of <group> and <element>elements to specify the -->
<!-- structure. This section is optional for single queries; if not -->
<!-- specified, the data engine will generate flat XML. -->
<dataStructure>
<group name="group_tag_name" source="query_name" groupFilter="<package_name>.<function_name>">
<element name="tag_name" value="source_column" function="SUM() COUNT() AVG() MIN() MAX()"></element>
<element name="tag_name" value="<group_name>.<column/alias name>" function="SUM() COUNT() AVG() MIN() MAX()"></element>
<group name="group_tag_name" source="query_name" groupFilter="<package_name>.<function_name>">
<element name="tag_name" value="source_column" function="SUM() COUNT() AVG() MIN() MAX()"></element>
<element name="tag_name" value="<group_name>.<column/alias name>" function="SUM() COUNT() AVG() MIN() MAX()"></element>
</group>
</group>
</dataStructure>
<dataTrigger name="afterReport" source="<package_name>.<function_name>"></dataTrigger>
</dataTemplate> -
Moving multiple queries from one category to another in QM
Hi All,
Is there is any way of moving multiple queries from one category to another in the query manager?
Or is the only way of doing it by saving each one individually into a different category.
Any ideas ?
Regards,
Rakesh NHi Rakesh,
The query manager has limited function compare with normal file management applications. Under current design, you have to do this one by one. You just need to make sure move the smaller amount of queries to large category. Category name can be changed easily.
Thanks,
Gordon -
Order of the Merged Prompts with Multiple Queries
Hi,
I have a WEBI XI 3.0 document that contains multiple queries.
One of the queries in the document has the following prompts in this order:
"Date:"
"Time:"
"Time zone:"
"Address:"
Another query in the document has the following prompts in this order:
"Date:"
"Time:"
"Name:"
"Address:"
If I do a Refresh All in the document, the prompts are merged and displayed in the following order:
"Date:"
"Time:"
"Time zone:"
"Address:"
"Name:"
However, I want "Address:" to be the last prompt displayed:
"Date:"
"Time:"
"Time zone:"
"Name:"
"Address:"
Is there a way to specify the order of the merged prompts?Hi,
To define the particular order of the prompts all the prompts should be at the universe level or at the report level.
As all the prompts defined at the universe level will appear first in alphabetical order and then the report level prompts will appear also sorted alphabetically.
In your case if possible create the prompt of Address at the report level and other prompts at the universe level it will automatically appear as the last one when you refresh all the queries.
Else you can change the prompt string to define the particular order.
@Prompt('1. Enter Date'.....)
@Prompt('2. Enter Time'.....)
@Prompt('3. Enter Time Zone....)
@Prompt('4. Enter Name'....)
@prompt('5. Enter Address'...)
Note: All the above prompts should be created either at the report level or universe level.
Regards,
Rohit
Maybe you are looking for
-
Hello, I have noticed that my Firefox has been crashing quite often over the last 2 weeks. Now as of this morning my several Book Marks that I use daily have disappeared ... Please help me to restore this . Awaiting a response Thank you
-
I'm trying to authorize my windows computer to play iTunes and when I press "alt' as instructed in order to bring up the alternative menu necessary to authorize it, nothing happens!
-
[Solved] Firefox and Thunderbird (Startup crash)
Hi guys, I've just installed arch linux + awesome wm with ati catalyst drivers from amd page. All works fine, just one problem. When I run thunderbird or firefox I have this message. I tried to reinstall both of them, and reinstall amd drivers but it
-
Deleting TO postions during creation of TO from TR
Hi Gurus, is there a possibility to delete TO positions during the creation process. Requirement is: I have a Transport Requirement of material x with an amount of 1000 pc. The TR is converted to a TO automatically (RLAUTA10). The warehouse situation
-
Resetting the Photoshop Workspace on screen
hey there i am a newbie aka noob i have pressed this button http://i.imgur.com/8lRGZu7.png on the bottom and my window wound up looking like this http://i.imgur.com/SK8Gf75.png basically it is immovable, i cant drag the window if i want to, the upper