Query RN Requirement
hi
I have reqt like,
i need to search the data from Base table and Custom table.
But i want to display rows from custom table with the Delete/Update image .
for that how to create Search VO
Thanx
Hi,
You can create EO and then VO based on it after this modify SQL query of VO to include your custom table and join conditions.
Hope this will help.
Regards,
Reetesh Sharma
Similar Messages
-
HI Experts ,
Could you please help me in getting below output ,
My Input Table :
Number
Loc_A
LOC_B
PARENT_NUMBER
A-01
Ind
Aus
A
A-02
Fra
NZ
A
A-03
Ind
SL
A
A-04
USA
Aus
A
A-05
Pak
WI
A
A-06
Fra
Ag
A
A-07
Rus
Ban
A
A-08
SA
Ind
A
A-09
Ind
Ind
A
My Required Output
Number
Loc_A
LOC_B
PARENT_NUMBER
A-01
Ind
Aus
A
A-02
Fra
NZ
A
A-03
Ind
SL
null
A-04
USA
Aus
null
A-05
Pak
WI
A
A-06
Fra
Ag
null
A-07
Rus
Ban
A
A-08
SA
Ind
A
A-09
Ind
Ind
null
I am comparing each and every record with its previous rows values for column Loc_A and Loc_B and if they are getting matched i m inserting null .
table structure
with t as
(select 'A-01' as Num,'Ind' as Loc_A,'Aus' as Loc_B,'A' as Parent_Num from dual
union all
select 'A-02' as Num,'Fra' as Loc_A,'NZ' as Loc_B,'A' as Parent_Num from dual
Union all
select 'A-03' as Num,'Ind' as Loc_A,'SL' as Loc_B,'A' as Parent_Num from dual
union all
select 'A-04' as Num,'USA' as Loc_A,'Aus' as Loc_B,'A' as Parent_Num from dual
union all
select 'A-05' as Num,'Pak' as Loc_A,'WI' as Loc_B,'A' as Parent_Num from dual
union all
select 'A-06' as Num,'Fra' as Loc_A,'Ag' as Loc_B,'A' as Parent_Num from dual
union all
select 'A-07' as Num,'Rus' as Loc_A,'Ban' as Loc_B,'A' as Parent_Num from dual
union all
select 'A-08' as Num,'SA' as Loc_A,'Ind' as Loc_B,'A' as Parent_Num from dual
union all
select 'A-09' as Num,'Ind' as Loc_A,'Ind' as Loc_B,'A' as Parent_Num from dual
select * from t;
Could you please help ,i have 1000's of rows with this kind of dataHi,
I have tried to create a query, this might help you
WITH t AS (SELECT 'A-01' AS Num,
'Ind' AS Loc_A,
'Aus' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-02' AS Num,
'Fra' AS Loc_A,
'NZ' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-03' AS Num,
'Ind' AS Loc_A,
'SL' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-04' AS Num,
'USA' AS Loc_A,
'Aus' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-05' AS Num,
'Pak' AS Loc_A,
'WI' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-06' AS Num,
'Ind' AS Loc_A,
'Ag' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-07' AS Num,
'Rus' AS Loc_A,
'Ban' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-08' AS Num,
'SA' AS Loc_A,
'Ind' AS Loc_B,
'A' AS Parent_Num
FROM DUAL
UNION ALL
SELECT 'A-09' AS Num,
'Ind' AS Loc_A,
'Ind' AS Loc_B,
'A' AS Parent_Num
FROM DUAL)
SELECT t.num,
t.loc_a,
t.loc_b,
CASE
WHEN (FIRST_VALUE (LOC_A)
OVER (ORDER BY NUM RANGE UNBOUNDED PRECEDING)) IN
(LOC_A, LOC_B)
OR (FIRST_VALUE (LOC_B)
OVER (ORDER BY NUM RANGE UNBOUNDED PRECEDING)) IN
(LOC_A, LOC_B)
THEN
ELSE
t.parent_num
END
parent_num
FROM t
NUM
LOC_A
LOC_B
PARENT_NUM
A-01
Ind
Aus
A-02
Fra
NZ
A
A-03
Ind
SL
A-04
USA
Aus
A-05
Pak
WI
A
A-06
Ind
Ag
A-07
Rus
Ban
A
A-08
SA
Ind
A-09
Ind
Ind
Only error I have here is the First Value is showing '-'. I have not got enough time to remove it.
Regards,
Adarsh -
Link user query to required print layout
Hi all,
I tried linking my user query to a required print layout for user reports.
I have followed the same procedure as given in (Query PLD.pdf ) but when I try to save ,
I get the following error
Items were found with the same exclusive no [Message 101-19 ]
Can anybody help me with this
Thanks
Nirmala B.finally got it
-
SQL Query Assistance Required for Full Outer Join
Hi,
Lets say I have two tables, i.e:
TAB_A (colA1, colA2, colA3, colA4)
TAB_B (colB1, colB2, colB3, colB4) where colB2 is a FK to colA1
I am after an SQL query that will cater for both the following two scenarios.
Scenario 1:
TAB_A has two rows of data, i.e
(1, ABC100, 1, WG_A)
(2, ABC100, 2, WG_B)
TAB_B has one row of data, i.e
(1, 1, EMP_222, 4)
I use the following SQL:
select a.*, b.*
from tab_a a FULL OUTER JOIN tab_b b ON (a.colA1 = b.colB2)
where a.colA2 = 'ABC100'
This returns two rows:
1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
2, ABC100, 2, WG_B
Now, what I actually would like my query to do is actually only return the row where a tab_b record exists, i.e, should only return one record:
1, ABC100, 1, WG_A, 1, 1, EMP_222, 4
This I can achieve by using a RIGHT OUTER JOIN instead above, but this causes issue with my scenario 2, which is the following set-up
Scenario 2:
TAB_A has only one row of data this time, i.e
(2, ABC100, 2, WG_B)
TAB_B has no data at all this time
This returns no rows but I actually now want this single record from tab_a returned.
I basically require an SQL query that will cater for both the top 2 scenarios, i.e, if a tab_b record exists from the outer join then only return this record along with tab_a data. If a tab_b record doesn't exist, then only return the tab_a record.
Hope the above makes sense.
Thanks.Is it what you need (not very elegant) ?
SQL> select * from t_outer;
ID CODE
1 100
2 100
SQL> select * from t_inner;
no rows selected
SQL> with tab1 as (
2 select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
3 (a.id = b.id and a.code = '100'))
4 select * from tab1
5 union all
6 select a.*, null from t_outer a where not exists (
7 select 1 from tab1)
8 and a.code = '100'
9 /
A_ID CODE B_ID
1 100
2 100
SQL> insert into t_inner values(2);
1 row created.
SQL> with tab1 as (
2 select a.id a_id, a.code, b.id b_id from t_outer a join t_inner b on
3 (a.id = b.id and a.code = '100'))
4 select * from tab1
5 union all
6 select a.*, null from t_outer a where not exists (
7 select 1 from tab1)
8 and a.code = '100'
9 /
A_ID CODE B_ID
2 100 2
Rgds. -
Hi All,
I have a requirement, whereby when I run t.code ST03N, I get technical name of a query I would like to have the description of the query is the a way to do so ? Say via SE16 ... and get them ...
Please assist
Nathanone way is to go to SE16 table RSZELTDIR
Choose REP for field DEFTP, query tech name for field MAPNAME.
The field TXTLG gives you the description of the query name -
Query Help required to Connect JDT1 with OINV tables
Dear Experts,
I have the following query which gives me the customer ageing report. I want some addtional fields from the OINV table and the document numbering table like Document Series Name, AR Invoice document Number,AR invoice remarks, BP Projects Number ( filled in accounting tab in BP projects) and in the query in Reference 1 column its giving the Invoice Numbers as posted in the Journal but for manual Journal Entries it not giving the Journal Number which I also want to be shown in Ref 1 or a seperat field.
The Query is as under :
select OCRD.cardcode 'Supplier Code',OCRD.cardname 'Name',sysdeb 'Debit Amount',syscred 'Credit Amount',
case JDT1.transtype
when '13' then 'INV'
when '14' then 'AR CN'
when '24' then 'INCOMING'
else 'Other'
end 'Type',
Ref1,
fccurrency 'BP Currency',
CONVERT(VARCHAR(10), refdate, 103)'Posting Date' ,
CONVERT(VARCHAR(10), duedate, 103) 'Due Date',
CONVERT(VARCHAR(10), taxdate, 103) 'Doc Date' ,
CASE
when (DATEDIFF(dd,refdate,current_timestamp))+1 < 31
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "0-30 days",
case when ((datediff(dd,refdate,current_timestamp))+1 > 30
and (datediff(dd,refdate,current_timestamp))+1< 61)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "31 to 60 days",
case when ((datediff(dd,refdate,current_timestamp))+1 > 60
and (datediff(dd,refdate,current_timestamp))+1< 91)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "61 to 90 days",
CASE
when (DATEDIFF(dd,refdate,current_timestamp))+1 > 90
then
case
when syscred= 0 then sysdeb
when sysdeb= 0 then syscred * - 1
end
end "90 + days"
from JDT1,OCRD where JDT1.shortname = OCRD.cardcode and cardtype = 'c' and intrnmatch = '0'
ORDER BY OCRD.CARDCODE, taxdate
Would appreciate if you can help me to get a solution in it.
Regards,
KamleshDear Gordon,
While executing the followings modified query it giving an error of
Incorrect Syntax near the keyword 'to' and incorrect Syntax near 'Series'
the query is as under :
{select OCRD.cardcode 'Supplier Code',OCRD.cardname 'Name',sysdeb 'Debit Amount',syscred 'Credit Amount',
case l.transtype
when '13' then 'INV'
when '14' then 'AR CN'
when '24' then 'INCOMING'
else 'Other'
end 'Type',
j.BaseRef'Trans #',
case l.transtype
when '13' then
(Select Comments from OINV where OINV.Transid=j.Transid)
else '-'
end 'Inv.Rem.',
(Select SeriesName From NNM1 Where Series=j.DocSeries and ObjectCode=l.TransType)'Series',
to
(Select Isnull(SeriesName, 'Manual') From NNM1 Where Series=j.DocSeries and ObjectCode=l.TransType)'Series',
l.Ref1,
fccurrency 'BP Currency',
CONVERT(VARCHAR(10), l.refdate, 103)'Posting Date' ,
CONVERT(VARCHAR(10), l.duedate, 103) 'Due Date',
CONVERT(VARCHAR(10), l.taxdate, 103) 'Doc Date' ,
CASE
when (DATEDIFF(dd,l.refdate,current_timestamp))+1 < 31
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "0-30 days",
case when ((datediff(dd,l.refdate,current_timestamp))+1 > 30
and (datediff(dd,l.refdate,current_timestamp))+1< 61)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "31 to 60 days",
case when ((datediff(dd,l.refdate,current_timestamp))+1 > 60
and (datediff(dd,l.refdate,current_timestamp))+1< 91)
then
case
when syscred <> 0 then syscred * - 1
else sysdeb
end
end "61 to 90 days",
CASE
when (DATEDIFF(dd,l.refdate,current_timestamp))+1 > 90
then
case
when syscred= 0 then sysdeb
when sysdeb= 0 then syscred * - 1
end
end "90 + days"
from JDT1 l
Inner Join OJDT j On j.TransId=l.TransId
,OCRD where l.shortname = OCRD.cardcode and cardtype = 'c' and intrnmatch = '0'
ORDER BY OCRD.CARDCODE, l.taxdate}
Regards,
Kamlesh -
Query help required to link two fields
Hi all,
I have made an query as under :
SELECT T2.Period, T0.dept, T0.empID, T0.firstName, T0.lastName, T1.U_ebasic, T1.U_ehra, T1.U_etrspt, T1.U_ecola, T1.U_emeins, T1.U_education, T1.U_grosssal,T1.U_totduc, T1.U_oadd, T1.U_netsal, T1.U_bank, T1.U_branch, T1.U_accno FROM OHEM T0 , [dbo].[@PAYROLL_PR_DETAIL] T1, [dbo].[@PAYROLL_PROLL_HEAD] T2 where t2.docentry=t1.docentry and t1.U_ecode=t0.empid
Now I want that the Department Full NAME as mentioned in the Human Resource screen for that employee should come. Apart from it I also want to link a new field in this query user_code from OUSR table for each employee.
Can you please help me to make this query.
Regards,
kamleshDear Gordon,
After rectifiying the spelling mistake I used the following query as under
SELECT T2.Period, T0.dept, T3.Name, T0.empID, T0.firstName, T0.lastName, T4.USER_CODE,T1.U_ebasic, T1.U_ehra, T1.U_etrspt, T1.U_ecola, T1.U_emeins, T1.U_education, T1.U_grosssal,T1.U_totduc, T1.U_oadd, T1.U_netsal, T1.U_bank, T1.U_branch, T1.U_accno
FROM dbo.OHEM T0
INNER JOIN dbo.OUDP T3 ON T3.Code = T0.dept
INNER JOIN dbo.OUSR T4 ON T4.INTERNAL_K = T0.userId
INNER JOIN dbo.@PAYROLL_PR_DETAIL T1 ON t1.U_ecode=t0.empid
INNER JOIN dbo.@PAYROLL_PROLL_HEAD T2 ON t2.docentry=t1.docentry
but now the syntax error is coming as - 'Incorrect syntax near '@PAYROLL_PR_DETAIL'
(SEWSY) (s) could not be prepared
Please guide.
Regards,
Kamlesh -
Query form requires Logical operators and/or Quotes
In ORACLE 9I Jdeveloper beta I used the BC4J JSP wizard to create a - Query Form. The query form looks nice and runs except I have to also include the logical operators (= > <) and Quotes. For example to query on the name Joe I have to enter it as ="JOE". If I use JOE it gives me a JSP error. The error message shows the generated Select statment with the where clause JOE but is missing the "=" and quotes.
How do I hard code the "=" and quotes around strings so that the user doesn't have to?In ORACLE 9I Jdeveloper beta I used the BC4J JSP wizard to create a - Query Form. The query form looks nice and runs except I have to also include the logical operators (= > <) and Quotes. For example to query on the name Joe I have to enter it as ="JOE". If I use JOE it gives me a JSP error. The error message shows the generated Select statment with the where clause JOE but is missing the "=" and quotes.
How do I hard code the "=" and quotes around strings so that the user doesn't have to? -
Sql query result required ....
SELECT A.BRAND BRAND,ROUND ((Leaf*100)/C.INVPERT,3) Leaf,'%',ROUND((Dust*100)/C.INVPERT,3) Dust,'%',
ROUND((Fann)*100/C.INVPERT,3) Fann,'%',ROUND((TOT)*100/C.INVPERT,3) TOTAL,'%',
ROUND((CTOT)*100/D.CUMUPER,3) PRVCUMU,'%'
FROM
SELECT BRAND,SUM (LEAF) Leaf,SUM (DUST) Dust,SUM(FANN) Fann,SUM(LEAF+DUST+FANN) TOT,
SUM(LC) LC,SUM(DC) DC,SUM(FC) FC,SUM(LC+DC+FC) CTOT
FROM
SELECT DECODE(A.BRANDCD ,'WB','Wagh Bakri','WIS','Wagh Bakri',WTM','Wagh Bakri',
'ML', 'Mili','02', 'Others','DL', 'Others','GM', 'Others',
'GMD','Others','TQ', 'Others','WOD','Waghbakri-Organic[Dling]',
'WOG','Waghbakri-Organic[Dling]','WOC','Waghbakri-Organic[Dling]',
'NC', 'Navchetan','NG', 'Nilgiri 100gms Jar','MSC','Msc Leaf 100/250 Pouch') BRAND ,
SUM(C.INVQTY) LEAF,0 DUST,0 FANN,0 LC,0 DC,0 FC
FROM
WB.WBPRODUCTDETAILS A,DSP.DSPINVA B,DSP.DSPINVB C
WHERE A.COMPCODE = C.COMPCODE AND A.P_UNIQUEID = C.P_UNIQUEID AND
B.COMPCODE = C.COMPCODE AND B.INVYEAR = C.INVYEAR AND
B.FACTORYCODE = C.FACTORYCODE AND B.REFINV = C.REFINV AND B.INVNO =
C.INVNO AND B.INVDATE = C.INVDATE AND B.PARTYCD <> 'A0101G0999' AND
B.INVDATE ='&DT' AND A.VARIETY = 1 GROUP BY A.BRANDCD,A.VARIETY
----------- Second Query--------------------------------------
(SELECT ROUND ((LPRV*100)/E.PRVPER,2) LPRV,'%',ROUND((DPRV*100)/E.PRVPER,2) DPRV,'%',
ROUND((FPRV)*100/E.PRVPER,2) FPRV,'%',ROUND((PRV)*100/E.PRVPER,2) PRVTOT,'%',
ROUND((CPRV)*100/E.PRVPER,2) CUMUTOT,'%'
FROM
SELECT BRAND,SUM (LF) LPRV,SUM (DF) DPRV,SUM(FF) FPRV,SUM(LF+DF+FF) PRV,
SUM(LF+DF+FF) CPRV
FROM
SELECT A.BRANDCD BRAND,SUM(C.INVQTY) LF,0 DF,0 FF FROM
WB.WBPRODUCTDETAILS A,DSP.DSPINVA B,DSP.DSPINVB C
WHERE A.COMPCODE = C.COMPCODE AND A.P_UNIQUEID = C.P_UNIQUEID AND
B.COMPCODE = C.COMPCODE AND B.INVYEAR = C.INVYEAR AND
B.FACTORYCODE = C.FACTORYCODE AND B.REFINV = C.REFINV AND B.INVNO =
C.INVNO AND B.INVDATE = C.INVDATE AND B.PARTYCD <> 'A0101G0999' AND
B.INVDATE = TO_DATE('&DT')-1 AND A.VARIETY = 1 GROUP BY A.BRANDCD,A.VARIETY
Ouput Like this
===============
Brand Wise Sales in % For 31-MAY-07
Variety Leaf Dust Fann Total Prev.Cumu
Mili 6.54 % 0.64 % 0.65 % 7.84 % 14.00 %
Navchetan 1.99 % 0.00 % 0.00 % 1.99 % 1.90 %
Nilgiri 100gms Jar 0.00 % 0.00 % 0.00 % 0.00 % 0.00 %
Others 1.64 % 0.00 % 0.00 % 1.64 % 0.73 %
Wagh Bakri 58.86 % 16.45 % 13.21 % 88.53 % 83.36 %
Waghbakri-Organic[Dling] 0.00 % 0.00 % 0.00 % 0.00 % 0.02 %
==============================================================
Total-->in % 69.04 17.10 13.86 100.00 100.00 1st Query
Prev.Day-->in % 72.04 12.11 21.86 100.00 100.00 2nd Query
I am giving two queries half.
How Can I do this ?
Regards
Vipul Patelput your query like his
<pre>
</pre>
but instead of <> use [ ] -
Dear Experts,
I have a sql query which taking more than 2 hour of time ot execute.
the explain plan is :
PLAN_TABLE_OUTPUT
Plan hash value: 2694368390
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 379 | 44561 (1)| 00:08:55 |
| 1 | INLIST ITERATOR | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID | OPS_CITY_MAST | 2 | 30 | 5 (0)| 00:00:01 |
|* 3 | INDEX UNIQUE SCAN | OPS_CITY_MAST_IDX_01 | 2 | | 3 (0)| 00:00:01 |
| 4 | TABLE ACCESS BY INDEX ROWID | OPS_BR_MAST | 1 | 16 | 2 (0)| 00:00:01 |
|* 5 | INDEX UNIQUE SCAN | OPS_BR_MAST_IDX_01 | 1 | | 1 (0)| 00:00:01 |
| 6 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
|* 7 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
| 8 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
|* 9 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
| 10 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
|* 11 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
| 12 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
|* 13 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
| 14 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
|* 15 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
| 16 | TABLE ACCESS BY INDEX ROWID | OPS_CHG_GROUP_AMT | 1 | 15 | 4 (0)| 00:00:01 |
|* 17 | INDEX UNIQUE SCAN | OPS_CHG_GROUP_AMT_IDX_02 | 1 | | 3 (0)| 00:00:01 |
| 18 | SORT GROUP BY NOSORT | | 1 | 31 | 10 (0)| 00:00:01 |
| 19 | NESTED LOOPS | | | | | |
| 20 | NESTED LOOPS | | 2 | 62 | 10 (0)| 00:00:01 |
| 21 | TABLE ACCESS BY INDEX ROWID | OPS_UULT_WB_DTLS | 2 | 24 | 6 (0)| 00:00:01 |
|* 22 | INDEX RANGE SCAN | OPS_UULT_WB_DTLS_IDX_03 | 2 | | 3 (0)| 00:00:01 |
|* 23 | INDEX UNIQUE SCAN | OPS_UPD_ULT_IDX_01 | 1 | | 1 (0)| 00:00:01 |
|* 24 | TABLE ACCESS BY INDEX ROWID | OPS_UPD_ULT | 1 | 19 | 2 (0)| 00:00:01 |
| 25 | NESTED LOOPS | | | | | |
| 26 | NESTED LOOPS | | 1 | 379 | 44561 (1)| 00:08:55 |
| 27 | NESTED LOOPS | | 1 | 360 | 44559 (1)| 00:08:55 |
| 28 | NESTED LOOPS | | 1 | 333 | 44558 (1)| 00:08:55 |
| 29 | NESTED LOOPS | | 1 | 312 | 44557 (1)| 00:08:55 |
| 30 | NESTED LOOPS | | 1 | 302 | 44555 (1)| 00:08:55 |
| 31 | NESTED LOOPS | | 1 | 281 | 44553 (1)| 00:08:55 |
|* 32 | HASH JOIN | | 4383 | 1112K| 35779 (2)| 00:07:10 |
|* 33 | HASH JOIN RIGHT OUTER | | 4383 | 1070K| 34631 (2)| 00:06:56 |
| 34 | TABLE ACCESS FULL | OPS_CUST_CNTR | 7270 | 94510 | 68 (0)| 00:00:01 |
|* 35 | HASH JOIN | | 4383 | 1014K| 34562 (2)| 00:06:55 |
| 36 | NESTED LOOPS OUTER | | 4414 | 875K| 33135 (2)| 00:06:38 |
|* 37 | HASH JOIN | | 4414 | 827K| 32963 (2)| 00:06:36 |
| 38 | TABLE ACCESS FULL | OPS_ST_UN_MAST | 36 | 504 | 3 (0)| 00:00:01 |
|* 39 | HASH JOIN | | 4414 | 767K| 32959 (2)| 00:06:36 |
|* 40 | HASH JOIN | | 4414 | 543K| 28417 (2)| 00:05:41 |
| 41 | NESTED LOOPS | | | | | |
| 42 | NESTED LOOPS | | 4414 | 495K| 26483 (2)| 00:05:18 |
|* 43 | HASH JOIN | | 4949 | 483K| 16641 (2)| 00:03:20 |
|* 44 | TABLE ACCESS BY INDEX ROWID| OPS_WAYBL | 4423 | 367K| 2292 (1)| 00:00:28 |
|* 45 | INDEX RANGE SCAN | OPS_WAYBL_IDX_11 | 5050 | | 16 (0)| 00:00:01 |
| 46 | TABLE ACCESS FULL | OPS_PULTD_WB_DTLS | 4474K| 64M| 14298 (2)| 00:02:52 |
|* 47 | INDEX UNIQUE SCAN | OPS_TS_RECONSILE_IDX_02 | 1 | | 1 (0)| 00:00:01 |
|* 48 | TABLE ACCESS BY INDEX ROWID | OPS_TS_RECONSILE | 1 | 15 | 2 (0)| 00:00:01 |
| 49 | TABLE ACCESS FULL | OPS_CC_CORCEE_ADDR | 998K| 10M| 1922 (2)| 00:00:24 |
| 50 | TABLE ACCESS FULL | OPS_ADDR_MAST | 1006K| 49M| 4531 (1)| 00:00:55 |
| 51 | TABLE ACCESS BY INDEX ROWID | OPS_WB_DOD_DTLS | 1 | 11 | 1 (0)| 00:00:01 |
|* 52 | INDEX UNIQUE SCAN | OPS_WB_DOD_DTLS_IDX_02 | 1 | | 0 (0)| 00:00:01 |
| 53 | TABLE ACCESS FULL | OPS_TRIP_SHT | 423K| 13M| 1422 (2)| 00:00:18 |
| 54 | TABLE ACCESS FULL | OPS_PROV_LT_DLVRY | 446K| 4361K| 1142 (2)| 00:00:14 |
| 55 | TABLE ACCESS BY INDEX ROWID | OPS_PLTD_WB_DTLS | 1 | 21 | 2 (0)| 00:00:01 |
|* 56 | INDEX UNIQUE SCAN | OPS_PLTD_WB_DTLS_IDX_04 | 1 | | 1 (0)| 00:00:01 |
| 57 | TABLE ACCESS BY INDEX ROWID | OPS_ULTD_WB_DTLS | 1 | 21 | 2 (0)| 00:00:01 |
|* 58 | INDEX UNIQUE SCAN | OPS_ULTD_WB_DTLS_IDX_02 | 1 | | 1 (0)| 00:00:01 |
|* 59 | TABLE ACCESS BY INDEX ROWID | OPS_UPD_LT_DLVRY | 1 | 10 | 2 (0)| 00:00:01 |
|* 60 | INDEX UNIQUE SCAN | OPS_UPD_LT_DLVRY_IDX_01 | 1 | | 1 (0)| 00:00:01 |
| 61 | TABLE ACCESS BY INDEX ROWID | OPS_TRPT_VHLS | 1 | 21 | 1 (0)| 00:00:01 |
|* 62 | INDEX UNIQUE SCAN | OPS_TRPT_VHLS_IDX_01 | 1 | | 0 (0)| 00:00:01 |
| 63 | TABLE ACCESS BY INDEX ROWID | PO_VENDORS | 1 | 27 | 1 (0)| 00:00:01 |
|* 64 | INDEX UNIQUE SCAN | VENDOR_UNIQUE | 1 | | 0 (0)| 00:00:01 |
|* 65 | INDEX UNIQUE SCAN | OPS_GATE_PASS_IDX_01 | 1 | | 1 (0)| 00:00:01 |
|* 66 | TABLE ACCESS BY INDEX ROWID | OPS_GATE_PASS | 1 | 19 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("OCM"."ID"=:B1 OR "OCM"."ID"=:B2)
5 - access("OBM"."ID"=:B1)
7 - access("CGA"."DOC_TYPE"='WB' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=6)
9 - access("CGA"."DOC_TYPE"='WB' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=7)
11 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=15)
13 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=16)
15 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=17)
17 - access("CGA"."DOC_TYPE"='GP' AND "CGA"."DOC_ID"=:B1 AND "CGA"."CHG_GROUP_ID"=23)
22 - access("DT"."WAYBL_ID"=:B1)
23 - access("ULT"."ID"="DT"."UPD_ULT_ID")
24 - filter("ULT"."FROM_BR_MAST_ID"=:B1)
32 - access("OPL"."ID"="TS"."PROV_LT_DLVRY_ID")
33 - access("CNTR"."ID"(+)="SYS_ALIAS_10"."CUST_CNTR_ID")
35 - access("TSREC"."TRIP_SHT_ID"="TS"."ID")
37 - access("ST"."ID"="AD"."ST_UN_MAST_ID")
39 - access("AD"."ID"="CCADD"."ADDR_MAST_ID")
40 - access("CCADD"."ID"="SYS_ALIAS_10"."CC_CEE_ADDR_ID")
43 - access("SYS_ALIAS_10"."ID"="DTL"."WAYBL_ID")
44 - filter("SYS_ALIAS_10"."GL_TRFD" IS NULL OR "SYS_ALIAS_10"."GL_TRFD"='Y')
45 - access(TRUNC(INTERNAL_FUNCTION("FIRST_DLVRY_DT"))=TO_DATE(' 2011-08-15 00:00:00', 'syyyy-mm-dd
hh24:mi:ss'))
47 - access("DTL"."ID"="TSREC"."PULTD_WB_DTLS_ID")
48 - filter("TSREC"."STATUS_LID"=157)
52 - access("SYS_ALIAS_10"."ID"="OWD"."WAYBL_ID"(+))
56 - access("LTDTL"."PROV_LT_DLVRY_ID"="OPL"."ID" AND "LTDTL"."WAYBL_ID"="DTL"."WAYBL_ID")
58 - access("ULTDTL"."PLTD_WB_DTLS_ID"="LTDTL"."ID")
59 - filter("UPLT"."PROV_LT_DLVRY_ID"="OPL"."ID")
60 - access("ULTDTL"."UPD_LT_DLVRY_ID"="UPLT"."ID")
62 - access("OTV"."ID"="OPL"."TRPT_VHLS_ID")
64 - access("PO"."VENDOR_ID"="OTV"."VENDOR_ID")
65 - access("SYS_ALIAS_9"."ID"="ULTDTL"."GATE_PASS_ID")
66 - filter("SYS_ALIAS_9"."GL_TRFD" IS NULL OR "SYS_ALIAS_9"."GL_TRFD"='Y')
so, please help me.
Regards,
Viveka Nand
Edited by: 891502 on Oct 14, 2011 4:39 AM891502 wrote:
now am putted in the correct format,In the link it tells you to provide the query. Which you have not done.
It tells you how to format the plan. Which you have not done.
It tells you to provide database version and optimizer parameters. Which you have not done.
It tells you to provide autotrace statistics and trace output. Which you have not done.
So in what way is this format correct ?
so, please give me the way to resolved it.With the information you have provided we can say with certainty that if you write your query this way it will be fast.
select null from dual; -
Hello All,
I have the following requirement in the report, I wonder whether this can be done by Formula variable(Customer exit) or do it in any other way.
The customer wants the report as shown below.
Date (PRDT) New Boolean Customer exit variable
01-Jun-2011 1
02-Jun-2011 1
03-Jun-2011 1
04-Jun-2011 0
05-Jun-2011 0
06-Jun-2011 1
07-Jun-2011 1
Condition to display 1 or 0
based on the Date column the second column should populate the value 1 or 0.
If it is a working day then it must return True (1) or else 0 based on factory cal
If I create a Formula variable(Customer exit) I can pass only 2 values ie low and high but how to acheive this.
Any Inputs on this is appreciated....
Regards..
BalajiHi,
If you don't want to extract data from source system then go for Virtual Key figure. You will be able to get the dynamically calculated value in BEX output.
Refer the following document,
[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d0293505-d14a-2d10-dabd-c2a6ffe964a7]
[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90b2babc-15ad-2d10-c4b2-bd3af67d86b1]
Regards,
Durgesh.
Edited by: Durgesh Gandewar on Jul 13, 2011 5:52 PM -
Creating Query : Package required
Hi Experts,
We are creating and changing queries in PRD (BW 3.5, SP21) . Up to now, system works as designed, all elements were assigned to package $tmp automatically.
But now users are complaining, that they are prompted to select a package when saving a query.
I'm not aware that our team has changed any settings.
Any ideas / suggestions ? Thanks in advance.
Regards
JoeHi
So is it necessary that it should prompt for the package once upgrade is done from 3.x to 7.0 when we change the query in 7.0 of 3.x copy queries???Could I know why it is prompting???where can I change the settings to prompt for it?
Could I know how to create temporary package, as I dont see any option for $tmp ,whenever i do changes for objects,it opt for new request???
hi JH, Thanks for bringing up this question as I face the same issue.
BI Learner. -
Dear Experts,
We have scenario. Calculation of incentive for sales employee based on
1. Individual target ( Incentive A ) - This i am able to get
2. sales office target ( Incentive B ) -
formula required here is based on total of sales and target for a salesoffice
Sales office Sales employee Sales qty Target Qty Incentive A Incentive B
Dubai Salesman A 8 10 Formula A Formula B
Salesman B 10 10 Formula A Formula B
Salesman C 13 10 Formula A Formula B
Sales officewise total 31 30
How to pickup salesofficewise total in Formula B ?
or get constant value of total against each sales employee in separate column so that i can use in formula.
Thanks & Regards,
Dilip WDear Experts,
I have tried suggested solution not working. I am reframing my question with example.
We have scenario. Calculation of incentive for sales employee based on
Sales office target and Actual Sales ( Incentive B ) -
formula required here is based on total of sales and target for a salesoffice.
or difference of toatal Sales qty and Target qty for a salesoffice as consatat value against each salesman
Sample data for reference : e.g ( 30 - 31 ) = -1 ( Based on this i can build my formula B )
Sales office Sales employee Sales qty Target Qty Incentive B
Dubai Salesman A 8 10 Formula B
Salesman B 10 10 Formula B
Salesman C 13 10 Formula B
Sales officewise total.. 31 30
How to pickup salesofficewise total in Formula B ?
Formula Requirement is to use get /refer constant value of salesoffice wise total against each sales employee.
Thanks & Regards,
Dilip W -
Dates problem query is required
hai
i am using oracle 8.0.6 db.
i have a table in which there are 2 fields say fdate and tdate
and there are 2 records
say
fdate tdate
20/5/2002 25/5/2002
27/5/2002 31/5/2002
now the problem is if i give from fdate and tdate as 23/5/2002 and 23/5/2002
the query should say me the record is already there
ie given any two dates it should check the database whether any of the given dates
is existing or not...
how to write a query for that.
please help me out..
Ramesh.sselect * from tablename where (fdate>=date1 or tdate<=date2)
Hi,
U can use OR . select * from tablename where (fdate=date1 or ldate=date2)
Bye -
Mysql equivalent oracle sql query is required
Hi all,
please help me convert mysql quyery into sql query.
select u.username, t.name as fullname, p.id as project_id, p.name as project,
(select count(a.resource_id) from pd_resource_task_alloc as a left OUTER JOIN pd_resource_task as b on a.task_id=b.task_id where a.task_id=t.id ) as allocatedTask,
(select count(a.resource_id) from pd_resource_task_alloc as a left OUTER JOIN pd_resource_task as b on a.task_id=b.task_id where a.task_id=t.id and b.task_status_id='2') as completedTask,
(select count(a.resource_id) from pd_resource_task_alloc as a left OUTER JOIN pd_resource_task as b on a.task_id=b.task_id where a.task_id=t.id and b.task_status_id!='2') as pendingTask,
c.name as category, sub.task_id, t.name, sub.bucket_date, sum(sub.alloc_time) as s
from (select rt.task_id, rt.resource_id, rt.project_id, rta.sequence, rta.alloc_time,DATE(th.creation_date) as creation_date,rt.start_date,th.task_status_id,rt.start_date as bucket_date from resource_task rt, resource_task_alloc rta ,task_history th
where rt.task_id = rta.task_id and rt.task_id = th.task_id and th.task_status_id >=2
and rt.resource_id = rta.resource_id and rt.project_id = rta.project_id
and rta.alloc_time > 0 and rt.start_date is not null ) as sub,
pd_tool_user u, pd_task t, pd_project p, pd_category c where sub.resource_id = u.id
and sub.start_date >='2011-11-01' and sub.creation_date <= '2011-11-31'
and sub.task_id = t.id and sub.project_id = p.id and
t.category_id = c.id
and sub.project_id='355'
group by p.project, u.username, p.id , u.name, sub.task_id, t.name, c.name,
sub.bucket_date order by u.username, sub.bucket_date, p.name, c.nameThanks,
P PrakashNot sure as we don't have any tables and data to work with, but firstly...
a) format your code to make it easier to see what's going on
b) don't mix ansi joins with regular joins
c) treat DATEs as DATEs
d) Table alias names don't use the "AS" keyword
First guess (obviously unteseted)...
select u.username
,t.name as fullname
,p.id as project_id
,p.name as project
,(select count(a.resource_id)
from pd_resource_task_alloc a
left OUTER JOIN pd_resource_task b on (a.task_id=b.task_id)
where a.task_id=t.id
) as allocatedTask
,(select count(a.resource_id)
from pd_resource_task_alloc a
left OUTER JOIN pd_resource_task b on (a.task_id=b.task_id)
where a.task_id=t.id
and b.task_status_id='2'
) as completedTask
,(select count(a.resource_id)
from pd_resource_task_alloc a
left OUTER JOIN pd_resource_task b on (a.task_id=b.task_id)
where a.task_id=t.id
and b.task_status_id!='2'
) as pendingTask
,c.name as category
,sub.task_id
,t.name
,sub.bucket_date
,sum(sub.alloc_time) as s
from (select rt.task_id
,rt.resource_id
,rt.project_id
,rta.sequence
,rta.alloc_time
,th.creation_date -- assuming creation_date is a DATE datatype?
,rt.start_date
,th.task_status_id
,rt.start_date as bucket_date
from resource_task rt
join resource_task_alloc rta on (rt.task_id = rta.task_id
and rt.resource_id = rta.resource_id
and rt.project_id = rta.project_id)
join task_history th on (rt.task_id = th.task_id)
where th.task_status_id >=2
and rta.alloc_time > 0
and rt.start_date is not null
) sub
join pd_tool_user u on (sub.resource_id = u.id)
join pd_task t on (sub.task_id = t.id)
join pd_project p on (sub.project_id = p.id)
join pd_category c on (t.category_id = c.id)
where sub.start_date >= to_date('2011-11-01','YYYY-MM-DD') -- assuming start_date is a DATE datatype
and sub.creation_date <= to_date('2011-11-31','YYYY-MM-DD') -- assuming creation_date is a DATE datatype
and sub.project_id='355'
group by p.project
,u.username
,p.id
,u.name
,sub.task_id
,t.name
,c.name
,sub.bucket_date
order by u.username
,sub.bucket_date
,p.name
,c.name
Maybe you are looking for
-
>> During install the first time I think we got the SQL 2012 installed under the existing Backup Exec installWhat does that mean? You upgraded the existing instance to SQL 2012? What is the existing instance? Is it SQL Express, The Windows Internal D
-
Deactivate lightroom??
I want to install my lightroom on my new MAC. Must I deactivate Lightroom on my old computer before installing it on the new one? Please help I can't find it in Lightroom and I know from eg Photoshop that it had to be deactivated before a new install
-
Move Entourage messages to Mail in diferrent user account
I have two user accounts on my MacBook and need to move Entourage messages from one account to Apple Mail in the 2nd account. What is the easiest way to do this?
-
I installed CC & Premiere Pro this afternoon, but when I try to open Premiere, Windows gives me an error message that says "A problem caused this program to stop working correctly. Windows is looking for a solution." Then after a few minutes it t
-
where can a i find a free open source secure ftp package