Query extraction help
Hi,
This is the query which I use, there is no problem with the query, but I need to organize the query output.
=========
select ds_key_id, ds_ver_num,
ds.ds_cond_xml.extract('//condition/operator/text()').getStringVal() as operator_text,
ds.ds_cond_xml.extract('//condition/RHS/value[@type="LIST_ITEM"]/text()').getStringVal() as keyword_val
from dataset_version ds
=============
<?xml version="1.0" encoding="UTF-8"?>
<conditions>
<logical-operator type="OR">
<logical-operator type="AND">
<condition id="2" name="2" setid="1" setname="ConditionSet1">
<LHS>
<keyword id="2"></keyword>
</LHS>
<RHS>
<value source="REFSVC" type="LIST_ITEM">USA</value>
</RHS>
<operator>NE</operator>
</condition>
<condition id="4" name="4" setid="1" setname="ConditionSet1">
<LHS>
<keyword id="4">
</keyword>
</LHS>
<RHS><value source="REFSVC" type="LIST_ITEM">CS</value>
</RHS>
<operator>EQ</operator>
</condition>
</logical-operator>
<condition id="1" name="1" setid="2" setname="ConditionSet2">
<LHS><keyword id="1"> </keyword></LHS>
<RHS><value source="LIST" type="LIST">98751</value></RHS>
<operator>IN</operator>
</condition>
</logical-operator>
</conditions>
================
I am getting the output as below:
169901 175651 NEEQIN USACS98751
I need to split the output 'EQ' and 'EQ' into two columns.
How do i rewrite my query.
Thanks.
I am getting the output as below:
169901 175651 NEEQIN USACS98751
I get a bit of a different output for »keyword_val«:
michaels> with dataset_version as
(select 169901 ds_key_id,
175651 ds_ver_num,
xmltype('<?xml version="1.0" encoding="UTF-8"?>
<conditions>
<logical-operator type="OR">
<logical-operator type="AND">
<condition id="2" name="2" setid="1" setname="ConditionSet1">
<LHS><keyword id="2"/> </LHS>
<RHS>
<value source="REFSVC" type="LIST_ITEM">USA</value>
</RHS>
<operator>NE</operator>
</condition>
<condition id="4" name="4" setid="1" setname="ConditionSet1">
<LHS>
<keyword id="4"/>
</LHS>
<RHS>
<value source="REFSVC" type="LIST_ITEM">CS</value>
</RHS>
<operator>EQ</operator>
</condition>
</logical-operator>
<condition id="1" name="1" setid="2" setname="ConditionSet2">
<LHS>
<keyword id="1"/>
</LHS>
<RHS>
<value source="LIST" type="LIST">98751</value>
</RHS>
<operator>IN</operator>
</condition>
</logical-operator>
</conditions>') ds_cond_xml from dual)
select ds_key_id,
ds_ver_num,
ds.ds_cond_xml.extract('//condition/operator/text()').getStringVal() as operator_text,
ds.ds_cond_xml.extract('//condition/RHS/value[@type="LIST_ITEM"]/text()').getStringVal() as keyword_val
from dataset_version ds
DS_KEY_ID DS_VER_NUM OPERATOR_TEXT KEYWORD_VAL
169901 175651 NEEQIN USACS
1 row selected.
I need to split the output 'EQ' and 'EQ' into two columnsDon't get that one really. What is the desired output you'd like to achieve?
Similar Messages
-
Date format in Query Extract - Urgent
Hi,
I'm using Query-Extract (RSCRM_BAPI) to extract query data and store it in separate location.
While extracting the data into .csv ot .txt file, date will be displayed as yyyymm (200807). As per the requirement we should display the date in the format mmm-yyyy (Jul-2008).
Please help me. its very urgent.
Thanks,
VarunHi ,
This issue can be solved by writing a routine in update rules pls take the help of abap experts to solva this
this is not a big issue for them
Hope i have guided u properly
Pls assign me points my boss ??
Regards ,
Subash Balakrishnan -
How to schedule Query Extracts using RSCRM_BAPI
Hi,
Can you give me the link to the document How to schedule Query Extracts using RSCRM_BAPI . I do not have userid password to view the same.
Thanks for the help.Hi,
this is the link for the document..
https://websmp205.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700004400232004E
thnks. -
Hello All,
Via the rscrm_bapi transaction I am trying to create a query extract but I receive the following error message "Error when scheduling the query (JOB_CLOSE)".
Please advise on what the problem is and how to rectify.
Regards,
Keith KibuukaYou are probably logged onto an app server instance which is not running the required Backg process to schedule the jobs.
Do this. Go to SM51. Double click on the server instance which is running Backg (Background process). Now you will be logged onto the appropriate server. Now you can to schedule the RSCRM_BAPI job.
Good Luck
Uma -
How to improve the performance of the attached query, Please help
Hi,
How to improve performance of the below query, Please help. also attached explain plan -
SELECT Camp.Id,
rCam.AccountKey,
Camp.Id,
CamBilling.Cpm,
CamBilling.Cpc,
CamBilling.FlatRate,
Camp.CampaignKey,
Camp.AccountKey,
CamBilling.billoncontractedamount,
(SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
rCam.AccountKey as AccountKey
FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
WHERE Camp.AccountKey = rCam.AccountKey
AND Camp.AvCampaignKey = rCam.AvCampaignKey
AND Camp.AccountKey = CamBilling.AccountKey
AND Camp.CampaignKey = CamBilling.CampaignKey
AND rCam.AccountKey = xSite.AccountKey
AND rCam.AvSiteKey = xSite.AvSiteKey
AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
to_date('01-01-2011', 'DD-MM-YYYY')
GROUP By rCam.AccountKey,
Camp.Id,
CamBilling.Cpm,
CamBilling.Cpc,
CamBilling.FlatRate,
Camp.CampaignKey,
Camp.AccountKey,
CamBilling.billoncontractedamount
Explain Plan :-
Description Object_owner Object_name Cost Cardinality Bytes
SELECT STATEMENT, GOAL = ALL_ROWS 14 1 13
SORT AGGREGATE 1 13
VIEW GEMINI_REPORTING 14 1 13
HASH GROUP BY 14 1 103
NESTED LOOPS 13 1 103
HASH JOIN 12 1 85
TABLE ACCESS BY INDEX ROWID GEMINI_REPORTING RCAMSIT 2 4 100
NESTED LOOPS 9 5 325
HASH JOIN 7 1 40
SORT UNIQUE 2 1 18
TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY SITE 2 1 18
INDEX RANGE SCAN GEMINI_PRIMARY SITE_I0 1 1
TABLE ACCESS FULL GEMINI_PRIMARY SITE 3 27 594
INDEX RANGE SCAN GEMINI_REPORTING RCAMSIT_I 1 1 5
TABLE ACCESS FULL GEMINI_PRIMARY CAMPAIGN 3 127 2540
TABLE ACCESS BY INDEX ROWID GEMINI_PRIMARY CAMBILLING 1 1 18
INDEX UNIQUE SCAN GEMINI_PRIMARY CAMBILLING_U1 0 1Hello,
This has really nothing to do with the Oracle Forms product.
Please, send the SQL or/and PL/SQL questions in the corresponding forums.
Francois -
Hi BW gurus
Can someone give me a solution to do query extracts to a flat file on queries built on infosets.
rscrm_bapi does not support it, and creating infospokes is not feasible for this, i tried APD as well and looks like APD does not support infoset queries either. we are on 3.5
SamTry creating a multiprovider based on your Infoset, I had the same problem, awhile ago. RSCRM_BAPI doenst support flat file extraction from Infoset and we are in BI 7, eventually we took another route to get the flat file to them and not from the query.
However, while testing it, it seemed to have worked. Let us know how you progressed.
Best Wishes... -
Cluster bar chart- sql query please help-
Hi,
I am trying to create cluster bar chart and am stumped with this sql query.Any help is appreciated.
Here is my table
city region issue value
c1 north i1 y
c1 north i2 y
c2 north i1 n
c2 north i2 y
c3 south i1 y
c3 south i2 n
c4 east i1 n
c4 east i2 n
The bar chart will have 3 series, north south and east.
And labels will be i1 and i2. value will be number of times this issue was encountered(y) in this region.
How can I get something like this from the above table-
region issue count(yes)
north i1 1
north i2 2
south i1 1
south i2 0
east i1 0
east i2 0
thanksWITH table1 AS
(SELECT 1435177 qte_id, 2 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no
FROM dual
table2 AS
SELECT 1435177 qte_id, 1 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 2 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 3 seq_no, 0 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 4 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 11 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no, 59300 cmmt_curr_amt
FROM dual
SELECT qte_id, t2_seq_no, cmmt_curr_amt - cmmt_curr_lag diff
FROM
(SELECT t2.qte_id, t2.seq_no t2_seq_no, t1.seq_no t1_seq_no, cmmt_curr_amt, LAG(cmmt_curr_amt,1,0) OVER (PARTITION BY t2.qte_id ORDER BY t2.seq_no) cmmt_curr_lag
FROM table1 t1, table2 t2
WHERE t2.qte_id = t1.qte_id (+)
AND t2.seq_no = t1.seq_no(+)
ORDER BY 1,2
WHERE t1_seq_no IS NOT NULL
ORDER BY 1,2
QTE_ID T2_SEQ_NO DIFF
1435177 2 0
1435177 5 0
1435177 7 0
1435177 8 0
1435177 12 0
1435177 14 0 -
Need help with GREP query-Extract
Hi folks,
I'm trying to tighten up a GREP query I was able to piece together.
This Find string allows me to find text within the <ex> tags and delete the tags themselves. The Change field then applies my Extract paragraph style.
(?s)(<ex> *)(.+?)( *</ex>)
What I need it to do is add a blank line above and below the extract. Can that be added to the string?
TIAYes, by changing to \r$2\r
BUT, is this text already a paragraph? If it is, it would be better to add space before and after as part of the style. If it's not, I'm not sure that adding the returns in the same operation isn't going to change the text from which it is extracted as well, so you might want to search first for <ex>.+?</ex> and change to \r$0\r without changing the formatting, then run what you have now to change the format on the extract. -
Query extraction to a flat file
We have a requirement to extract the query result and send it as a flat file to a different system. The query is created on a multi provider and the key figures have lot of restrictions. We currently use RSCRM_BAPI for this. Would like to know if there is a better options, if any one has used it.
Thanks,
VJ SudharsanHi,
It might help you:
Program to run query and save to flat file
Best regards,
Eugene -
SAP Query - Extract part of field
Hi,
I created a query with a local field. I want to extract only the last 3 characters of a field.
Is there a LEFT or RIGHT function I can use like in Excel?
The field I want to extract it from is 12 characters long.
Hope someone can help.
Thanks, LupeYou can not fetch only 3 characters directly
There are 3 ways you can achieve this
1> Create additional field in the infoset and code the logic. (If this report is used frequently, you should use this)
2> Download the output of query in the excel and perform excel actions (Use this if the report is not frequently required. Does not take much time to fetch 3 characters)
3> if the report format is fixed, you can create ABAP report and code yo fetch only 3 characters -
Rolling totals query ~ please help
I have been stuck on a query for the last week. It would be amazing if someone could help me with this. nothing I have done has worked so far. I did post something a few days ago and was helped a bit but it just didnt work out the way I needed. This has been the hardest query I have ever worked on.
Im using oracle 11g.
What I am trying to do is get a bunch of running aggregate values based on dates of multiple projects.
I have did an export of the ddl for the actual table and records, I did not want to just post a sample of the data as it includes many records and I think it might actually be easier to have the full extract.
here is the link to the file http://santoro.us/pl_insert.sql
In the table I have IPS (which is a project id), create date, complete date, logged_date, status, due date (these are all the important columns)
What I am trying to get as an end result is 1 table or 1 view that has all the running totals per month for each project.
Here are the totals im looking to get
Open
Closed
open late
closed late
open on time closed on time
The thing is I need to start the months per project from the first month the project has a record. So if a projects first record starts on jan 1 2010 thats when the first record with totals should be, 01/2010 , then 02/2010, 03/2010, etc..until the current month. This has to be done per project.
so for example lets say there are only 2 projects (there are many more).
IPS 123
first record starts 01/01/2010
IPS 456
first record starts 01/01/2011
each have records that open and close on different dates in different months. some might be late (complete date > due date), some closed on time (complete date <= due date).
end result would be a table that has :
Date | IPS | open | closed | open late | closed late | open on time | closed on time |
01/2010 | 123 | 1 | 0 | etc..
months would go all the way to current month
then start proj 2
01/2011 | 456 | 1 | 0 | etc..
months would go all the way to current month
each record would be counted starting the create date of the record. As the records get late or closed (based on due date and complete date) then need to be added/removed from the running totals of the data.
This all has to be in 1 table or view. I know some people might say this is wrong way to do it but thats how it has to be done for the project im working on. Im generating xml at the end so the developer needs it like this.
Again thank you for any help and please let me know if you need any other information.
thank you.Frank. No problem. that is great that it doesnt need ad hoc tables and could be done in pure sql. As I said this is the hardest query i have ever worked on. If you could help i would be greatful. I realize this forum is priceless resource and has helped me many times.
Please let me know if I should post anything else.
I am having a hard time understanding how I would dispaly each month with the aggregrated rolling totals from start month to current month for each project.
Im using oracle 11.2.3.3.0
CREATE TABLE "THERM_PUNCHLIST"
( "ENTRY_ID" VARCHAR2(50 BYTE),
"BATCH_DATE" DATE,
"IPS" VARCHAR2(50 BYTE),
"STATUS" VARCHAR2(20 BYTE),
"DUE_DATE" DATE,
"UNIT_SERIAL" VARCHAR2(500 BYTE),
"CREATE_DATE" DATE,
"COMPLETE_DATE" DATE,
"DB_LOGGED_DATE" DATE,
"REPORTED_DATE" DATE
--im posting more than 20 inserts as i want to be sure to get a few projects. the full ddl is at the link above with all projects and records
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788396',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788387',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788391',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788372',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788375',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788385',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788356',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788360',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('27-MAY-11','DD-MON-RR'),null,to_date('12-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('12-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788338',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('26-JAN-11','DD-MON-RR'),null,to_date('25-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('25-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1788788317',to_date('28-JAN-14','DD-MON-RR'),'102869','Closed',to_date('26-JAN-11','DD-MON-RR'),null,to_date('29-JUN-08','DD-MON-RR'),to_date('28-MAY-09','DD-MON-RR'),to_date('23-AUG-10','DD-MON-RR'),to_date('29-JUN-08','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305623588',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('09-JUN-10','DD-MON-RR'),to_date('08-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('09-JUN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('4073131813',to_date('28-JAN-14','DD-MON-RR'),'504984','Closed',to_date('15-MAY-12','DD-MON-RR'),'E0839',to_date('17-FEB-12','DD-MON-RR'),to_date('31-MAR-12','DD-MON-RR'),to_date('18-APR-12','DD-MON-RR'),to_date('12-DEC-11','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592103',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('23-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592105',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592108',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592101',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592087',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592096',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2305592099',to_date('28-JAN-14','DD-MON-RR'),'505587','Closed',to_date('31-JAN-11','DD-MON-RR'),'875032 / 875034',to_date('08-JAN-10','DD-MON-RR'),to_date('12-JUL-10','DD-MON-RR'),to_date('02-MAR-11','DD-MON-RR'),to_date('08-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('3652122705',to_date('28-JAN-14','DD-MON-RR'),'704145','Closed',to_date('01-SEP-10','DD-MON-RR'),null,to_date('13-JUN-10','DD-MON-RR'),to_date('25-APR-11','DD-MON-RR'),to_date('07-FEB-12','DD-MON-RR'),to_date('13-JUN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('3652122696',to_date('28-JAN-14','DD-MON-RR'),'704145','Closed',to_date('01-SEP-10','DD-MON-RR'),null,to_date('13-JUN-10','DD-MON-RR'),to_date('25-APR-11','DD-MON-RR'),to_date('07-FEB-12','DD-MON-RR'),to_date('13-JUN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('3652122693',to_date('28-JAN-14','DD-MON-RR'),'704145','Closed',to_date('01-SEP-10','DD-MON-RR'),null,to_date('13-JUN-10','DD-MON-RR'),to_date('25-APR-11','DD-MON-RR'),to_date('07-FEB-12','DD-MON-RR'),to_date('13-JUN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('4904513300',to_date('28-JAN-14','DD-MON-RR'),'708829','Closed',to_date('04-OCT-12','DD-MON-RR'),'890273',to_date('04-JUL-12','DD-MON-RR'),to_date('09-APR-12','DD-MON-RR'),to_date('05-SEP-12','DD-MON-RR'),to_date('04-JUL-12','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785374403',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('19-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375257',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('19-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785377988',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843931',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('11-OCT-10','DD-MON-RR'),to_date('02-APR-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('11-OCT-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785384765',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785385084',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785388821',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785388837',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785393519',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-MAR-12','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('28-FEB-12','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785393585',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-MAR-12','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('28-FEB-12','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375310',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375318',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785375324',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785378644',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('1785382711',to_date('28-JAN-14','DD-MON-RR'),'504865','Closed',to_date('31-DEC-10','DD-MON-RR'),null,to_date('20-JAN-10','DD-MON-RR'),to_date('07-JUN-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'),to_date('20-JAN-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843992',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('28-JAN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843996',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('23-FEB-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249844002',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('14-MAY-10','DD-MON-RR'),to_date('01-FEB-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('14-MAY-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843984',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('03-JUN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843968',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('10-SEP-10','DD-MON-RR'),to_date('14-JAN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('10-SEP-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843921',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('28-JAN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843913',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR'));
Insert into THERM_PUNCHLIST (ENTRY_ID,BATCH_DATE,IPS,STATUS,DUE_DATE,UNIT_SERIAL,CREATE_DATE,COMPLETE_DATE,DB_LOGGED_DATE,REPORTED_DATE) values ('2249843897',to_date('28-JAN-14','DD-MON-RR'),'701402','Closed',to_date('20-JUN-11','DD-MON-RR'),null,to_date('20-AUG-10','DD-MON-RR'),to_date('03-JUN-11','DD-MON-RR'),to_date('10-FEB-11','DD-MON-RR'),to_date('20-AUG-10','DD-MON-RR')); -
hi,
i need some help in trying to create a query to show the table_name, mb_used and degree of parallelism.
this is what i currently have..
SELECT a.segment_name, sum(ROUND((BYTEs/1048576*100)/100)) "MB size"
FROM dba_Segments a
WHERE a.owner= ??
and segment_type='TABLE'
group by segment_name
order by segment_name;
select table_name, degree
from dba_Tables
where owner='ADW_UTL'
and tablespace_name is not null
order by table_name;
how can i combined the two?
thanks in advance..Hi,
SELECT a.segment_name, sum(ROUND((BYTEs/1048576*100)/100)) "MB size", b.degree
FROM dba_Segments a, dba_tables b
WHERE a.owner= 'xxx'
and a.owner = b.owner
and segment_type='TABLE'
group by segment_name, degree
order by segment_name;
Cheers -
Query Scenario Help - Average of Multiple Regions
Hi, I have a query scenario I can't create and I hope someone can help with.
The user inputs a sales Area and the report is to output the regions in that area and provide the Volume (easy) and the Average of all the presented regions. The problem is that the number of regions is dynamic so I don't know how to go about determining the average and making it constant across the regions. The user can also drill down on a region to present divisions and I would then need the average for the divisions this time instead of regions. Can you help?
Example 1
Input Sales Area 1000000
Region 1000001 1000002 1000003
Product1 Volume 100 120 105
Product1 Average 108 108 108
Product2 Volume 200 400 325
Product2 Average 308 308 308
Example 2
Input Sales Area 2000000
Region 2000001 2000002 2000003 2000004
Product1 Volume 100 120 105 180
Product1 Average 126 126 126 126
Product2 Volume 200 400 325 600
Product2 Average 381 381 381 381
To get this layout I have the following in the query builder:
The 2 Products are in a structue under Rows
The Key figures structure is also under Rows
The Region is under the columnsIf you redesign the report slightly to move the "Average" to a column at the end of each row (which really makes more sense, IMHO), then the answer is easy. Just change the Suppress Results Row property to "Never" for Region, and change the Display Results As property to "Average" for Volume.
You could also make this same change to Division and/or any other free characteristic they might use as a drill-across in the report.
Hope this helps...
Bob -
Query HINT help requested Pls.
A query thus:
SELECT equipment_id,
vsemml.stock_equipment_id,
game_ware_id
FROM v_stocked_equipment_inven_his vsdeih,
v_stock_equipment_mod_man_list vsemml
WHERE vsemml.stock_equipment_id = vsdeih.stock_equipment_id(+)
AND equipment_status_code IN
('ALL', 'AVA' )
AND ec_end_date IS NULL
AND eav_end_date IS NULL
GROUP BY equipment_id,
vsemml.stock_equipment_id,
game_ware_id
HAVING COUNT (model_attribute_value_id) =
(SELECT COUNT (*)
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
WHERE stock_equipment_id =
vsemml.stock_equipment_id);
has result :
513 rows selected.
Elapsed: 00:04:59.17
Execution Plan
Plan hash value: 3816309895
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 240 | 21120 | | 38010 (7)| 00:07:37 |
|* 1 | FILTER | | | | | | |
| 2 | HASH GROUP BY | | 240 | 21120 | | 38010 (7)| 00:07:37 |
|* 3 | FILTER | | | | | | |
|* 4 | HASH JOIN OUTER | | 23915 | 2055K| | 38006 (7)| 00:07:37 |
|* 5 | HASH JOIN | | 42 | 630 | | 7 (15)| 00:00:01 |
| 6 | TABLE ACCESS FULL | MODEL | 31 | 279 | | 3 (0)| 00:00:01 |
| 7 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
| 8 | VIEW | V_STOCKED_EQUIPMENT_INVEN_HIS | 23915 | 1704K| | 37998 (7)| 00:07:36 |
| 9 | HASH UNIQUE | | 23915 | 2989K| 6392K| 37998 (7)| 00:07:36 |
|* 10 | HASH JOIN RIGHT OUTER | | 23915 | 2989K| | 37307 (7)| 00:07:28 |
| 11 | TABLE ACCESS FULL | GAME_WARE | 325 | 1950 | | 3 (0)| 00:00:01 |
|* 12 | HASH JOIN RIGHT OUTER | | 23915 | 2849K| | 37303 (7)| 00:07:28 |
| 13 | TABLE ACCESS FULL | GAMESET | 825 | 8250 | | 5 (0)| 00:00:01 |
|* 14 | HASH JOIN | | 23915 | 2615K| | 37297 (7)| 00:07:28 |
| 15 | TABLE ACCESS FULL | EQUIPMENT_STATUS | 16 | 128 | | 3 (0)| 00:00:01 |
|* 16 | HASH JOIN | | 23915 | 2428K| | 37293 (7)| 00:07:28 |
| 17 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
|* 18 | HASH JOIN | | 645K| 60M| | 37278 (7)| 00:07:28 |
| 19 | INDEX FULL SCAN | XPKSTOCK_EQUIPMENT_ATTRIB_VAL | 42 | 294 | | 1 (0)| 00:00:01 |
|* 20 | HASH JOIN | | 5288K| 458M| 9M| 37180 (7)| 00:07:27 |
| 21 | TABLE ACCESS FULL | EQUIPMENT_ATTRIBUTE_VALUE | 297K| 6672K| | 784 (3)| 00:00:10 |
|* 22 | HASH JOIN | | 7467K| 484M| 6328K| 5447 (5)| 00:01:06 |
| 23 | INDEX FAST FULL SCAN | PK_EQUIPMENT_CONFIGURATION | 380K| 1859K| | 398 (3)| 00:00:05 |
|* 24 | HASH JOIN | | 380K| 22M| 4528K| 3235 (2)| 00:00:39 |
|* 25 | HASH JOIN | | 140K| 2876K| | 563 (2)| 00:00:07 |
| 26 | MERGE JOIN | | 281 | 3372 | | 6 (17)| 00:00:01 |
| 27 | TABLE ACCESS BY INDEX ROWID| SITE_TYPE | 4 | 20 | | 2 (0)| 00:00:01 |
| 28 | INDEX FULL SCAN | PK_SITE_TYPE | 4 | | | 1 (0)| 00:00:01 |
|* 29 | SORT JOIN | | 281 | 1967 | | 4 (25)| 00:00:01 |
| 30 | VIEW | index$_join$_016 | 281 | 1967 | | 3 (0)| 00:00:01 |
|* 31 | HASH JOIN | | | | | | |
| 32 | INDEX FAST FULL SCAN | PK_SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 33 | INDEX FAST FULL SCAN | XIF1SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 34 | TABLE ACCESS FULL | LOCATION | 140K| 1232K| | 554 (2)| 00:00:07 |
| 35 | TABLE ACCESS FULL | EQUIPMENT_CONFIGURATION | 380K| 15M| | 1460 (2)| 00:00:18 |
| 36 | SORT AGGREGATE | | 1 | 6 | | | |
| 37 | NESTED LOOPS | | 1 | 6 | | 0 (0)| 00:00:01 |
|* 38 | INDEX UNIQUE SCAN | XPKSTOCK_EQUIPMENT | 1 | 3 | | 0 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | XIF1STOCK_EQUIPMENT_ATTRIB_VAL | 1 | 3 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(COUNT("MODEL_ATTRIBUTE_VALUE_ID")= (SELECT COUNT(*) FROM "STOCK_EQUIPMENT_ATTRIB_VALUE"
"STOCK_EQUIPMENT_ATTRIB_VALUE","STOCK_EQUIPMENT" "STOCK_EQUIPMENT" WHERE "STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1 AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID" AND
"STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B2))
3 - filter(("EQUIPMENT_STATUS_CODE"='ALL' OR "EQUIPMENT_STATUS_CODE"='AVA') AND "EC_END_DATE" IS NULL AND "EAV_END_DATE"
IS NULL)
4 - access("SE"."STOCK_EQUIPMENT_ID"="VSDEIH"."STOCK_EQUIPMENT_ID"(+))
5 - access("SE"."MODEL_ID"="M"."MODEL_ID")
10 - access("GS"."GAME_WARE_ID"="GW"."GAME_WARE_ID"(+))
12 - access("EC"."GAMESET_ID"="GS"."GAMESET_ID"(+))
14 - access("EC"."EQUIPMENT_STATUS_ID"="ES"."EQUIPMENT_STATUS_ID")
16 - access("EC"."MODEL_ID"="STOCK_EQUIPMENT"."MODEL_ID" AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
18 - access("MODEL_ATTRIBUTE_VALUE_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."MODEL_ATTRIBUTE_VALUE_ID")
20 - access("EC"."EQUIPMENT_ID"="EAV"."EQUIPMENT_ID")
filter("EAV"."START_DATE">="EC"."START_DATE" AND ("EAV"."END_DATE" IS NULL AND "EC"."END_DATE">="EAV"."START_DATE" OR
"EC"."END_DATE" IS NULL OR "EAV"."END_DATE"<="EC"."END_DATE") OR "EC"."START_DATE">="EAV"."START_DATE" AND ("EC"."END_DATE"
IS NULL AND "EAV"."END_DATE">="EC"."START_DATE" OR "EAV"."END_DATE" IS NULL OR "EC"."END_DATE"<="EAV"."END_DATE"))
22 - access("EC"."EQUIPMENT_ID"="EC"."EQUIPMENT_ID")
24 - access("EC"."LOCATION_ID"="L"."LOCATION_ID")
25 - access("L"."SITE_ID"="S"."SITE_ID")
29 - access("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
filter("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
31 - access(ROWID=ROWID)
38 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1)
39 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
filter("STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B1)
Query altered to:
=================
SELECT equipment_id,
vsemml.stock_equipment_id,
game_ware_id
FROM v_stocked_equipment_inven_his vsdeih,
v_stock_equipment_mod_man_list vsemml
WHERE vsemml.stock_equipment_id = vsdeih.stock_equipment_id(+)
AND equipment_status_code = 'ALL'
AND ec_end_date IS NULL
AND eav_end_date IS NULL
GROUP BY equipment_id,
vsemml.stock_equipment_id,
game_ware_id
HAVING COUNT (model_attribute_value_id) =
(SELECT COUNT (*)
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
WHERE stock_equipment_id =
vsemml.stock_equipment_id)
union
SELECT equipment_id,
vsemml.stock_equipment_id,
game_ware_id
FROM v_stocked_equipment_inven_his vsdeih,
v_stock_equipment_mod_man_list vsemml
WHERE vsemml.stock_equipment_id = vsdeih.stock_equipment_id(+)
AND equipment_status_code = 'AVA'
AND ec_end_date IS NULL
AND eav_end_date IS NULL
GROUP BY equipment_id,
vsemml.stock_equipment_id,
game_ware_id
HAVING COUNT (model_attribute_value_id) =
(SELECT COUNT (*)
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
WHERE stock_equipment_id =
vsemml.stock_equipment_id);
Results in:
513 rows selected.
Elapsed: 00:00:07.40
Execution Plan
Plan hash value: 3317078232
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 176 | | 6431 (51)| 00:01:18 |
| 1 | SORT UNIQUE | | 2 | 176 | | 6431 (51)| 00:01:18 |
| 2 | UNION-ALL | | | | | | |
|* 3 | FILTER | | | | | | |
| 4 | HASH GROUP BY | | 1 | 88 | | 3216 (2)| 00:00:39 |
|* 5 | HASH JOIN | | 95 | 8360 | | 3214 (2)| 00:00:39 |
|* 6 | HASH JOIN | | 42 | 630 | | 7 (15)| 00:00:01 |
| 7 | TABLE ACCESS FULL | MODEL | 31 | 279 | | 3 (0)| 00:00:01 |
| 8 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
| 9 | VIEW | V_STOCKED_EQUIPMENT_INVEN_HIS | 95 | 6935 | | 3207 (2)| 00:00:39 |
| 10 | HASH UNIQUE | | 95 | 12160 | | 3207 (2)| 00:00:39 |
|* 11 | HASH JOIN RIGHT OUTER | | 95 | 12160 | | 3206 (2)| 00:00:39 |
| 12 | TABLE ACCESS FULL | GAME_WARE | 325 | 1950 | | 3 (0)| 00:00:01 |
|* 13 | HASH JOIN OUTER | | 95 | 11590 | | 3202 (2)| 00:00:39 |
|* 14 | HASH JOIN | | 95 | 10640 | | 3196 (2)| 00:00:39 |
| 15 | TABLE ACCESS FULL | SITE_TYPE | 4 | 20 | | 3 (0)| 00:00:01 |
|* 16 | HASH JOIN | | 95 | 10165 | | 3193 (2)| 00:00:39 |
| 17 | VIEW | index$_join$_021 | 281 | 1967 | | 3 (0)| 00:00:01 |
|* 18 | HASH JOIN | | | | | | |
| 19 | INDEX FAST FULL SCAN | PK_SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 20 | INDEX FAST FULL SCAN | XIF1SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 21 | NESTED LOOPS | | 95 | 9500 | | 3189 (2)| 00:00:39 |
|* 22 | HASH JOIN | | 96 | 8736 | 4440K| 3093 (2)| 00:00:38 |
|* 23 | HASH JOIN | | 56789 | 3771K| | 1679 (2)| 00:00:21 |
|* 24 | HASH JOIN | | 2894 | 178K| | 1273 (1)| 00:00:16 |
| 25 | INDEX FULL SCAN | XPKSTOCK_EQUIPMENT_ATTRIB_VAL | 42 | 294 | | 1 (0)| 00:00:01 |
|* 26 | HASH JOIN | | 2894 | 158K| | 1271 (1)| 00:00:16 |
| 27 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
|* 28 | TABLE ACCESS BY INDEX ROWID| EQUIPMENT_CONFIGURATION | 1279 | 53718 | | 1265 (1)| 00:00:16 |
| 29 | NESTED LOOPS | | 1860 | 93000 | | 1268 (1)| 00:00:16 |
|* 30 | TABLE ACCESS FULL | EQUIPMENT_STATUS | 1 | 8 | | 3 (0)| 00:00:01 |
|* 31 | INDEX RANGE SCAN | XIF3EQUIPMENT_CONFIGURATION | 23796 | | | 48 (3)| 00:00:01 |
| 32 | INDEX FAST FULL SCAN | PK_EQUIPMENT_CONFIGURATION | 380K| 1859K| | 398 (3)| 00:00:05 |
|* 33 | TABLE ACCESS FULL | EQUIPMENT_ATTRIBUTE_VALUE | 242K| 5451K| | 785 (3)| 00:00:10 |
| 34 | TABLE ACCESS BY INDEX ROWID | LOCATION | 1 | 9 | | 1 (0)| 00:00:01 |
|* 35 | INDEX UNIQUE SCAN | PK_LOCATION | 1 | | | 0 (0)| 00:00:01 |
| 36 | TABLE ACCESS FULL | GAMESET | 825 | 8250 | | 5 (0)| 00:00:01 |
| 37 | SORT AGGREGATE | | 1 | 6 | | | |
| 38 | NESTED LOOPS | | 1 | 6 | | 0 (0)| 00:00:01 |
|* 39 | INDEX UNIQUE SCAN | XPKSTOCK_EQUIPMENT | 1 | 3 | | 0 (0)| 00:00:01 |
|* 40 | INDEX RANGE SCAN | XIF1STOCK_EQUIPMENT_ATTRIB_VAL | 1 | 3 | | 0 (0)| 00:00:01 |
|* 41 | FILTER | | | | | | |
| 42 | HASH GROUP BY | | 1 | 88 | | 3216 (2)| 00:00:39 |
|* 43 | HASH JOIN | | 95 | 8360 | | 3214 (2)| 00:00:39 |
|* 44 | HASH JOIN | | 42 | 630 | | 7 (15)| 00:00:01 |
| 45 | TABLE ACCESS FULL | MODEL | 31 | 279 | | 3 (0)| 00:00:01 |
| 46 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
| 47 | VIEW | V_STOCKED_EQUIPMENT_INVEN_HIS | 95 | 6935 | | 3207 (2)| 00:00:39 |
| 48 | HASH UNIQUE | | 95 | 12160 | | 3207 (2)| 00:00:39 |
|* 49 | HASH JOIN RIGHT OUTER | | 95 | 12160 | | 3206 (2)| 00:00:39 |
| 50 | TABLE ACCESS FULL | GAME_WARE | 325 | 1950 | | 3 (0)| 00:00:01 |
|* 51 | HASH JOIN OUTER | | 95 | 11590 | | 3202 (2)| 00:00:39 |
|* 52 | HASH JOIN | | 95 | 10640 | | 3196 (2)| 00:00:39 |
| 53 | TABLE ACCESS FULL | SITE_TYPE | 4 | 20 | | 3 (0)| 00:00:01 |
|* 54 | HASH JOIN | | 95 | 10165 | | 3193 (2)| 00:00:39 |
| 55 | VIEW | index$_join$_044 | 281 | 1967 | | 3 (0)| 00:00:01 |
|* 56 | HASH JOIN | | | | | | |
| 57 | INDEX FAST FULL SCAN | PK_SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 58 | INDEX FAST FULL SCAN | XIF1SITE | 281 | 1967 | | 1 (0)| 00:00:01 |
| 59 | NESTED LOOPS | | 95 | 9500 | | 3189 (2)| 00:00:39 |
|* 60 | HASH JOIN | | 96 | 8736 | 4440K| 3093 (2)| 00:00:38 |
|* 61 | HASH JOIN | | 56789 | 3771K| | 1679 (2)| 00:00:21 |
|* 62 | HASH JOIN | | 2894 | 178K| | 1273 (1)| 00:00:16 |
| 63 | INDEX FULL SCAN | XPKSTOCK_EQUIPMENT_ATTRIB_VAL | 42 | 294 | | 1 (0)| 00:00:01 |
|* 64 | HASH JOIN | | 2894 | 158K| | 1271 (1)| 00:00:16 |
| 65 | TABLE ACCESS FULL | STOCK_EQUIPMENT | 42 | 252 | | 3 (0)| 00:00:01 |
|* 66 | TABLE ACCESS BY INDEX ROWID| EQUIPMENT_CONFIGURATION | 1279 | 53718 | | 1265 (1)| 00:00:16 |
| 67 | NESTED LOOPS | | 1860 | 93000 | | 1268 (1)| 00:00:16 |
|* 68 | TABLE ACCESS FULL | EQUIPMENT_STATUS | 1 | 8 | | 3 (0)| 00:00:01 |
|* 69 | INDEX RANGE SCAN | XIF3EQUIPMENT_CONFIGURATION | 23796 | | | 48 (3)| 00:00:01 |
| 70 | INDEX FAST FULL SCAN | PK_EQUIPMENT_CONFIGURATION | 380K| 1859K| | 398 (3)| 00:00:05 |
|* 71 | TABLE ACCESS FULL | EQUIPMENT_ATTRIBUTE_VALUE | 242K| 5451K| | 785 (3)| 00:00:10 |
| 72 | TABLE ACCESS BY INDEX ROWID | LOCATION | 1 | 9 | | 1 (0)| 00:00:01 |
|* 73 | INDEX UNIQUE SCAN | PK_LOCATION | 1 | | | 0 (0)| 00:00:01 |
| 74 | TABLE ACCESS FULL | GAMESET | 825 | 8250 | | 5 (0)| 00:00:01 |
| 75 | SORT AGGREGATE | | 1 | 6 | | | |
| 76 | NESTED LOOPS | | 1 | 6 | | 0 (0)| 00:00:01 |
|* 77 | INDEX UNIQUE SCAN | XPKSTOCK_EQUIPMENT | 1 | 3 | | 0 (0)| 00:00:01 |
|* 78 | INDEX RANGE SCAN | XIF1STOCK_EQUIPMENT_ATTRIB_VAL | 1 | 3 | | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - filter(COUNT("MODEL_ATTRIBUTE_VALUE_ID")= (SELECT COUNT(*) FROM "STOCK_EQUIPMENT_ATTRIB_VALUE"
"STOCK_EQUIPMENT_ATTRIB_VALUE","STOCK_EQUIPMENT" "STOCK_EQUIPMENT" WHERE "STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1 AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID" AND
"STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B2))
5 - access("SE"."STOCK_EQUIPMENT_ID"="VSDEIH"."STOCK_EQUIPMENT_ID")
6 - access("SE"."MODEL_ID"="M"."MODEL_ID")
11 - access("GS"."GAME_WARE_ID"="GW"."GAME_WARE_ID"(+))
13 - access("EC"."GAMESET_ID"="GS"."GAMESET_ID"(+))
14 - access("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
16 - access("L"."SITE_ID"="S"."SITE_ID")
18 - access(ROWID=ROWID)
22 - access("MODEL_ATTRIBUTE_VALUE_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."MODEL_ATTRIBUTE_VALUE_ID" AND
"EC"."EQUIPMENT_ID"="EAV"."EQUIPMENT_ID")
filter("EAV"."START_DATE">="EC"."START_DATE" AND ("EAV"."END_DATE" IS NULL AND "EC"."END_DATE">="EAV"."START_DATE" OR
"EC"."END_DATE" IS NULL OR "EAV"."END_DATE"<="EC"."END_DATE") OR "EC"."START_DATE">="EAV"."START_DATE" AND ("EC"."END_DATE"
IS NULL AND "EAV"."END_DATE">="EC"."START_DATE" OR "EAV"."END_DATE" IS NULL OR "EC"."END_DATE"<="EAV"."END_DATE"))
23 - access("EC"."EQUIPMENT_ID"="EC"."EQUIPMENT_ID")
24 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
26 - access("EC"."MODEL_ID"="STOCK_EQUIPMENT"."MODEL_ID")
28 - filter("EC"."END_DATE" IS NULL)
30 - filter("ES"."EQUIPMENT_STATUS_CODE"='ALL')
31 - access("EC"."EQUIPMENT_STATUS_ID"="ES"."EQUIPMENT_STATUS_ID")
33 - filter("EAV"."END_DATE" IS NULL)
35 - access("EC"."LOCATION_ID"="L"."LOCATION_ID")
39 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1)
40 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
filter("STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B1)
41 - filter(COUNT("MODEL_ATTRIBUTE_VALUE_ID")= (SELECT COUNT(*) FROM "STOCK_EQUIPMENT_ATTRIB_VALUE"
"STOCK_EQUIPMENT_ATTRIB_VALUE","STOCK_EQUIPMENT" "STOCK_EQUIPMENT" WHERE "STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1 AND
"STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID" AND
"STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B2))
43 - access("SE"."STOCK_EQUIPMENT_ID"="VSDEIH"."STOCK_EQUIPMENT_ID")
44 - access("SE"."MODEL_ID"="M"."MODEL_ID")
49 - access("GS"."GAME_WARE_ID"="GW"."GAME_WARE_ID"(+))
51 - access("EC"."GAMESET_ID"="GS"."GAMESET_ID"(+))
52 - access("S"."SITE_TYPE_ID"="ST"."SITE_TYPE_ID")
54 - access("L"."SITE_ID"="S"."SITE_ID")
56 - access(ROWID=ROWID)
60 - access("MODEL_ATTRIBUTE_VALUE_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."MODEL_ATTRIBUTE_VALUE_ID" AND
"EC"."EQUIPMENT_ID"="EAV"."EQUIPMENT_ID")
filter("EAV"."START_DATE">="EC"."START_DATE" AND ("EAV"."END_DATE" IS NULL AND "EC"."END_DATE">="EAV"."START_DATE" OR
"EC"."END_DATE" IS NULL OR "EAV"."END_DATE"<="EC"."END_DATE") OR "EC"."START_DATE">="EAV"."START_DATE" AND ("EC"."END_DATE"
IS NULL AND "EAV"."END_DATE">="EC"."START_DATE" OR "EAV"."END_DATE" IS NULL OR "EC"."END_DATE"<="EAV"."END_DATE"))
61 - access("EC"."EQUIPMENT_ID"="EC"."EQUIPMENT_ID")
62 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
64 - access("EC"."MODEL_ID"="STOCK_EQUIPMENT"."MODEL_ID")
66 - filter("EC"."END_DATE" IS NULL)
68 - filter("ES"."EQUIPMENT_STATUS_CODE"='AVA')
69 - access("EC"."EQUIPMENT_STATUS_ID"="ES"."EQUIPMENT_STATUS_ID")
71 - filter("EAV"."END_DATE" IS NULL)
73 - access("EC"."LOCATION_ID"="L"."LOCATION_ID")
77 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"=:B1)
78 - access("STOCK_EQUIPMENT"."STOCK_EQUIPMENT_ID"="STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID")
filter("STOCK_EQUIPMENT_ATTRIB_VALUE"."STOCK_EQUIPMENT_ID"=:B1)
5 minutes reduced to 7 seconds.!!
THE QUESTION.
Which (and where) query hint do I use to get the FIRST query to use the execution plan "method" of the second -
IE: To still perform well when a IN-LIST is used instead of EQUALS.
Technical:
Oracle 10.2.0.2 EE on Solaris 8, 64 bit.
Please help.
Thank you.
Below is the code of the referenced views for clarity.
CREATE OR REPLACE FORCE VIEW etrak.v_stocked_equipment_inven_his (stock_equipment_id,
equipment_id,
model_id,
gameset_id,
gameset_is_active,
game_ware_id,
game_ware_is_active,
equipment_status_code,
ec_start_date,
ec_end_date,
eav_start_date,
eav_end_date,
model_attribute_value_id,
site_id,
is_store
AS
SELECT DISTINCT stock_equipment_id, equipment_id, model_id, gameset_id,
gameset_is_active, game_ware_id, game_ware_is_active,
equipment_status_code, ec_start_date, ec_end_date,
eav_start_date, eav_end_date, model_attribute_value_id,
site_id, is_store
FROM (SELECT stock_equipment_id, equipment_id, model_id,
gameset_id, gameset_is_active, game_ware_id,
game_ware_is_active, equipment_status_code,
ec_start_date, ec_end_date, eav_start_date,
eav_end_date, model_attribute_value_id, site_id,
is_store
FROM (SELECT DISTINCT equipment_id, model_id,
gameset_id, gameset_is_active,
game_ware_id, game_ware_is_active,
equipment_status_code,
model_attribute_value_id,
ec_start_date, ec_end_date,
eav_start_date, eav_end_date,
site_id, is_store
FROM (SELECT ec.equipment_id,
ec.model_id,
gs.gameset_id,
gs.active_flag
AS gameset_is_active,
gw.game_ware_id,
gw.active_flag
AS game_ware_is_active,
es.equipment_status_code,
ec.start_date
AS ec_start_date,
ec.end_date
AS ec_end_date,
l.site_id, st.is_store
FROM equipment_configuration ec,
equipment_status es,
LOCATION l,
site s,
site_type st,
gameset gs,
game_ware gw
WHERE ec.equipment_status_id =
es.equipment_status_id
AND ec.gameset_id = gs.gameset_id(+)
AND gs.game_ware_id = gw.game_ware_id(+)
AND ec.location_id =
l.location_id
AND l.site_id = s.site_id
AND s.site_type_id =
st.site_type_id)
JOIN
(SELECT ec.equipment_id,
model_attribute_value_id,
eav.start_date
AS eav_start_date,
eav.end_date
AS eav_end_date
FROM equipment_configuration ec,
equipment_attribute_value eav
WHERE ec.equipment_id =
eav.equipment_id)
USING (equipment_id)
WHERE ( eav_start_date >=
ec_start_date
AND ( ( eav_end_date IS NULL
AND ec_end_date >=
eav_start_date
OR ec_end_date IS NULL
OR eav_end_date <=
ec_end_date
OR ( ec_start_date >=
eav_start_date
AND ( ( ec_end_date IS NULL
AND eav_end_date >=
ec_start_date
OR eav_end_date IS NULL
OR ec_end_date <=
eav_end_date
JOIN
(SELECT stock_equipment_id, model_id,
model_attribute_value_id
FROM stock_equipment JOIN stock_equipment_attrib_value
USING (stock_equipment_id)
) USING (model_id,
model_attribute_value_id)
CREATE OR REPLACE FORCE VIEW etrak.v_stock_equipment_mod_man_list (stock_equipment_id,
stock_equipment_code,
model_id,
model_name,
model_type_id,
model_type_code,
model_type_name,
man_id,
man_name
AS
SELECT se.stock_equipment_id, se.stock_equipment_code, m.model_id,
m.model_name, mt.model_type_id, mt.model_type_code,
mt.model_type_name, ma.man_id, ma.man_name
FROM stock_equipment se, model m, model_type mt, manufacturer ma
WHERE se.model_id = m.model_id
AND m.model_type_id = mt.model_type_id
AND m.man_id = ma.man_id;What also makes it difficult to read is the lack of formatting tags ([code][/code] or [pre][/pre]) so that we can actually read the code and execution plans.
I'm not going to trawl through formatting all that myself just to try and see what the differences are between query 1 and query 2.
Also bear in mind that when query 2 ran, the data may have been cached and so there is less physical I/O required.
You don't really want to use any hints to cause re-use of execution plans from 1 query to a different query (like I said, I don't know how different they are). What you want to do is determine what poor SQL coding is making the first query slow and fix it. -
Business Partner Items (0FC_BP_ITEMS) delta extraction help
Has anybody used 0FC_BP_ITEMS extractor? The documentation says that it supports delta, but it needs to be enabled.
I did enable delta extraction in IMG as SAP help site suggested. However, the documentation also says that before running delta, I need to update/initialize it in tcode FPOP. I go to that tcode, but I can hardly understand what to do in that tcode and there is no help or documentation I can find on how to initialize that delta extraction for 0FC_BP_ITEMS in OLTP system.
anybody came across any help document on FPOP tcode?
ThanksHave you found a solution to the problems you were facing? is there any documentation you have regarding the BP Items extractor.
Maybe you are looking for
-
Can you help? photo booth effect not working properly.
The pop art effect is no longer working on my mom's G5. It only shows a pic in the upper left rahter than the four it used to show: upper left, upper right, lower left and lower right.
-
How to set the expiration date in content server
Hi all, I wish to set the expiration date as 3 years later the current date. I have current Date in DocCreateDate but I am not able to set it as DocCreateDate + 3 years. Can anyone tell me how to set it? Any help appreciated.. Thanks
-
And my photo's have gone too...
Help! Seem to have a similar issue to the last post but as a recent convert from PC I'm no mac expert and got lost in the thread. Any simple advice would be really useful... Using an 08 iMAC 20" / iPhoto 7.1.4 Library was set up and working fine. Upl
-
estaba tratando de sincronizar itunes con mi ipod y despues de unos intentos desconcete el ipod y apague el wifi y de pronto el ipod se reinicio y la barra de avance que aparece junto a la manzana de apple comienza a cargar pero se traba y se queda
-
Update from Snow Leopad to Maverick cause email removal from all my IMAP accounts
Hello, i am using mac Mail.app to manage emails for several accounts. Some using POP some using IMAP. Have been working with same settings for more than 2 years in same system. Last week i got a new macbook pro with maverick on, used migration to tra