How to join this two query
Hi all,
i have these two query .
SELECT A.DATENUM,A.ATT_STATE,B.OT_MINUTES FROM WEB_HR.HR_ATTENDANCE A,WEB_HR.HR_OVERTIME B
WHERE A.MONTH_ID=2 AND A.ATT_YEAR=2009 AND A.EMP_ID=1 AND A.EMP_ID=B.EMP_ID
AND A.COMPANYCODE=1 AND A.DATENUM<=16 ORDER BY a.DATENUM;
SELECT A.DATENUM AS VDATENUM,A.ATT_STATE AS VATT_STATE,B.OT_MINUTES AS VOT_MINUTES FROM WEB_HR.HR_ATTENDANCE A,WEB_HR.HR_OVERTIME B
WHERE A.MONTH_ID=2 AND A.ATT_YEAR=2009 AND A.EMP_ID=1 AND A.EMP_ID=B.EMP_ID
AND A.COMPANYCODE=1 AND A.DATENUM >16 ORDER BY a.DATENUM;
actually from these two query each query returning 3 column each .
so what i need is i want mearge these two in such way that it return 6 column at a time..
can i get this??
You can do that by just joining them. Let's assume your two queries are Q1 and Q2, both with columns c1-3, then just:
select q1.c1, q1.c2, q1.c3, q2.c1, q2.c2, q2.c3
from (Q1) q1
,(Q2) q2But this will result in a cartesian product of the two resultsets (from Q1 and Q2).
The big question is how do you want to combine the rows that come out of Q1 with the rows that come out of Q2. For instance if DATENUM is unique in both resultsets, and you want to combine rows that have matching values on DATENUM (c1, below), then:
select q1.c1, q1.c2, q1.c3, q2.c1, q2.c2, q2.c3
from (Q1) q1
,(Q2) q2
where q1.c1 = q2.c1Toon
Similar Messages
-
Hi
have a two login in forms not in oracle... i have two tables first the
Master secodn the Employees.. my prob is i have two button for this two tables to login.. any solution on how i can join this two in one button that if i connect using from master tables or from employess it will login
FirstTAble:::
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Master
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;
SEcodnTAble
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;use a union on the 2 select statements.
-
How can i join this two query?
I have two table table employee and CSEReduxResponses
In table employee i have
CREATE TABLE [dbo].[employee](
[emp_id] [int] IDENTITY(1,1) NOT NULL,
[emp_namefirst] [varchar](255) NOT NULL,
[emp_namemiddle] [varchar](50) NULL,
[emp_namelast] [varchar](255) NOT NULL
on responds i have
CREATE TABLE [dbo].[CSEReduxResponses](
[response_id] [int] IDENTITY(1,1) NOT NULL,
[employee] [int] NOT NULL,
[employeedept] [int] NOT NULL,
[star] [tinyint] NOT NULL,
[status] [int] NOT NULL,
[approvedby] [int] NULL,
[approveddate] [datetime] NULL,
[execoffice_status] [int] NULL,
Im trying to get the employee with the MAX execpffice_status( this is either a 1 or 0).
i have this query that i made for it
select top(1) with ties employee, SUM(execoffice_status) as 'total'
from CSEReduxResponses
group by employee
order by 'total' desc
my query for employee table is
select emp_namefirst as first , emp_namelast as [last]
from phonelist.dbo.employee where emp_namefirst is not null
How can i get this 2 query together so i can output the employee (first and last )name
with the max exeoffice_status?
i use :
Microsoft SQL Server Management Studio 10.0.2531.0
ps: sorry if i put this is the wrong forum, this is my first time here and first post.Are you looking for the below?
CREATE TABLE [dbo].[employee](
[emp_id] [int] IDENTITY(1,1) NOT NULL,
[emp_namefirst] [varchar](255) NOT NULL,
[emp_namemiddle] [varchar](50) NULL,
[emp_namelast] [varchar](255) NOT NULL
Insert into Employee Values('abc','bcd','cdf')
Insert into Employee Values('xyz','yxw','xwv')
CREATE TABLE [dbo].[CSEReduxResponses](
[response_id] [int] IDENTITY(1,1) NOT NULL,
[employee] [int] NOT NULL,
[employeedept] [int] NOT NULL,
[star] [tinyint] NOT NULL,
[status] [int] NOT NULL,
[approvedby] [int] NULL,
[approveddate] [datetime] NULL,
[execoffice_status] [int] NULL,
Insert into [CSEReduxResponses]( employee,employeedept,star,status,approvedby,approveddate,execoffice_status)
Values(1,100,1,1,1,GETDATE(),0),
(1,100,1,1,1,GETDATE(),1),
(2,100,1,1,1,GETDATE(),0)
;With cte as( Select *,SUM([execoffice_status]) over(partition by Employee) sumstatus From [CSEReduxResponses] )
Select Distinct A.*,B.sumstatus
From Employee A
Inner Join cte B On A.emp_id = B.employee
--OR
;With cte as( Select employee ,SUM([execoffice_status]) sumstatus From [CSEReduxResponses] group by Employee)
Select Distinct A.*,(Select sumstatus From cte B where A.emp_id = B.employee)
From Employee A
Drop table Employee,[CSEReduxResponses] -
Hi to all.. i have this two table , the problem is i dunno how to join this two table into one, becoz in the forms i have two button "BUTTON A IS FOR TABLE A WHICH IS THE EMPLOYEE.. AND BUTTON B IS FOR ADMIN... WHAT I WANT IS TO MAKE THIS TWO BUTTON INTO ONE BUTTON.. i;m using form6i and run in client server..
Guys any one here know plz help how to do this..
TABLE 1
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;
TABLE 2
BEGIN
iF :username IS NULL THEN
MESSAGE ('Please enter Username ');
MESSAGE ('Please enter Username ');
GO_ITEM('username');
RAISE FORM_TRIGGER_FAILURE;
end if;
IF :PASSNAME1 IS NULL THEN
MESSAGE('Please enter password.');
MESSAGE('Please enter password.');
GO_ITEM('PASSNAME1');
RAISE FORM_TRIGGER_FAILURE;
end if;
select username,passname
into :pass.username,:pass.passname1
from Admin1
where :pass.username=username
and :pass.passname1=passname;
Message('Access Granted');
Message('Access Granted');
go_block('maina');
hide_view('pass1');
exception
when no_Data_found then
set_alert_Property('wrong',Alert_Message_text,'Invalid Password');
if show_alert('wrong')=alert_button1 then
go_item('PASSNAME1');
:passname1:=null;
end if;
end;like i told you before in this posting How to join this two tables
use a union
select username,passname
into :pass.username,:pass.passname1
from Employees
where :pass.username=username
and :pass.passname1=passname
union
select username,passname
into :pass.username,:pass.passname1
from Admin1
where :pass.username=username
and :pass.passname1=passname; -
How to execute this SQL Query in ABAP Program.
Hi,
I have a string which is the SQL Query.
How to execute this sql Query (SQL_STR) in ABAP Program.
Code:-
DATA: SQL_STR type string.
SQL_STR = 'select * from spfli.'.
Thanks in Advance,
VinayHi Vinay
Here is a sample to dynamically generate a subroutine-pool having your SQL and calling it.
REPORT dynamic_sql_example .
DATA: BEGIN OF gt_itab OCCURS 1 ,
line(80) TYPE c ,
END OF gt_itab .
DATA gt_restab TYPE .... .
DATA gv_name(30) TYPE c .
DATA gv_err(120) TYPE c .
START-OF-SELECTION .
gt_itab-line = 'REPORT generated_sql .' .
APPEND gt_itab .
gt_itab-line = 'FORM exec_sql CHANGING et_table . ' .
APPEND gt_itab .
gt_itab-line = SQL_STR .
APPEND gt_itab .
gt_itab-line = 'ENDFORM.' .
APPEND gt_itab .
GENERATE SUBROUTINE POOL gt_itab NAME gv_name MESSAGE gv_err .
PERFORM exec_sql IN PROGRAM (gv_name) CHANGING gt_restab
IF FOUND .
WRITE:/ gv_err .
LOOP AT gt_result .
WRITE:/ .... .
ENDLOOP .
*--Serdar -
How to add this two fields AUGBL & ZLSCH in FBL3 in abap 3.1 version
How to add the clearing document no. & payment method in FBL3 tcode. Can any one explain me step by step process how to add that two fields. This is ABAP 3.1 version. It's urgent requirement.
Moderator Message: Duplicate thread locked. Please carry on with this thread: How to add this two fields AUGBL & ZLSCH in FBL3 in abap 3.1 version
Message was edited by: Suhas SahaDid you read the note provided in How to add this two fields AUGBL & ZLSCH in FBL3 in abap 3.1 version ?
Regards,
Raymond -
How join the two query block with same field
sorry sir i am posting dublicate thread
i thought you not understand my question
sir i have two query block in report with same field
i try the link object but that creat now block not creat link withen query block
please give me idea
thankDear,
Use data link object.
Click at data link object then click on the fild in query block1 and drag it into the other query block data link will be created.
try it -
How to switch between two query in Web templete.
Hi all,
Here i am facing problem to switch between two query in web template by using one 'table' web item. is there any way to use hyperlink 'SAP_BW_URL' and we can switch to query. here i am using these HTML code..
<table><tr><td class="SAPBEXBtnStdBorder" cellspacing="0" cellpadding="0" border="0"><tr><td>
<table><tr><td class="sapbexbtnstd" ><A href="<SAP_BW_URL cmd='reset_item' item='table_data' query_ID='ZSD_ZSD_M01_Q20' apply_cmd_on_target= "X">" >Switch to other query</A></td></tr></table>
but i am not getting correct functionality.
please help me to solve this problem.
I know the best way to say thanks in SDN.
thanks
Kiran PatelKiran,
Use the web api reset_data_provider as links or in select option in HTML.
Onchange event of this select option should call JAVASCRIPT method and
this in turn resets the current dataprovider to your concerned one.
How to change graphs:
The graph item has the default data provider:
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="CHART_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_CHART"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="TMP_CHART_DATA_HANDLE" value="IIP_49MOXB0UVNOMM6JOZMZU7QO21"/>
ITEM: CHART_1
</object>
So if you change the DATAPROVIDER_1 using RESET_DATA_PROVIDER to your concerned DP, this changes chart as well !!
Please use this method and refer to sample code for Onchange Event on SELECT OPTION:
<HTML>
<HEAD>
<script>
function callDP() {
if(document.forms[0].dp.value == "1") {
//form your URL here..
url = SAP_BW_URL_Get() + "&CMD=RESET_DATA_PROVIDER&DATA_PROVIDER_1=..&...";
SAPBWOpenURL(url);
//or docuemtn.location.href = url..
//etc..
</script>
</HEAD>
<BODY>
<form>
<select name="dp" onChange="javascript:callDP();">
<option value="1">1</option>
<option value="2">2</option>
</select>
</form>
</BODY>
</HTML>
HOPE THIS HELPS !!! -
Hi experts,
I need to join two queries but not sure how:
select id from test_table1;
select *
from table(f_function(null
,null
,1 -- the id
,sysdate);One query has IDs needed to run the second query. Is there a way to join those two?
The result should be all columns from test_table1 + all columns from f_function.
Best regards,
Igor
Edited by: Igor S. on Mar 8, 2013 5:18 AMHi,
Igor S. wrote:
select *
from test_table1,
table(
f_function(
null,
null,
id,
sysdate
select *
from test_table1,
table(
f_function(
null,
null,
id,
sysdate
) xyz
where test_table1.id = xyz.id
/So these two queries are the same?Try it and see.
You'll find that the 2nd one produces an error. But if you change it to
select *
from test_table1,
table(
f_function(
null,
null,
id,
sysdate
) -- No alias here
) xyz -- Alias here, instead
where test_table1.id = xyz.id
/Then, assuming f_function produces a column called id, it will work.
Whether it produces the same results or not depends on what the function returns, and whether either id is NULL.
If the id column that the function returns is the same as the id value that you pass to it, and is never NULL, then the 2 queries will produce the same results.
Either way, each row of test_table1 will be joined to each row that the function produces with the argument(s) from that row. The column names produced by the function and the values in those columns are determined by the function; they do not need to have anything in common with any table. In practice, a function like f_function will usually not return an column that is always identical to any of its inputs, since that value is already available from the input. -
How to write this sql query in php code ?
for example:
insert into temp
select *
from testtable;
after this, i will query data from sql below:
select *
from temp;
how to write this php code ?
who can help me ?
thanks!Have a look at the manual to find out how to issue queries.
http://us3.php.net/oci8 -
How to convert this SQL query to PL/SQL
I basically need to create an anonymous block that will display each student's first name, last name and the count of students who scored less on test 1 than the student.
So basically we need to find the count of students who have scored less than that particular student and we do it for all students in the table.
So for this particular query i designed my code in SQL
select g1.gr_fname, g1.gr_lname, count(*)
from grade g1, grade g2
where g1.gr_t1 > g2.gr_t1 and
g1.std_code = g2.std_code
group by g1.gr_fname, g1.gr_lname;
But i am unable to get the logic as to how to execute it in PL/SQL,I am missing something a minor detail to execute the same in PL/SQL
could someone please help me with the logic.
ThanksHi welcome to the forum try some thing below
SQL> DECLARE
2 CURSOR c1
3 IS
4 SELECT ename, sal, d.deptno
5 FROM scott.emp e, scott.dept d
6 WHERE e.deptno = d.deptno
7 GROUP BY ename, sal, d.deptno;
8 BEGIN
9 FOR c2 IN c1
10 LOOP
11 DBMS_OUTPUT.put_line ('name is ' || c2.ename);
12 END LOOP;
13 END;
14 /
name is CLARK
name is KING
name is JONES
name is MARTIN
name is FORD
name is SCOTT
name is ALLEN
name is TURNER
name is WARD
name is MILLER
name is ADAMS
name is BLAKE
name is JAMES
name is SMITH
PL/SQL procedure successfully completed.This is just to demonstrate the use of PL/SQL block -
As far as I know this two bapi used to create accounting document. But how do we use them ? and what's the different between them?
The most important thing is in what condition we use which bapi to post accounting doc?
Such as there is one requirement to post accounting doc though t-code F-02 in BDC, but how do I know whether I can use this two bapi to replace the BDC?
BAPI_ACC_DOCUMENT_POST
BAPI_ACC_GL_POSTING_POSTHello,
how we use BAPI_ACC_DOCUMENT_POST:
gs_documentheader-ref_doc_no = .... your document number (from number range)
gs_documentheader-bus_act = 'RFBU'.
gs_documentheader-username = sy-uname.
gs_documentheader-header_txt = .... your header text
gs_documentheader-comp_code = '0001'.
gs_documentheader-doc_date = ..... date
gs_documentheader-pstng_date = .... date
gs_documentheader-fisc_year =.... year
gs_documentheader-fis_period = .... period
gs_documentheader-doc_type = 'BS'.
loop at ... items ... assigning <belpos_line>.
gs_accountgl-itemno_acc = <belpos_line>-posnr. "10 digits !
gs_accountgl-bus_area = ... your business area
gs_accountgl-tax_code = <belpos_line>-tax_code.
gs_accountgl-gl_account = <belpos_line>-gl_account.
gs_accountgl-comp_code = ... your company code.
gs_accountgl-alloc_nmbr = ... some identity number
gs_accountgl-item_text = .... item text
gs_accountgl-costcenter = <belpos_line>-kostl.
gs_accountgl-plant = .... werks
append gs_accountgl to gt_accountgl.
gs_currencyamount-itemno_acc = <belpos_line>-posnr.
gs_currencyamount-currency = ... waers
gs_currencyamount-amt_doccur = .... waers
append gs_currencyamount to gt_currencyamount.
endloop.
call function 'BAPI_ACC_DOCUMENT_POST'
exporting
documentheader = gs_documentheader
importing
obj_type = gd_obj_type
obj_key = gd_obj_key
obj_sys = gd_obj_sys
tables
accountgl = gt_accountgl
currencyamount = gt_currencyamount
return = gt_return.
Regards -
How to make this two things at the same time ?
Hello
When my mouse is on a area, I need :
- to show a object (a rectangle inserted with the toolbar)
- to show a caption
I think it's not possible to do this two things at the same time when I use the rollover functions (Rollover caption or Rollover Image).
I would like to use a button, but the button works only if I click it, and not when I just pass my mouse on it.
Someone have an Idea?
I can't use Javascript.
ThanksRick is correct. You can use the Rollover Slidelet's rollover area to trigger an Advanced Action. You'll need to create this Advanced Action with two clauses. One to SHOW the caption, and the other to SHOW the rectangle.
Your alternative to the rollover slidelet is to use an Event Handler widget attached to the object that the mouse should roll over.
The Event Handler will detect when the mouse is over the object and trigger its own Success criteria. You can then use the widget's ON Success event to trigger the Advanced Action as mentioned above.
More information about using the Event Handler here: http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets
An example of using it to do two different things on the same object can be found at this web page: http://www.infosemantics.com.au/adobe-captivate-advanced-elearning-tutorials/beat-adobe-ca ptivate-interactive-catch22
Trial versions of the widget can be downloaded from here: http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets -
Hi, I have a query regarding joins
I have two tables named Master_table and Child_table. suppose assume that tables look like this
Master_table
ID name .. ..
1
2
3
4
5
6
7
8
9
10
100
Child_table
ID Date .. ..
101
102
103
104
105
1
2
3
4
109
200
I have some conditions and wrote a single query using views and joins and got some rows from Master table
and also from child table. suppose assume I queried 50 results from Master table and 40 from child table
now
condition 1:
I have to get the same ID's common data from both the tables so I wrote query as shown below
to get that data I used this join condition master.ID = child.ID this works fine and returning the result ID
as 1,2,3,4 that's fine
conditon 2:
Now I have to write the query that it shouldn't return the above ID's i.e 1,2,3,4 and return the remaining 46 IDs present in the
master table query resultset (Actually our master table query returned 50 ID's)
now my join condition is as shown below
master.ID = child.ID(+) but it is returning 50 IDs I want only those 46 except those above 4 IDs.
can any one help me out
Thanks
basuThanks for your response
I will be more clear regarding this query. Assume my Master table and child table have 100 rows each. No I used views and some conditions
and get 50 results from my Master table view and 40 results from my Child table view .Now in those 50 and 40 I have common date assume 4 rows. Now I want to eliminate those 4 (not 40 rows in child table) rows from the 50(result set of master table)rows and get the remaining rows. -
How to tune this SQL Query?
Hi all expert out there,
I am using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options.
I have this ERP 11i query took 3-4hours to execute. can anyone help to have a look at the Query so make it more faster? I am already out of my idea of solving this. Kindly helpzzz...
SELECT
/*+ first_rows(1)*/
hou.name "OU" ,-- e.g. Seagate Technology USOP1 ,
mc.description,
oel.ordered_item "Product Part Number",
oeh.order_number "Order Num",
hp.party_name "Bill To Cust Name",
hcsu.location "Ship To Cust Num",
oel.line_number || '.' || oel.shipment_number "Order Line Num",
ft.nls_territory "Ship To Country",
mc.segment7 "designapplication",
ccm.formattedcapacity||'GB' "Capacity",
oel.attribute1 "Order Category",
oel.Subinventory "Subinventory",
to_char(oel.actual_shipment_date,'MM/DD/YYYY DY') "Shipment Date",
NVL(oel.shipped_quantity,0) "Net Units"
FROM
oe_order_headers_all oeh
,oe_order_lines_all oel
,apps.hz_parties hp
,apps.hz_cust_accounts hca
,apps.hz_cust_site_uses_all hcsu
,apps.hz_cust_acct_sites_all hcas
, apps.seaeng_ccfamilymodelinfo ccm
,apps.hz_party_sites hps
,apps.fnd_territories ft
,apps.hz_locations hl
,apps.hr_organization_units hou
,apps.mtl_parameters mp
,apps.mtl_item_categories mic
,apps.mtl_categories_b mc
,apps.fnd_lookup_values flv
WHERE
oeh.header_id = oel.header_id
AND oel.flow_status_code = 'CLOSED'
AND oeh.invoice_to_org_id = hcsu.site_use_id
AND hl.country = ft.territory_code
AND hps.location_id = hl.location_id
AND hcas.party_site_id = hps.party_site_id
AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND hcas.cust_account_id = hca.cust_account_id
AND hca.party_id = hp.party_id
AND oeh.org_id = hou.organization_id
AND oel.ship_from_org_id = mp.organization_id
AND oel.inventory_item_id = mic.inventory_item_id
AND mic.category_id = mc.category_id
AND mic.category_set_id = 4
AND mc.description = ccm.stmodelnumber
AND flv.lookup_code = hca.sales_channel_code
AND flv.lookup_type = 'SALES_CHANNEL'
AND mc.segment7 IN ('PSG','ESG','NSG')
AND flv.lookup_code NOT IN ('RTL','AD-RTL','EU')
AND oel.attribute1 IN ('NB','NBEOL','NBSEA')
AND oel.subinventory IN ('KFGI','AFGI','SFGIF','FGIF')
AND hou.organization_id = 189
AND trunc(oel.actual_shipment_date) between TO_DATE('01-Jan-2009','DD-MON-YYYY') and TO_DATE('31-JAN-2009','DD-MON-YYYY')
regards,
Lygine
Edited by: user8989062 on Jun 7, 2010 6:39 PM5) The TKPROF output for this statement looks like the following:
SELECT
/*+ first_rows(1)*/
hou.name "OU" ,-- e.g. Seagate Technology USOP1 ,
mc.description,
oel.ordered_item "Product Part Number",
oeh.order_number "Order Num",
hp.party_name "Bill To Cust Name",
hcsu.location "Ship To Cust Num",
oel.line_number || '.' || oel.shipment_number "Order Line Num",
ft.nls_territory "Ship To Country",
mc.segment7 "designapplication",
ccm.formattedcapacity||'GB' "Capacity",
oel.attribute1 "Order Category",
oel.Subinventory "Subinventory",
to_char(oel.actual_shipment_date,'MM/DD/YYYY DY') "Shipment Date",
NVL(oel.shipped_quantity,0) "Net Units"
FROM
oe_order_headers_all oeh
,oe_order_lines_all oel
,apps.hz_parties hp
,apps.hz_cust_accounts hca
,apps.hz_cust_site_uses_all hcsu
,apps.hz_cust_acct_sites_all hcas
, apps.seaeng_ccfamilymodelinfo ccm
,apps.hz_party_sites hps
,apps.fnd_territories ft
,apps.hz_locations hl
,apps.hr_organization_units hou
,apps.mtl_parameters mp
,apps.mtl_item_categories mic
,apps.mtl_categories_b mc
,apps.fnd_lookup_values flv
WHERE
oeh.header_id = oel.header_id
AND oel.flow_status_code = 'CLOSED'
AND oeh.invoice_to_org_id = hcsu.site_use_id
AND hl.country = ft.territory_code
AND hps.location_id = hl.location_id
AND hcas.party_site_id = hps.party_site_id
AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND hcas.cust_account_id = hca.cust_account_id
AND hca.party_id = hp.party_id
AND oeh.org_id = hou.organization_id
AND oel.ship_from_org_id = mp.organization_id
AND oel.inventory_item_id = mic.inventory_item_id
AND mic.category_id = mc.category_id
AND mic.category_set_id = 4
AND mc.description = ccm.stmodelnumber
AND flv.lookup_code = hca.sales_channel_code
AND flv.lookup_type = 'SALES_CHANNEL'
AND mc.segment7 IN ('PSG','ESG','NSG')
AND flv.lookup_code NOT IN ('RTL','AD-RTL','EU')
AND oel.attribute1 IN ('NB','NBEOL','NBSEA')
AND oel.subinventory IN ('KFGI','AFGI','SFGIF','FGIF')
AND hou.organization_id = 189
AND trunc(oel.actual_shipment_date) between TO_DATE('01-Jan-2009','DD-MON-YYYY') and TO_DATE('31-JAN-2009','DD-MON-YYYY')
call count cpu elapsed disk query current rows
Parse 1 0.79 0.79 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 7 22.23 240.85 19781 536082 0 592
total 9 23.02 241.64 19781 536082 0 592
Misses in library cache during parse: 1
Optimizer mode: FIRST_ROWS
Parsing user id: 173
Rows Row Source Operation
592 NESTED LOOPS (cr=536082 pr=19781 pw=0 time=240822989 us)
592 NESTED LOOPS (cr=534885 pr=19776 pw=0 time=239960969 us)
592 NESTED LOOPS (cr=533688 pr=19776 pw=0 time=239902332 us)
594 NESTED LOOPS (cr=532493 pr=19776 pw=0 time=239811721 us)
594 NESTED LOOPS (cr=531892 pr=19776 pw=0 time=239794703 us)
594 NESTED LOOPS (cr=530693 pr=19772 pw=0 time=239325284 us)
594 NESTED LOOPS (cr=529498 pr=19770 pw=0 time=239152940 us)
594 NESTED LOOPS (cr=527709 pr=19766 pw=0 time=236850676 us)
594 NESTED LOOPS (cr=525920 pr=19764 pw=0 time=235640068 us)
2990 NESTED LOOPS (cr=516943 pr=19688 pw=0 time=195144282 us)
2990 NESTED LOOPS (cr=516936 pr=19688 pw=0 time=195120297 us)
2990 NESTED LOOPS (cr=510806 pr=19682 pw=0 time=194678671 us)
3000 HASH JOIN (cr=504799 pr=19669 pw=0 time=193829763 us)
3000 NESTED LOOPS (cr=472280 pr=360 pw=0 time=49218087 us)
1 NESTED LOOPS (cr=1029 pr=34 pw=0 time=1745829 us)
1 TABLE ACCESS BY INDEX ROWID HR_ALL_ORGANIZATION_UNITS_TL (cr=424 pr=25 pw=0 time=1361442 us)
1 INDEX UNIQUE SCAN HR_ALL_ORGANIZATION_UNTS_TL_PK (cr=423 pr=25 pw=0 time=1361397 us)(object id 44637)
1 TABLE ACCESS BY INDEX ROWID HR_ALL_ORGANIZATION_UNITS (cr=605 pr=9 pw=0 time=384370 us)
1 INDEX UNIQUE SCAN HR_ORGANIZATION_UNITS_PK (cr=1 pr=0 pw=0 time=27 us)(object id 43498)
3000 TABLE ACCESS BY INDEX ROWID OE_ORDER_LINES_ALL (cr=471251 pr=326 pw=0 time=47466249 us)
156922 INDEX RANGE SCAN OE_ORDER_LINES_N20 (cr=420 pr=7 pw=0 time=787919 us)(object id 37005064)
263469 TABLE ACCESS FULL MTL_ITEM_CATEGORIES (cr=32519 pr=19309 pw=0 time=144242743 us)
2990 TABLE ACCESS BY INDEX ROWID MTL_CATEGORIES_B (cr=6007 pr=13 pw=0 time=843569 us)
3000 INDEX UNIQUE SCAN MTL_CATEGORIES_B_U1 (cr=3007 pr=2 pw=0 time=162636 us)(object id 37199)
2990 TABLE ACCESS BY INDEX ROWID SEAENG_CCFAMILYMODELINFO (cr=6130 pr=6 pw=0 time=437784 us)
2990 INDEX UNIQUE SCAN SEAENG_CCFAMILYMODELINFO_U1 (cr=2997 pr=0 pw=0 time=52872 us)(object id 35838918)
2990 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=7 pr=0 pw=0 time=16332 us)(object id 37657)
594 TABLE ACCESS BY INDEX ROWID OE_ORDER_HEADERS_ALL (cr=8977 pr=76 pw=0 time=40491633 us)
2990 INDEX UNIQUE SCAN OE_ORDER_HEADERS_U1 (cr=5987 pr=45 pw=0 time=2504442 us)(object id 41952)
594 TABLE ACCESS BY INDEX ROWID HZ_CUST_SITE_USES_ALL (cr=1789 pr=2 pw=0 time=1208576 us)
594 INDEX UNIQUE SCAN HZ_CUST_SITE_USES_U1 (cr=1195 pr=1 pw=0 time=105934 us)(object id 25124976)
594 TABLE ACCESS BY INDEX ROWID HZ_CUST_ACCT_SITES_ALL (cr=1789 pr=4 pw=0 time=2300224 us)
594 INDEX UNIQUE SCAN HZ_CUST_ACCT_SITES_U1 (cr=1195 pr=2 pw=0 time=152238 us)(object id 25124996)
594 TABLE ACCESS BY INDEX ROWID HZ_PARTY_SITES (cr=1195 pr=2 pw=0 time=170875 us)
594 INDEX UNIQUE SCAN HZ_PARTY_SITES_U1 (cr=601 pr=1 pw=0 time=104550 us)(object id 25124993)
594 TABLE ACCESS BY INDEX ROWID HZ_LOCATIONS (cr=1199 pr=4 pw=0 time=467329 us)
594 INDEX UNIQUE SCAN HZ_LOCATIONS_U1 (cr=601 pr=0 pw=0 time=57749 us)(object id 25124992)
594 TABLE ACCESS BY INDEX ROWID FND_TERRITORIES (cr=601 pr=0 pw=0 time=15562 us)
594 INDEX UNIQUE SCAN FND_TERRITORIES_U1 (cr=7 pr=0 pw=0 time=6492 us)(object id 33083)
592 TABLE ACCESS BY INDEX ROWID HZ_CUST_ACCOUNTS (cr=1195 pr=0 pw=0 time=88925 us)
594 INDEX UNIQUE SCAN HZ_CUST_ACCOUNTS_U1 (cr=601 pr=0 pw=0 time=27607 us)(object id 81600)
592 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=1197 pr=0 pw=0 time=56714 us)(object id 32878)
592 TABLE ACCESS BY INDEX ROWID HZ_PARTIES (cr=1197 pr=5 pw=0 time=860140 us)
592 INDEX UNIQUE SCAN HZ_PARTIES_U1 (cr=599 pr=0 pw=0 time=51136 us)(object id 25126074)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 7 0.00 0.00
row cache lock 1 0.00 0.00
gc current block 2-way 24112 0.00 19.28
gc cr grant 2-way 406 0.00 0.19
db file sequential read 441 0.09 14.11
gc cr block 2-way 284 0.00 0.23
gc cr block busy 147 0.19 9.59
gc current block congested 2 0.00 0.00
gc cr multi block request 13079 0.00 3.98
SQL*Net message from client 7 0.27 1.87
gc cr failure 39 0.00 0.02
cr request retry 39 0.98 38.27
SQL*Net more data to client 12 0.00 0.00
db file scattered read 2446 0.13 132.58
gc cr disk read 5 0.00 0.00
********************************************************************************6) The DBMS_XPLAN.DISPLAY_CURSOR output:
SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID b8pfhfxscqn1m, child number 0
SELECT /*+ gather_plan_statistics */ hou.name "OU" ,-- e.g. Seagate Technology USOP1 , mc.descript
oeh.order_number "Order Num", hp.party_name "Bill To Cust Name", hcsu.location "Ship To Cust Num",
Num", ft.nls_territory "Ship To Country", mc.segment7 "designapplication", ccm.formattedcapacity
oel.Subinventory "Subinventory", to_char(oel.actual_shipment_date,'MM/DD/YYYY DY') "Shipment Date",
oe_order_headers_all oeh ,oe_order_lines_all oel ,apps.hz_parties hp ,apps.hz_cust
,apps.hz_cust_acct_sites_all hcas , apps.seaeng_ccfamilymodelinfo ccm ,apps.hz_party_sites hps
,apps.hr_organization_units hou ,apps.mtl_paramete
Plan hash value: 414863479
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | Reads | O
| 1 | NESTED LOOPS | | 1 | 1 | 592 |00:02:25.13 | 535K| 57267 | |
| 2 | NESTED LOOPS | | 1 | 1 | 592 |00:02:24.22 | 533K| 57185 |
| 3 | NESTED LOOPS | | 1 | 1 | 592 |00:02:24.15 | 532K| 57183 |
| 4 | NESTED LOOPS | | 1 | 1 | 594 |00:02:24.00 | 531K| 57171 |
| 5 | NESTED LOOPS | | 1 | 1 | 594 |00:02:23.98 | 530K| 57170 |
| 6 | NESTED LOOPS | | 1 | 1 | 594 |00:02:23.49 | 529K| 57129 |
| 7 | NESTED LOOPS | | 1 | 1 | 594 |00:02:23.08 | 528K| 57096 |
| 8 | NESTED LOOPS | | 1 | 1 | 594 |00:02:22.51 | 526K| 57031 | |
| 9 | NESTED LOOPS | | 1 | 1 | 594 |00:02:21.79 | 524K| 56968 | |
| 10 | NESTED LOOPS | | 1 | 1 | 2990 |00:02:09.65 | 515K| 55703 |
| 11 | NESTED LOOPS | | 1 | 1 | 2990 |00:02:09.62 | 515K| 55703 |
| 12 | NESTED LOOPS | | 1 | 1 | 2990 |00:02:08.47 | 509K| 55599 |
|* 13 | HASH JOIN | | 1 | 2 | 3000 |00:02:07.88 | 503K| 55516 | 974K
| 14 | NESTED LOOPS | | 1 | 2 | 3000 |00:01:39.07 | 471K| 23025 |
| 15 | NESTED LOOPS | | 1 | 1 | 1 |00:00:00.01 | 4 | 0 |
| 16 | TABLE ACCESS BY INDEX ROWID| HR_ALL_ORGANIZATION_UNITS_TL | 1 | 1 | 1 |00:00
|* 17 | INDEX UNIQUE SCAN | HR_ALL_ORGANIZATION_UNTS_TL_PK | 1 | 1 | 1 |00:00:00.0
|* 18 | TABLE ACCESS BY INDEX ROWID| HR_ALL_ORGANIZATION_UNITS | 1 | 1 | 1 |00:00:
|* 19 | INDEX UNIQUE SCAN | HR_ORGANIZATION_UNITS_PK | 1 | 1 | 1 |00:00:00.01
|* 20 | TABLE ACCESS BY INDEX ROWID | OE_ORDER_LINES_ALL | 1 | 2 | 3000 |00:01
|* 21 | INDEX RANGE SCAN | OE_ORDER_LINES_N20 | 1 | 47575 | 156K|00:00:01.76 | 420
|* 22 | TABLE ACCESS FULL | MTL_ITEM_CATEGORIES | 1 | 96977 | 263K|00:00:28.49
|* 23 | TABLE ACCESS BY INDEX ROWID | MTL_CATEGORIES_B | 3000 | 1 | 2990 |00:00:0
|* 24 | INDEX UNIQUE SCAN | MTL_CATEGORIES_B_U1 | 3000 | 1 | 3000 |00:00:00.21
| 25 | TABLE ACCESS BY INDEX ROWID | SEAENG_CCFAMILYMODELINFO | 2990 | 1 | 2990 |
|* 26 | INDEX UNIQUE SCAN | SEAENG_CCFAMILYMODELINFO_U1 | 2990 | 1 | 2990 |00:00:
|* 27 | INDEX UNIQUE SCAN | MTL_PARAMETERS_U1 | 2990 | 1 | 2990 |00:00:00.02 |
|* 28 | TABLE ACCESS BY INDEX ROWID | OE_ORDER_HEADERS_ALL | 2990 | 1 | 594 |00:00:
|* 29 | INDEX UNIQUE SCAN | OE_ORDER_HEADERS_U1 | 2990 | 1 | 2990 |00:00:04.29 |
| 30 | TABLE ACCESS BY INDEX ROWID | HZ_CUST_SITE_USES_ALL | 594 | 1 | 594 |00:00:
|* 31 | INDEX UNIQUE SCAN | HZ_CUST_SITE_USES_U1 | 594 | 1 | 594 |00:00:00.31 |
| 32 | TABLE ACCESS BY INDEX ROWID | HZ_CUST_ACCT_SITES_ALL | 594 | 1 | 594 |00:00:
|* 33 | INDEX UNIQUE SCAN | HZ_CUST_ACCT_SITES_U1 | 594 | 1 | 594 |00:00:00.23 |
| 34 | TABLE ACCESS BY INDEX ROWID | HZ_PARTY_SITES | 594 | 1 | 594 |00:00:0
|* 35 | INDEX UNIQUE SCAN | HZ_PARTY_SITES_U1 | 594 | 1 | 594 |00:00:00.17 | 601
| 36 | TABLE ACCESS BY INDEX ROWID | HZ_LOCATIONS | 594 | 1 | 594 |00:00:00.4
|* 37 | INDEX UNIQUE SCAN | HZ_LOCATIONS_U1 | 594 | 1 | 594 |00:00:00.17 |
| 38 | TABLE ACCESS BY INDEX ROWID | FND_TERRITORIES | 594 | 1 | 594 |00:00:00
|* 39 | INDEX UNIQUE SCAN | FND_TERRITORIES_U1 | 594 | 1 | 594 |00:00:00.02
|* 40 | TABLE ACCESS BY INDEX ROWID | HZ_CUST_ACCOUNTS | 594 | 1 | 592 |00:00:0
|* 41 | INDEX UNIQUE SCAN | HZ_CUST_ACCOUNTS_U1 | 594 | 1 | 594 |00:00:00.04 |
|* 42 | INDEX RANGE SCAN | FND_LOOKUP_VALUES_U1 | 592 | 1 | 592 |00:00:00.06 |
| 43 | TABLE ACCESS BY INDEX ROWID | HZ_PARTIES | 592 | 1 | 592 |00:00:00.91 |
|* 44 | INDEX UNIQUE SCAN | HZ_PARTIES_U1 | 592 | 1 | 592 |00:00:00.40 | 599
Predicate Information (identified by operation id):
13 - access("OEL"."INVENTORY_ITEM_ID"="MIC"."INVENTORY_ITEM_ID")
17 - access("HAOTL"."ORGANIZATION_ID"=189 AND "HAOTL"."LANGUAGE"=USERENV('LANG'))
filter(DECODE("HR_SECURITY"."VIEW_ALL"(),'Y','TRUE',"HR_SECURITY"."SHOW_RECORD"('HR_ALL_ORGAN
18 - filter("HAO"."BUSINESS_GROUP_ID"=DECODE("HR_GENERAL"."GET_XBG_PROFILE"(),'Y',"HAO"."BUSINESS_
19 - access("HAO"."ORGANIZATION_ID"=189)
20 - filter(("OEL"."FLOW_STATUS_CODE"='CLOSED' AND INTERNAL_FUNCTION("OEL"."ATTRIBUTE1") AND INTER
21 - access("OEL"."SYS_NC00342$">=TO_DATE(' 2009-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "O
'syyyy-mm-dd hh24:mi:ss'))
22 - filter("MIC"."CATEGORY_SET_ID"=4)
23 - filter(("MC"."DESCRIPTION" IS NOT NULL AND INTERNAL_FUNCTION("MC"."SEGMENT7")))
24 - access("MIC"."CATEGORY_ID"="MC"."CATEGORY_ID")
26 - access("MC"."DESCRIPTION"="CCM"."STMODELNUMBER")
27 - access("OEL"."SHIP_FROM_ORG_ID"="MP"."ORGANIZATION_ID")
28 - filter("OEH"."ORG_ID"=189)
29 - access("OEH"."HEADER_ID"="OEL"."HEADER_ID")
31 - access("OEH"."INVOICE_TO_ORG_ID"="HCSU"."SITE_USE_ID")
33 - access("HCSU"."CUST_ACCT_SITE_ID"="HCAS"."CUST_ACCT_SITE_ID")
35 - access("HCAS"."PARTY_SITE_ID"="HPS"."PARTY_SITE_ID")
37 - access("HPS"."LOCATION_ID"="HL"."LOCATION_ID")
39 - access("HL"."COUNTRY"="FT"."TERRITORY_CODE")
40 - filter(("HCA"."SALES_CHANNEL_CODE"<>'RTL' AND "HCA"."SALES_CHANNEL_CODE"<>'AD-RTL' AND "HCA".
41 - access("HCAS"."CUST_ACCOUNT_ID"="HCA"."CUST_ACCOUNT_ID")
42 - access("FLV"."LOOKUP_TYPE"='SALES_CHANNEL' AND "FLV"."LOOKUP_CODE"="HCA"."SALES_CHANNEL_CODE"
filter(("FLV"."LOOKUP_CODE"<>'RTL' AND "FLV"."LOOKUP_CODE"<>'AD-RTL' AND "FLV"."LOOKUP_CODE"<
44 - access("HCA"."PARTY_ID"="HP"."PARTY_ID")
90 rows selected.
{code} &nbs
Maybe you are looking for
-
PLEASE HELP me with my Client/Server problem !!!
I have a method that can currently only recieve one file at a time, but I need it to be able to recieve multiple incomming files. My problem is that it can recieve the first file, but when the send file is sent to this method, it freezes. Can somebod
-
Newbie-How Do You Turn On/Off Webcam On The S10?
Curious how the webcam works on the S10? How do you turn on/off the internal camera? Any instructions on use? Thanks.
-
How PriorityQueue Works ?
I Need help because im working with PriorityQueue but i dont understand how they work. This is my code: import java.util.PriorityQueue; public class PQ { public static void main(String... args) { PriorityQueue<String> pq = new Priority
-
Where do I find iPad Air backup extractor for iOS 7.0
Where do I find the backup extractor to download for my iPad Air iOS 7 to recover deleted photos?
-
Errors in R3load processes during Copy Source System ERP 2005
Hello, I'm executing the Copy Source from an ERP 2005 SR2 nounicode system. In windows2003 32 bits. During R3load processes I have the follow error for all packages. I used the users "administrator" and <SID>adm, and in both the error is the same: F: