![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||||
| |||||
|
|
Your SP looks like test purpose only. So, I couldn't see your real requirements of the SP. |
|
1) What relationship is there between RULE_DATA table and RULE_DATES table? |
|
You got RULE_ID and MINING_PERIOD from RULE_DATA *and V_ACT_DATE from RULE_DATES. |
|
2) What is the role of mining_period(smallint) in the SP? |
|
3) COMMIT in WHILE loop would never be executed. Because, you fetched 100 rows in RID_CURSOR |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
If the Prepare is EXECUTE P_STM_INS USING V_RULE_ID it works fine, however when EXECUTE P_STM_INS USING V_RULE_ID, V_ACT_DATE it does not, it doesn't fail but take 5 mins PER RECORD. |
#6
| ||||
| ||||
|
|
Did you confirmed that by tests with completely same SPs except the EXECUTE statements? |
|
A reason that I want to see so strict evidence was... You faced the fact which was something out of your thought, *so real cause of problem may(or may not) be different from your assumption. |
|
2) then compare execution time of (SP1) * * * * * * * * IF V_MP = 52 THEN EXECUTE P_STM_INS52 USING V_RULE_ID ; * * * * * * * * ELSE EXECUTE P_STM_INS USING V_RULE_ID ; * * * * * * * * END IF; |
|
(SP2) * * * * * * * * IF V_MP = 52 THEN EXECUTE P_STM_INS52_2p USING V_RULE_ID, V_ACT_DATE ; * * * * * * * * ELSE EXECUTE P_STM_INS_2p USING V_RULE_ID, V_ACT_DATE ; * * * * * * * * END IF; |
#7
| |||
| |||
|
|
2) then compare execution time of (SP1) * * * * * * * * IF V_MP = 52 THEN EXECUTE P_STM_INS52USING V_RULE_ID ; * * * * * * * * ELSE EXECUTE P_STM_INS USING V_RULE_ID ; * * * * * * * * END IF; This will not work as you get a SQL0313N number of variables not = to those required. There are 2 parameter markers in the sql statement. ??? |
|
So adding the V_ACT_DATE to the execute is causing lord knows what to happen, I have absolutely no idea. |
#8
| |||
| |||
|
|
I saw in your original SP that STM_INS and STM_INS52 took one parameter marker, like this... |
|
1) How about casting second parameter? SET STM_INS_2p = 'INSERT INTO CONF_HIST SELECT * FROM TABLE(GET_SUM_CONF_HIST( ? , CAST(? AS DATE) ))'; |
|
2) Are there more than two GET_SUM_CONF_HIST functions, one of them takes second parameter as DATE and another takes second parameter as VARCHAR or CHAR. |
![]() |
| Thread Tools | |
| Display Modes | |
| |