Need help tuning package.
Hi,
I am trying to speed up a package I created which currently runs for more than an hour. What I have is a source table which has approximately 16M records. In the report I'm creating, I need to re-use this table 48 times to get the sum of a column for the next 48 weeks.
Initially I created 48 inline views of this table, one for each week but this was very slow. Took more than 3 hours. Then I decided to create a global temporary table with only the columns I need. I populate this table with only needed records so basically around 600K rows. I also added a column "WEEK" and created a function in my package to determine what week the record belongs to depending on its date. So my code looks something like below.
insert into my_table_gtt ( inventory_item_id
, organization_id
, compile_designator
, using_assembly_demand_date
, using_requirements_quantity
, week )
select inventory_item_id
, organization_id
, compile_designator
, decode(sign(using_assembly_demand_date-trunc(sysdate)), -1, trunc(sysdate), using_assembly_demand_date)
, using_requirements_quantity
, my_pkg.week(decode(sign(using_assembly_demand_date-trunc(sysdate)), -1, trunc(sysdate), using_assembly_demand_date))
from my_table_source mgr
where mgr.compile_designator = 'XXXXXX'
and mgr.organization_id = p_org_idPutting the code above, it takes about an hour and 15 minutes to finish the insert. Then around 15 more minutes to build the report.
Is there any way I can make this run faster?
Adding function week.
function week(p_date date) return number
is
l_week number;
begin
select case
when p_date between my_pkg.next('MON',1) and my_pkg.next('SUN',1) then 1
when p_date between my_pkg.next('MON',2) and my_pkg.next('SUN',2) then 2
when p_date between my_pkg.next('MON',3) and my_pkg.next('SUN',3) then 3
when p_date between my_pkg.next('MON',4) and my_pkg.next('SUN',4) then 4
when p_date between my_pkg.next('MON',5) and my_pkg.next('SUN',5) then 5
when p_date between my_pkg.next('MON',6) and my_pkg.next('SUN',6) then 6
when p_date between my_pkg.next('MON',7) and my_pkg.next('SUN',7) then 7
when p_date between my_pkg.next('MON',8) and my_pkg.next('SUN',8) then 8
when p_date between my_pkg.next('MON',9) and my_pkg.next('SUN',9) then 9
when p_date between my_pkg.next('MON',10) and my_pkg.next('SUN',10) then 10
when p_date between my_pkg.next('MON',11) and my_pkg.next('SUN',11) then 11
when p_date between my_pkg.next('MON',12) and my_pkg.next('SUN',12) then 12
when p_date between my_pkg.next('MON',13) and my_pkg.next('SUN',13) then 13
when p_date between my_pkg.next('MON',14) and my_pkg.next('SUN',14) then 14
when p_date between my_pkg.next('MON',15) and my_pkg.next('SUN',15) then 15
when p_date between my_pkg.next('MON',16) and my_pkg.next('SUN',16) then 16
when p_date between my_pkg.next('MON',17) and my_pkg.next('SUN',17) then 17
when p_date between my_pkg.next('MON',18) and my_pkg.next('SUN',18) then 18
when p_date between my_pkg.next('MON',19) and my_pkg.next('SUN',19) then 19
when p_date between my_pkg.next('MON',20) and my_pkg.next('SUN',20) then 20
when p_date between my_pkg.next('MON',21) and my_pkg.next('SUN',21) then 21
when p_date between my_pkg.next('MON',22) and my_pkg.next('SUN',22) then 22
when p_date between my_pkg.next('MON',23) and my_pkg.next('SUN',23) then 23
when p_date between my_pkg.next('MON',24) and my_pkg.next('SUN',24) then 24
when p_date between my_pkg.next('MON',25) and my_pkg.next('SUN',25) then 25
when p_date between my_pkg.next('MON',26) and my_pkg.next('SUN',26) then 26
when p_date between my_pkg.next('MON',27) and my_pkg.next('SUN',27) then 27
when p_date between my_pkg.next('MON',28) and my_pkg.next('SUN',28) then 28
when p_date between my_pkg.next('MON',29) and my_pkg.next('SUN',29) then 29
when p_date between my_pkg.next('MON',30) and my_pkg.next('SUN',30) then 30
when p_date between my_pkg.next('MON',31) and my_pkg.next('SUN',31) then 31
when p_date between my_pkg.next('MON',32) and my_pkg.next('SUN',32) then 32
when p_date between my_pkg.next('MON',33) and my_pkg.next('SUN',33) then 33
when p_date between my_pkg.next('MON',34) and my_pkg.next('SUN',34) then 34
when p_date between my_pkg.next('MON',35) and my_pkg.next('SUN',35) then 35
when p_date between my_pkg.next('MON',36) and my_pkg.next('SUN',36) then 36
when p_date between my_pkg.next('MON',37) and my_pkg.next('SUN',37) then 37
when p_date between my_pkg.next('MON',38) and my_pkg.next('SUN',38) then 38
when p_date between my_pkg.next('MON',39) and my_pkg.next('SUN',39) then 39
when p_date between my_pkg.next('MON',40) and my_pkg.next('SUN',40) then 40
when p_date between my_pkg.next('MON',41) and my_pkg.next('SUN',41) then 41
when p_date between my_pkg.next('MON',42) and my_pkg.next('SUN',42) then 42
when p_date between my_pkg.next('MON',43) and my_pkg.next('SUN',43) then 43
when p_date between my_pkg.next('MON',44) and my_pkg.next('SUN',44) then 44
when p_date between my_pkg.next('MON',45) and my_pkg.next('SUN',45) then 45
when p_date between my_pkg.next('MON',46) and my_pkg.next('SUN',46) then 46
when p_date between my_pkg.next('MON',47) and my_pkg.next('SUN',47) then 47
when p_date between my_pkg.next('MON',48) and my_pkg.next('SUN',48) then 48
end week
into l_week
from dual;
return l_week;
exception
when no_data_found then
return null;
end week;Adding function next.
function next(day varchar2, week number) return date
is
l_week number := week;
l_first_monday date;
l_today date := trunc(sysdate);
begin
if to_char(l_today,'DAY') = 'MONDAY' then
l_first_monday := l_today;
else
if l_today > next_day(l_today,'MON') then
l_first_monday := next_day(l_today,'MON');
else
l_first_monday := next_day(l_today-7,'MON');
end if;
end if;
while l_week > 1
loop
return next_day(next(upper(day), l_week - 1),upper(day));
end loop;
if l_today > l_first_monday then
return next_day(l_first_monday-1,upper(day));
else
return next_day(l_first_monday,upper(day));
end if;
end next;Thanks,
Allen
Edited by: Allen Sandiego on Jun 2, 2011 3:01 PM
SQL and PL/SQL are (very) different language and executed by different engines.
You can use PL/SQL user defined functions in SQL.. as you can use SQL inside PL/SQL source code. There is fairly tight integration between the two languages. But this does not mean that the languages are one, or that such code is executed by a single engine.
When you code something as follows in SQL:
select
<some columns goes here>,
MyPLSQLFunction( <some columns as params> )
from some_tableThe SQL engine parses and executes this SELECT. It has a call to a PL/SQL function. That requires the SQL engine, via an "expensive" context switch, call the PL/SQL engine and have the PL/SQL engine execute that function and returning a result.
If that SELECT selects a 1000 rows, it means a 1000 context switches to the PL/SQL engine for executing that function. This does not scale well. The more loop iterations there are, the more context switching and the bigger the overhead and impact on performance.
Thus it is better to say inside the SQL engine and rather consider doing that PL/SQL function code inside the SQL engine (using CASE statements for example).
If this proves to complex or difficult, you can look at implementing deterministic functions as PL/SQL functions. Deterministic means that the function will always return the same output for the same input - so it will always act in a pre-defined and determined way.
In that case (simplistically speaking), the SQL engine only need to make the context switch to the PL/SQL engine to execute the function, when the SQL engine has not call that function before with that specific set of parameter values. If it has, it simply re-uses the results previously returned by that function for that set of input parameter values.
Similar Messages
-
Need help tuning slow running query
Need help tuning below two Oracle queries:
Query #1:
======================
SELECT "WORK_ORDER_FACT_ALL_YESTERDAY"."WORK_ORDER_HISTORY_ID",
"WORK_ORDER_FACT_ALL_YESTERDAY"."ACCOUNT_NUMBER",
"ACCOUNT_DIM"."ACCOUNT_NUMBER", "ACCOUNT_DIM"."ACCOUNT_WS_DISC_DATE"
FROM "CDWD"."WORK_ORDER_FACT_ALL_YESTERDAY" "WORK_ORDER_FACT_ALL_YESTERDAY",
"CDWD"."ACCOUNT_DIM" "ACCOUNT_DIM"
WHERE (SUBSTR ("WORK_ORDER_FACT_ALL_YESTERDAY"."ACCOUNT_FIRST_NAME", 1, 1) =
SUBSTR ("ACCOUNT_DIM"."ACCOUNT_FIRST_NAME", 1, 1)
AND (SUBSTR ("WORK_ORDER_FACT_ALL_YESTERDAY"."ACCOUNT_LAST_NAME", 1, 4) =
SUBSTR ("ACCOUNT_DIM"."ACCOUNT_LAST_NAME", 1, 4)
AND ("WORK_ORDER_FACT_ALL_YESTERDAY"."ACCOUNT_DL_NUMBER" =
"ACCOUNT_DIM"."ACCOUNT_DL_NUMBER"
AND "WORK_ORDER_FACT_ALL_YESTERDAY"."WO_TYPE_CODE" IN ('25', '27')
AND ("ACCOUNT_DIM"."REVENUE_TYPE_ID" = 1)
AND ("WORK_ORDER_FACT_ALL_YESTERDAY"."TRANSFER_COUNT" = 0)
AND ("WORK_ORDER_FACT_ALL_YESTERDAY"."WINBACK_ADD_COUNT" = 0)
AND ("ACCOUNT_DIM"."ACCOUNT_WS_ENTRY_DATE" <
(TO_DATE ('2006.05.02', 'yyyy.mm.dd') - 11
AND ("WORK_ORDER_FACT_ALL_YESTERDAY"."IS_DERIVED" = 0)
AND ("ACCOUNT_DIM"."EXPIRATION_DATE" IS NULL)
AND ("WORK_ORDER_FACT_ALL_YESTERDAY"."ACT_ACCOUNT_TYPE_CD" <> '50');
Query #2
==================
UPDATE work_order_fact_all_yesterday g
SET returns_count = 1
WHERE EXISTS (SELECT 1
FROM (SELECT a.phone_dim_key AS transactional_phone_dim_key,
b.mdn_number AS transactional_mdn_number,
b.account_number AS transactional_account_number
FROM work_order_fact_all_yesterday a INNER JOIN phone_dim b ON a.phone_dim_key = b.phone_dim_key
WHERE a.gross_deactivations_count = 1) e
INNER JOIN (SELECT c.phone_dim_key AS historical_phone_dim_key,
d.mdn_number AS historical_mdn_number,
d.account_number AS historical_account_number
FROM (SELECT phone_dim_key
FROM work_order_activity_fact
WHERE gross_adds_count = 1
AND report_date >= :b1 - 66
AND NVL (is_derived, 0 ) = 0
UNION
SELECT phone_dim_key
FROM work_order_fact_all_yesterday
WHERE gross_adds_count = 1
AND is_derived = 0) c
INNER JOIN phone_dim d ON c.phone_dim_key = d.phone_dim_key ) f
ON e.transactional_mdn_number = f.historical_mdn_number
AND e.transactional_account_number = f.historical_account_number
WHERE e.transactional_phone_dim_key = g.phone_dim_key)
AND g.gross_deactivations_count = 1
AND g.account_revenue_type_id = 1;
I ran the DBMS_SQLTUNE on it for 10g and did not get any advice. How can I tune the above queries? Thanks!Tune the SQL? Looking at the join criteria of SUBSTR("WORK_ORDER_FACT_ALL_YESTERDAY"."ACCOUNT_FIRST_NAME", 1, 1) = SUBSTR ("ACCOUNT_DIM"."ACCOUNT_FIRST_NAME", 1, 1) and other substrings, it seems to me that you have basic flaws in your relation design.
Column must be atomic values. Having to extract a sub-set value from a column to create the intelligence needed to join to another table - that is just plain wrong in relation design. Never mind the performance impact and overheads it causes in the database. -
Begginer needing help with "package" word
Hi,
I'm a Java newbie and I'm trying to get comfortable with programming in Java on my Mac (running Mac OS 10.3).
I found some sample code that I'm testing out at:
http://www.macdevcenter.com/pub/a/mac/2001/08/03/osx_java.html?page=1
but I'm having problems using the reserved word "package".
at the time of each .java file the sample code has:
package NineSquares;When I compile this in the Terminal window using the command
javac NineSquares.java
javac MainFrame.java
javac EachSquare.javaI get the following error message:
NineSquares.java:8: cannot resolve symbol
symbol : class MainFrame
location: class NineSquares.NineSquares
new MainFrame();
^
1 error
David-Salvays-Computer:~/introcs/Project2 davidsalvay$
when I comment out the package line it compiles fine.
I don't understand what package means and how I use it. BTW, all my .java files are in the same folder and I've already set the classpath to the file containing my main method (NineSquares.java).
Any help/suggestions/ideas will be much appreciated!
--David1. package is always declared first in a class definition.
2. If you've got a class foobar, and that class is in package x.y.z, then the .class file needs to be in a file foobar.class under the directory hierarchy x\y\z\foobar.class, and where the directory above x is in the classpath.
3. The official name of that class is x.y.z.foobar. You can import it using import x.y.z.*; or import x.y.z.foobar; Import just lets you use the class without having to always write x.y.z -
Table A
column1 column2
1 A
2 A
3 A
4 B
Table B (aggregate of Table A)
column1 column2
A 3
B 1
Table C is new data for Table A and Table A.column1 = Table B.column1
column1 column2
1 C
2 C
3 C
4 D
I need to make a package that will aggregate the data in Table C, update the existing records in Table B, and insert records into Table B. The result should look like this:
Table A
column1 column2
A 0 (3-3)
B 0 (1-1)
C 3
D 1Hi,
Assuming that the same id (like 'A', 'B', ...) never occurs in both table_b and table_c (which is the case in your test data):
WITH a_summary AS
SELECT column2 AS id
, COUNT (*) AS cnt
FROM table_a
GROUP BY column2
, b_c_summary as
SELECT column1 AS id
, COLUMN2 AS cnt
FROM table_b
UNION ALL
SELECT column2 AS id
, COUNT (*) AS cnt
FROM table_c
GROUP BY column2
SELECT bc.id AS column1
, bc.cnt - NVL (a,cnt, 0) AS column2
FROM b_c_summary bc
LEFT OUTER JOIN a_summary a ON bc.id = a.id
;If there is some overlap between b and c, you'll have to change b_c_summary; it may involve a FULL OUTER JOIN instead of UNION ALL. If so, post a new set of sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
Like Anurag said, you don't need a package or any kind of PL/SQL to get these results, but you can use a query like this in a package if you want to.
Edited by: Frank Kulash on Dec 10, 2009 10:46 AM
If you need to change table_b, you can use a query like this as a sub-query in a MERGE statement, as Beijing said. -
Need Help-Business Package for Cognos BI
Hello Experts,
We have deployed the BP for Cognos BI in EP 6.0 SP12.
Can somebody please help me with the setup.
What needs to be done in EP & Cognos to get the iViews working. We want to be able to setup sso form EP to cognos.
Thanks for your help,
SSHello,
Please refer the SAP Best Practices for BI..It is available in service market place
http://service.sap.com/bestpractices
Jojo -
have a package that was sequenced for w7 64 bit;
now need to publish this package to RDS 2012.
edited the package in sequencer and added RDS2012 R2.
The question:
do I have to unpublish current package that is for W7 only and publish edited one with added RDS 2012 or can I update running with changed. Never did update yet. So please don't be angry :)
"When you hit a wrong note it's the next note that makes it good or bad". Miles DavisIf you just changed the supported OS value (checkbox during sequencing), just saving the package on the sequencer and importing it into the management console should be fine.
The MgtConsole will determine that you are importing an updated version and will ask you if you want to import it 'as an update'. You can confirm that.
On a client machine, the old version of the package will remain (for a while) and the new version will be added. Users that actively work with the old version, stick on that on. Users that launch the application will get the new version.
If your two 'packages' really have technical differnces, the 'save as new package' is appropriate with the considerations mentioned earlier
Falko
Twitter
@kirk_tn | Blog
kirxblog | Web
kirx.org | Fireside
appvbook.com -
Need help on packaging an application
Hi,
Can anyone please guide me in packaging an application? On trying to create the installation scripts, I am not sure how to add the database objects to it.
Thanks in advance.
Regards,
AnnieHi Varad,
That problem is resolved. I could not add all DDL statements in a single installation script. But things worked fine on creatin separate ones.
But I have one more query. In addition to installing the database objects, how can I also copy the data to another instance?
Annie -
Need help tuning join in slow query
Hi all,
I have the following issue to tune the below join condition in my query below:
SELECT PO.COMPANY,
PO.UPDATE_DATE,
PO.EXTENDED_AMT,
PO.LOCATION,
ICLOCATION.R_NAME AS LOCATION_DESC,
PO.VENDOR,
AP.VENDOR_VNAME,
MAJOR.DESCRIPTION AS MAJOR_DESC,
MINOR.DESCRIPTION AS MINOR_DESC,
CASE po.purch_majcl
WHEN ' '
THEN 'NONE'
ELSE po.purch_majcl
END AS PURCH_MAJ,
CASE po.purch_min
WHEN ' '
THEN 'NONE'
ELSE po.purch_min
END AS PURCH_MIN,
CASE po.manuf_code
WHEN ' '
THEN 'NO MFG'
ELSE po.manuf_code
END AS MANUF_CODE,
CASE po.manuf_nbr
WHEN ' '
THEN 'NONE'
ELSE po.manuf_nbr
END AS MANUF_NBR,
CASE po.manuf_division
WHEN ' '
THEN 'NONE'
ELSE po.manuf_division
END AS MANUF_DIV,
CASE po.agreement_ref
WHEN ' '
THEN 'NONE'
ELSE PO.AGREEMENT_REF
END AS AGRMT_REF,
/* ITEMLOC IS REQUIRED TO GET TO ICCACATEGORY */
CASE po.item_type
WHEN 'I'
THEN ICCATEGORY.INV_ACCT_UNIT
ELSE MMDIST.ACCT_UNIT
END AS ACCT_UNIT,
CASE po.item_type
WHEN 'I'
THEN ICCATEGORY.GL_CATEGORY
ELSE to_char(MMDIST.ACCOUNT)
END AS ACCOUNT,
/* ITEMLOC IS REQUIRED TO GET TO ICCACATEGORY */
PO.ITEM_TYPE,
PO.ITEM,
PO.DESCRIPTION AS ITEM_DESC,
PO.ENT_REC_UOM,
PO.ENT_RUOM_MULT,
PO.ENT_REC_QTY,
PO.ORIG_UNIT_CST,
PO.MATCH_UNIT_CST,
PO.PO_NUMBER,
PO.PO_LINE_NBR,
PO.QTY_TO_PROC,
PURCHORDER.PO_DATE,
PURCHORDER.BUYER_CODE,
BUYER.R_NAME AS BUYER_NAME
FROM LAW.PURCHORDER, LAWS81.BUYER,
LAW.ICLOCATION, LAW.APVENMAST,
LAW.PO LEFT JOIN LAW.MMDIST
ON (PO.COMPANY = MMDIST.COMPANY
AND PO.LOCATION = MMDIST.LOCATION
AND PO.PO_NUMBER = MMDIST.DOC_NUMBER
AND PO.PO_RELEASE = MMDIST.DOC_NBR_NUM
AND PO.PO_CODE = MMDIST.PO_CODE
AND PO.PO_LINE_NBR = MMDIST.LINE_NBR
AND MMDIST.SYSTEM_CD = 'PO'
AND MMDIST.DOC_TYPE = 'PT'
AND MMDIST.COMPONENT_SEQ = 0
AND MMDIST.AOC_CODE = ' ')
/* 1st JOIN TO ITEMLOC */
LEFT JOIN LAW.ITEMLOC
ON PO.COMPANY = ITEMLOC.COMPANY
AND PO.LOCATION = ITEMLOC.LOCATION
AND PO.ITEM = ITEMLOC.ITEM,
/* 2nd JOIN from ITEMLOC to ICCATEGORY */
/* It should use the ITEMLOC join from above */
/* creating cartesian product with itemloc */
LAW.ITEMLOC LEFT JOIN LAW.ICCATEGORY
ON ITEMLOC.COMPANY = ICCATEGORY.COMPANY
AND ITEMLOC.LOCATION = ICCATEGORY.LOCATION
AND ITEMLOC.GL_CATEGORY = ICCATEGORY.GL_CATEGORY,
/* need to get to ICCATEGORY table using 2nd JOIN condition above */
LAW.PO LEFT JOIN LAW.MAJOR
ON PO.PURCH_MAJ = MAJOR.MAJOR_CLASS
AND MAJOR.CLASS_TYPE = 'P'
LEFT JOIN LAW.MINOR
ON PO.PURCH_MAJCL = MINOR.MAJOR_CLASS
AND PO.PURCH_MINCL = MINOR.MINOR_CLASS
AND MINOR.CLASS_TYPE = 'P'
WHERE PO.COMPANY = PO.COMPANY
AND PO.PO_NUMBER = PO.PO_NUMBER
AND PO.PO_RELEASE = PO.PO_RELEASE
AND PO.PO_CODE = PO.PO_CODE
AND PO.PO_LINE_NBR = PO.LINE_NBR
AND PO.COMPANY = ICLOCATION.COMPANY
AND PO.LOCATION = ICLOCATION.LOCATION
AND PO.VENDOR = APVENMAST.VENDOR
AND PO.COMPANY = PURCHORDER.COMPANY
AND PO.PO_CODE = PURCHORDER.PO_CODE
AND PO.PO_NUMBER = PURCHORDER.PO_NUMBER
AND PO.PO_RELEASE = PURCHORDER.PO_RELEASE
AND PURCHORDER.BUYER_CODE = BUYER.BUYER_CODE
AND PO.R_STATUS = 1
AND PO.ENT_REC_QTY > 0
This query runs very slow and we cannot change the code to add or modify indexes. We need to join the 2nd table to the third table with optimized performance. How can I tune this slow running query with the best join conditions?
ThanksI want to join the OS_LOCN_CURR_STK table with the
OT_PO_ITEM table , such that all items in
OS_LOCN_CURR_STK are displayed.
If you want all items in OS_LOCN_CURR_STK to be returned, use an OUTER JOIN on the columns joining the 2 tables. -
I need help tuning games on my imac
okay I got a 24" iMac. 3.06C2D with the nvidia 8800GS. 500GB hard drive. came with 2GB of ram but I put in 2 more GBs and now it had 4GB. I wanted to do some gaming so I got a copy of with does vista ultimate 32bit and installed it with boot camp. on the vista experence meater it scores a 5.6 out of 5.9
but all gamesrun like poo through a meat grinder
I have assassians creed and inorder to make it playable I have to turn the settings way Down.
I got dead space and it runs well. it's playable but not nearly as fast as i would like (plus the free rate never clears 30)
last I got tomb raider underworld and that is in no way playable.
the thing that frustrates me is that I have the system requirements to run them all but I can't. does anyone know what I am doing wrong or anything I can do/try to make them decent/playable.
thanks in advance.
gabeokay im pretty sure that all the driers were installed.
i think the problem is the imac's screen is too big for its brain.
sure it has an nvidia 8800 capable of 1920X1200, but i dont think it can do that wile gaming.
on tomb raider i turned the resolution down from 1920X1200 to 13*X*** (cant remember exactly)
it still runs in full screen with no black boarders but its gone from 13FPS to 23FPS. Much more playable. and shut off some of the fancy effects.
does any one agree? or are their more things i can do to make the game run better -
Need help tuning on this select query
select a.exceptionid, c.sequencenumber, c.messagedelay,a.exceptioncode
from exceptiondetailview a, exceptionrecaltkey b, sequencerconfig c
where a.exceptionid = b.exceptionid
and a.transactiontype = c.transactiontype
and a.exceptionid in (
select exceptionid
from exceptionrecaltkey
where altkeyname = 'SequenceKey' and altkeyvalue like ('%[11968176]%'))
minus
select exceptionid
from exceptionrecaltkey
where altkeyname = 'SequenceFlowName'
and altkeyvalue <> 'APV_OUTBOUND')
and b.altkeyname = 'SequenceKey'
and c.sequenceflowname = 'APV_OUTBOUND'
and c.sequencenumber > ( decode(ASN, null, (select min(sequencenumber) from sequencerconfig where sequenceflowname = 'APV_OUTBOUND' and exceptioncode = a.exceptioncode),
(select sequencenumber from sequencerconfig where sequenceflowname = 'APV_OUTBOUND' and transactiontype = ASN and exceptioncode = a.exceptioncode) ) )
and a.status = 'New'Hi,
Please try this ,
select a.exceptionid, c.sequencenumber, c.messagedelay,a.exceptioncode
from exceptiondetailview a, exceptionrecaltkey b, sequencerconfig c
where
exists a.exceptionid in (
select exceptionid
from exceptionrecaltkey
where altkeyname = 'SequenceKey' and altkeyvalue like ('%[11968176]%'))
and a.exceptionid = b.exceptionid
and a.transactiontype = c.transactiontype
minus
select exceptionid
from exceptionrecaltkey
where altkeyname = 'SequenceFlowName'
and altkeyvalue 'APV_OUTBOUND')
and b.altkeyname = 'SequenceKey'
and c.sequenceflowname = 'APV_OUTBOUND'
and c.sequencenumber > ( decode(ASN, null, (select min(sequencenumber) from sequencerconfig where sequenceflowname = 'APV_OUTBOUND' and exceptioncode = a.exceptioncode),
(select sequencenumber from sequencerconfig where sequenceflowname = 'APV_OUTBOUND' and transactiontype = ASN and exceptioncode = a.exceptioncode) ) )
and a.status = 'New'
REgards,
N.Senthil -
5, it says, "There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor." I have Windows XP and I need help.
After reading all these posts, one by one did not resolve my problem until I got the very end. Regardless of what step would resolve your problem, these are the steps I would recomment to everyone for a what seems to be a safe and fool-proof upgrade to iTunes 10.5.
1. Stand alone upgrade to the latest Quicktime version
2. Go to control panel and "change" then select repair to the following applications in the order specified by the post on Oct 27. (Notice I skipped Quicktime because it had been upgrade manually,and Bonjour did not have a "repair" option)
iTunes; Apple Software Update: Mobile Device Support; Apple Applications Support
Some of these applications may not appear if they do not apply to your configuration (no iPhone, or no iPad, or other apple devices).
Once all updated, I did not need to restart nor launch any applications, I simply went straight into the 10.5 upgrade, and where it normally got stuck, this time the installation continued for a while longer until it completed successfully.
Great work everyone who contributed! Thank you very much! -
Hello. I need help. I use Photoshop Elements 10 on my MAC but it no longer reads discs. Can I download it from the internet with my original package serial number? thanks
Yes, from here:
Download Photoshop Elements products | 13, 12, 11, 10 -
Please i need help for Webutil Package
Please I need help Friends .
I have already installed oracle developer 10g . and i don't know how to configure and use WEBUTIL Package .
So , please anyone tell me how to Configure this package to be ready to use > Step By step Please .
Thank YouHello,
The step by step installation guide is available in the /webutil folder of your Developer Suite installation.
Francois -
Need help th tuning query or re write the query--
Hi,
Need help to tune the below query or rewrite th query for reducing the execution time Please find the query and explain plan.
QUERY
explain plan FOR SELECT consumer_key,product_key,days_in_product,20100201 period_key FROM
(SELECT consumer_key,
product_key,
days_in_product,
row_number() over ( Partition BY consumer_key order by Days_in_product DESC) row_num
FROM
(SELECT consumer_key,
product_key,
SUM(no_ofdays) days_in_product
FROM
(SELECT pcv.consumer_key,
pcv.product_key,
pcv.product_consumer_valid_from,
pcv.product_consumer_valid_to,
DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from) period_start,
DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959) period_end,
CASE
WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
AND activation_date > to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
THEN 0
WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
AND activation_date BETWEEN to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') AND to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
THEN
--to_char(activation_date,'MON-YYYY')='PERIOD_ACTIVE' and activation_date >= to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') then
(to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_date(TO_CHAR(activation_date,'YYYYMMDDHH24MISS'),'YYYYMMDDHH24MISS') )
WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) < 20100201000000
THEN (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) > 20100228235959
THEN 0
ELSE
--unusual situation
(to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
END No_ofDays
FROM cimtran.product_consumer_validity pcv,
consumer_dimension cd
WHERE pcv.consumer_key =cd.consumer_key
AND product_consumer_valid_to >= 20100201000000
AND product_consumer_valid_from <= 20100228235959
--and product_consumer_valid_from > '20090801000000'
ORDER BY consumer_key,
product_key,
product_consumer_valid_from
) a
GROUP BY consumer_key,
product_key
ORDER BY consumer_key,
product_key
) WHERE row_num=1 ;EXPLAIN PLAN
"PLAN_TABLE_OUTPUT"
"Plan hash value: 3823907703"
"| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |"
"| 0 | SELECT STATEMENT | | 4665K| 231M| | 133K (1)| 00:31:08 |"
"|* 1 | VIEW | | 4665K| 231M| | 133K (1)| 00:31:08 |"
"|* 2 | WINDOW SORT PUSHED RANK| | 4665K| 173M| 232M| 133K (1)| 00:31:08 |"
"| 3 | VIEW | | 4665K| 173M| | 104K (1)| 00:24:18 |"
"| 4 | SORT GROUP BY | | 4665K| 182M| 729M| 104K (1)| 00:24:18 |"
"|* 5 | HASH JOIN | | 13M| 533M| 65M| 44241 (1)| 00:10:20 |"
"| 6 | TABLE ACCESS FULL | CONSUMER_DIMENSION | 2657K| 35M| | 4337 (1)| 00:01:01 |"
"|* 7 | TABLE ACCESS FULL | PRODUCT_CONSUMER_VALIDITY | 13M| 351M| | 15340 (2)| 00:03:35 |"
"Predicate Information (identified by operation id):"
" 1 - filter(""ROW_NUM""=1)"
" 2 - filter(ROW_NUMBER() OVER ( PARTITION BY ""CONSUMER_KEY"" ORDER BY "
" INTERNAL_FUNCTION(""DAYS_IN_PRODUCT"") DESC )<=1)"
" 5 - access(""PCV"".""CONSUMER_KEY""=""CD"".""CONSUMER_KEY"")"
" 7 - filter(""PRODUCT_CONSUMER_VALID_FROM""<=20100228235959 AND "
" ""PRODUCT_CONSUMER_VALID_TO"">=20100201000000)"I doubt that this query can be tuned without using indexes. There is a lot of unnecessary work specified in your query, like unnecessary intermediate sorting and selecting unused columns. The cost based optimizer recognized it and skips some of that unnecessary work, it seems. For clarity's sake, I would rewrite your query like below. Note that the query is untested:
select consumer_key
, max(product_key) keep (dense_rank last order by days_in_product) product_key
, max(days_in_product) days_in_product
, 20100201 period_key
from ( select pcv.consumer_key
, pcv.product_key
, sum
( case
when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) between 20100201000000 and 20100228235959
then
case
when cd.activation_date > to_date(pcv.product_consumer_valid_to,'yyyymmddhh24miss')
then
0
when cd.activation_date between to_date(pcv.product_consumer_valid_from,'yyyymmddhh24miss') and to_date(product_consumer_valid_to,'yyyymmddhh24miss')
then
to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
- to_date(to_char(activation_date,'yyyymmddhh24miss'),'yyyymmddhh24miss')
end
when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) < 20100201000000
then
to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
- to_date(to_char(pcv.product_consumer_valid_from),'yyyymmddhh24miss'))
when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) > 20100228235959
then
0
end
) days_in_product
from cimtran.product_consumer_validity pcv
, consumer_dimension cd
where pcv.consumer_key = cd.consumer_key
and product_consumer_valid_to >= 20100201000000
and product_consumer_valid_from <= 20100228235959
group by consumer_key
, product_key
group by consumer_keyRegards,
Rob. -
Help needed with regex package
Hi,
I need help about using regex package in the following way.
a String/CharSequence should be there which will be given to the Pattern.compile(REGEX) method.
I need the REGEX sequences according to the strings below
1) From: "*" <*@*> :: Here * is for any number of charecters
2) we will have some file names I want only those files which end with .txt format.
Please help me in writing the regular expressions for the above criteria.String regex = "From: *[^<]+<[^@]+@[^>]+>";would you need to escape out *'s? forgot if you need to escape quantifiers
and for the file you would want something like
"(.*)\.txt"check out
http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html
Maybe you are looking for
-
Unable to open project in Visual Studio 2015 Preview
I have a problem with one of my solutions. It freezes the application on load. Visual Studio 2015 Preview works for all other projects and loads up correctly. But this one solution file doesn't load. Have anyone had this issue and what is the best wa
-
Songs not transferring from iTunes to iPod
I just bought a 60GB iPod and set it up with my iTunes that I was formerly using with an iPod mini. I intalled all of the updates for iPod and iTunes and it says everything is transferred but it does not show up on my actual iPod. it takes a long tim
-
Hi, I wold like to know if there is any way that I can invoke #{bindings.myVO.collectionModel.makeCurrent} from the backing bean. Thanks. Regards, K.Hein
-
Calling mysql-procedure from labview
Hi All I am using Mysql for my labview application. I have to use procedure.I successfully used procedures without parameters by calling the procedure using DB tools execute query. But i have to use paramatrised procedures also .That is i have to pas
-
Hi Everyone I would like to make the setup of java classes which install the program on the computer any tool,or other feature which make setup plz tell me. thanks in advance