DBA Data[Home] [Help]

APPS.MSC_LAUNCH_PLAN_PK dependencies on MSC_PLANS

Line 140: FROM msc_plans mp

136:
137: CURSOR check_plan_id(p_plan_id IN Number,
138: p_designator IN VARCHAR2) IS
139: SELECT 1
140: FROM msc_plans mp
141: WHERE mp.plan_id = p_plan_Id
142: AND mp.compile_designator = p_designator;
143:
144: CURSOR get_plan_id(p_designator IN VARCHAR2) IS

Line 146: FROM msc_plans mp

142: AND mp.compile_designator = p_designator;
143:
144: CURSOR get_plan_id(p_designator IN VARCHAR2) IS
145: SELECT mp.plan_id
146: FROM msc_plans mp
147: WHERE mp.compile_designator = p_designator;
148:
149: CURSOR C1(p_plan_id in number) IS
150: SELECT organization_id, sr_instance_id,

Line 154: FROM msc_plans

150: SELECT organization_id, sr_instance_id,
151: curr_Plan_Type, curr_Overwrite_Option,
152: request_id, plan_completion_date, summary_flag,
153: compile_designator
154: FROM msc_plans
155: WHERE plan_id = p_plan_id;
156:
157: v_rec_c1 c1%rowtype;
158:

Line 163: FROM msc_plans

159: cursor temp_plan_exist_cur(p_designator in varchar2,
160: p_org_id in number,
161: p_instance_id in number) is
162: SELECT plan_id, plan_completion_date,request_id, summary_flag
163: FROM msc_plans
164: WHERE compile_designator = p_designator
165: AND organization_id = p_org_id
166: AND sr_instance_id = p_instance_id;
167:

Line 179: from msc_designators desig, msc_plans plans

175: desig.organization_id,
176: desig.sr_instance_id,
177: plans.curr_plan_type,
178: plans.curr_overwrite_option
179: from msc_designators desig, msc_plans plans
180: where desig.designator = plans.compile_designator
181: and plans.plan_id= p_plan_id
182: and plans.organization_id = desig.organization_id
183: and plans.sr_instance_id = desig.sr_instance_id;

Line 198: from msc_plans

194: v_ex_error_plan_launch EXCEPTION;
195:
196: cursor plan_type_c(p_plan_id in number) is
197: select curr_plan_type
198: from msc_plans
199: where plan_id = p_plan_id;
200:
201: l_plan_type number:=null;
202:

Line 227: update msc_plans

223: fetch plan_type_c into l_plan_type;
224: close plan_type_c;
225:
226: if l_plan_type > 100 then -- if rp plan, bug#10124429
227: update msc_plans
228: set
229: calculate_liability = nvl(p_calculate_liabilty,2),
230: compute_ss_eoq = p_compute_ss_eoq,
231: PUB_CAP_TO_CMRO = p_pub_cap_cmro

Line 236: update msc_plans

232: --where plan_id = arg_plan_id;
233: where plan_id = v_new_plan_id;
234:
235: else
236: update msc_plans
237: set release_reschedules = nvl(arg_release_reschedules,2),
238: calculate_liability = nvl(p_calculate_liabilty,2),
239: compute_ss_eoq = p_compute_ss_eoq,
240: PUB_CAP_TO_CMRO = p_pub_cap_cmro

Line 490: | Update msc_plans with plan horizon date |

486: end if;
487: -- End of additional code for 24X7 ATP - 30-10-2002
488:
489: /*----------------------------------------+
490: | Update msc_plans with plan horizon date |
491: +----------------------------------------*/
492: MSC_UTIL.msc_Debug('******About to Launch Plan******');
493: -- Modification for bug 1863615
494: -- IF arg_plan_horizon IS NULL THEN

Line 500: -- UPDATE msc_plans

496:
497: -- var_new_date := MSC_CALENDAR.NEXT_WORK_DAY(l_org_id,l_instance_id,1,
498: -- TO_DATE(TO_CHAR(add_months(sysdate, NVL(months, 12)),
499: -- 'YYYY/MM/DD HH24:MI:SS'), 'YYYY/MM/DD HH24:MI:SS')) ;
500: -- UPDATE msc_plans
501: -- SET curr_cutoff_date = var_new_date ,
502: -- online_replan = NULL
503: -- WHERE plan_id = arg_plan_id;
504: --

Line 510: -- UPDATE msc_plans

506:
507: -- ELSE
508:
509: -- var_new_date := MSC_CALENDAR.NEXT_WORK_DAY(l_org_id,l_instance_id,1,TO_DATE(arg_plan_horizon, 'YYYY/MM/DD HH24:MI:SS')) ;
510: -- UPDATE msc_plans
511: -- SET curr_cutoff_date = var_new_date,
512: -- online_replan = NULL
513: -- WHERE plan_id = arg_plan_id;
514: -- COMMIT;

Line 639: FROM msc_plans

635: -- SNOP Change start
636:
637: SELECT plan_start_date
638: INTO v_plan_completion_date
639: FROM msc_plans
640: WHERE plan_id = v_plan_id;
641:
642: IF (arg_launch_snapshot = DP_SCN_ONLY_SNAPSHOT AND
643: v_plan_completion_date is not null ) --Not a first time plan launch

Line 645: UPDATE msc_plans

641:
642: IF (arg_launch_snapshot = DP_SCN_ONLY_SNAPSHOT AND
643: v_plan_completion_date is not null ) --Not a first time plan launch
644: THEN
645: UPDATE msc_plans
646: SET planning_mode = DP_SCN_ONLY_SNP_MODE
647: WHERE plan_id = v_plan_id;
648: COMMIT;
649: ELSE

Line 650: UPDATE msc_plans

646: SET planning_mode = DP_SCN_ONLY_SNP_MODE
647: WHERE plan_id = v_plan_id;
648: COMMIT;
649: ELSE
650: UPDATE msc_plans
651: SET planning_mode = NULL
652: WHERE plan_id = v_plan_id;
653: COMMIT;
654: END IF;

Line 659: UPDATE msc_plans

655:
656: -- SNOP Change End
657: IF ( p_generate_fcst = 1 )
658: THEN
659: UPDATE msc_plans
660: SET GENERATE_INLINE_FORECAST= SYS_YES
661: WHERE plan_id = v_plan_id;
662: COMMIT;
663: ELSE

Line 664: UPDATE msc_plans

660: SET GENERATE_INLINE_FORECAST= SYS_YES
661: WHERE plan_id = v_plan_id;
662: COMMIT;
663: ELSE
664: UPDATE msc_plans
665: SET GENERATE_INLINE_FORECAST= SYS_NO
666: WHERE plan_id = v_plan_id;
667: COMMIT;
668:

Line 671: update msc_plans

667: COMMIT;
668:
669: END IF;
670: IF (arg_launch_snapshot = SYS_YES) then
671: update msc_plans
672: set SNAPSHOT_SOURCE = p_snapshot_source
673: where plan_id = v_plan_id ;
674: commit;
675: ELSE

Line 676: update msc_plans

672: set SNAPSHOT_SOURCE = p_snapshot_source
673: where plan_id = v_plan_id ;
674: commit;
675: ELSE
676: update msc_plans
677: set SNAPSHOT_SOURCE = null
678: where plan_id = v_plan_id ;
679: commit;
680: END IF ;

Line 951: UPDATE msc_plans /* for 24x7 ATP */

947: return;
948: END IF;
949:
950:
951: UPDATE msc_plans /* for 24x7 ATP */
952: SET request_id = var_snapshot_req_id
953: WHERE plan_id = v_plan_id;
954:
955: COMMIT;

Line 1108: UPDATE msc_plans /* for 24x7 ATP */

1104: return;
1105: END IF;
1106: END IF;
1107: END IF;
1108: UPDATE msc_plans /* for 24x7 ATP */
1109: SET request_id = var_snapshot_req_id
1110: WHERE plan_id = v_plan_id;
1111:
1112: COMMIT;

Line 1126: from msc_plans

1122: where organization_id = v_rec_c1.organization_id
1123: AND sr_instance_id = v_rec_c1.sr_instance_id
1124: AND (designator,designator_type) in
1125: (select compile_designator, plan_type
1126: from msc_plans
1127: Where plan_id = v_plan_id);
1128:
1129: exception when no_data_found then
1130: null;

Line 1134: update msc_plans

1130: null;
1131: end;
1132:
1133: if p_generate_worksheet=1 then
1134: update msc_plans
1135: set generate_worksheet = p_generate_worksheet
1136: where plan_id = v_plan_id;
1137: commit;
1138: end if;

Line 1142: update msc_plans

1138: end if;
1139:
1140: --pabram..phub
1141: MSC_UTIL.msc_Debug('phub archive_flag :'|| to_char(p_archive_flag));
1142: update msc_plans
1143: set archive_flag = p_archive_flag
1144: where plan_id = v_plan_id;
1145: commit;
1146: --pabram..phub ends

Line 1229: From Msc_Plans

1225: Weekly_Trans_Constraints,
1226: curr_start_date,
1227: curr_cutoff_date,
1228: release_reschedules
1229: From Msc_Plans
1230: Where Plan_Id = p_plan_id;
1231:
1232: -- Modified (forward port) for the bug # 3021850
1233: Cursor Desig_Cur(p_plan_id in number) Is

Line 1240: From Msc_Plans

1236: organization_selection,last_update_date,last_updated_by,last_update_login,nvl(purge_current_plan,2) purge_current_plan
1237: From Msc_Designators
1238: Where (Designator, Organization_Id, Sr_Instance_Id) =
1239: ( Select Compile_Designator, Organization_Id, Sr_Instance_Id
1240: From Msc_Plans
1241: Where Plan_Id=p_plan_id);
1242:
1243: cursor c_plan_name(p_designator in varchar2) is
1244: select designator

Line 1345: update msc_plans

1341: -- 2. Multiple temp plans cannot be created with the same name which
1342: -- will violate the unique key(designator,sr_instance_id and organization_id)
1343: -------------------------------------------------------------------------------
1344:
1345: update msc_plans
1346: set compile_designator = decode(v_org_desig_cur.purge_current_plan,2,lv_plan_name, nvl(substr(to_char(p_temp_plan_id),-10),p_temp_plan_id)),
1347: -- copy_plan_id=p_temp_plan_id,
1348: copy_plan_id=decode(v_org_desig_cur.purge_current_plan,2,-1,-2),
1349: plan_completion_date = decode(v_org_desig_cur.purge_current_plan,2,v_org_plan_name_Cur.plan_completion_date,null),

Line 1395: Update msc_plans

1391: -- ----------------------------------------------
1392: -- Bug#2761381 - restoring all the columns which
1393: -- will not be modified from Plan options UI.
1394: -- ----------------------------------------------
1395: Update msc_plans
1396: set copy_plan_id = -1,
1397: Last_Update_Date = v_temp_plan_name_cur.Last_Update_Date,
1398: Last_Updated_By = v_temp_plan_name_cur.Last_Updated_By,
1399: Last_Update_Login = v_temp_plan_name_cur.Last_Update_Login,

Line 1535: from msc_plans

1531: program_id = v_temp_plan_name_cur.program_id,
1532: program_update_date = v_temp_plan_name_cur.program_update_date
1533: where (designator,organization_id,sr_instance_id)
1534: = ( select compile_designator,organization_id,sr_instance_id
1535: from msc_plans
1536: where plan_id=p_temp_plan_id);
1537:
1538: Update MSC_PLAN_ORGANIZATIONS
1539: set plan_completion_date = v_temp_plan_name_cur.Plan_Completion_Date,

Line 1555: SELECT compile_designator from msc_plans where plan_id = p_plan_id ;

1551: l_orig_name varchar2(10);
1552: l_old_name varchar2(10);
1553:
1554: CURSOR cur_get_plan(p_plan_id number) IS
1555: SELECT compile_designator from msc_plans where plan_id = p_plan_id ;
1556:
1557:
1558:
1559: begin

Line 1705: Update msc_plans_other

1701: MSC_UTIL.msc_Debug('Error updating preferences and schedules.');
1702: RAISE;
1703: END;
1704: -- Bug#7449943
1705: Update msc_plans_other
1706: set ref_plan_id = p_temp_plan_id
1707: where ref_plan_id = p_org_plan_id;
1708:
1709: commit;

Line 1765: FROM msc_plans

1761: CURSOR C1(p_plan_id in number)
1762: IS
1763: SELECT request_id
1764: , compile_designator
1765: FROM msc_plans
1766: WHERE plan_id = p_plan_id;
1767:
1768: v_rec_c1 c1%rowtype;
1769:

Line 1774: Update msc_plans.planning_mode with arg_launch_scheduler

1770: v_ex_error_plan_launch EXCEPTION;
1771: BEGIN
1772:
1773: /*================================================================
1774: Update msc_plans.planning_mode with arg_launch_scheduler
1775: if arg_launch_scheduler == DS_EXP_ONLY (DS Exception only mode)
1776: then msc_plans.planning_mode will be set to 1.
1777: In all other cases msc_plans.planning_mode will be set to NULL
1778: ================================================================*/

Line 1776: then msc_plans.planning_mode will be set to 1.

1772:
1773: /*================================================================
1774: Update msc_plans.planning_mode with arg_launch_scheduler
1775: if arg_launch_scheduler == DS_EXP_ONLY (DS Exception only mode)
1776: then msc_plans.planning_mode will be set to 1.
1777: In all other cases msc_plans.planning_mode will be set to NULL
1778: ================================================================*/
1779: BEGIN
1780: update msc_plans

Line 1777: In all other cases msc_plans.planning_mode will be set to NULL

1773: /*================================================================
1774: Update msc_plans.planning_mode with arg_launch_scheduler
1775: if arg_launch_scheduler == DS_EXP_ONLY (DS Exception only mode)
1776: then msc_plans.planning_mode will be set to 1.
1777: In all other cases msc_plans.planning_mode will be set to NULL
1778: ================================================================*/
1779: BEGIN
1780: update msc_plans
1781: set planning_mode = decode(arg_launch_scheduler, DS_EXP_ONLY, 1,

Line 1780: update msc_plans

1776: then msc_plans.planning_mode will be set to 1.
1777: In all other cases msc_plans.planning_mode will be set to NULL
1778: ================================================================*/
1779: BEGIN
1780: update msc_plans
1781: set planning_mode = decode(arg_launch_scheduler, DS_EXP_ONLY, 1,
1782: DS_OLS_ONLY, DS_OLS_ONLY,
1783: NULL),
1784: curr_ols_horizon_days = arg_ols_horizon_days,

Line 1791: MSC_UTIL.msc_Debug('Error while updating msc_plans.planning_mode. Plan_id = '||to_char(arg_plan_id));

1787:
1788: COMMIT;
1789:
1790: EXCEPTION WHEN OTHERS THEN
1791: MSC_UTIL.msc_Debug('Error while updating msc_plans.planning_mode. Plan_id = '||to_char(arg_plan_id));
1792: MSC_UTIL.msc_Debug(SQLERRM);
1793: END;
1794:
1795: v_plan_id := arg_plan_id;

Line 2050: FROM msc_plans

2046:
2047:
2048: SELECT nvl(request_id, NULL_VALUE)
2049: INTO l_request_id
2050: FROM msc_plans
2051: WHERE plan_id = l_plan_id;
2052:
2053:
2054: -- Wait until the request_id is populated in msc_Plans.

Line 2054: -- Wait until the request_id is populated in msc_Plans.

2050: FROM msc_plans
2051: WHERE plan_id = l_plan_id;
2052:
2053:
2054: -- Wait until the request_id is populated in msc_Plans.
2055: WHILE ( l_request_id < launch_plan_request_id)
2056: LOOP
2057: SELECT nvl(request_id, NULL_VALUE)
2058: INTO l_request_id

Line 2059: FROM msc_plans

2055: WHILE ( l_request_id < launch_plan_request_id)
2056: LOOP
2057: SELECT nvl(request_id, NULL_VALUE)
2058: INTO l_request_id
2059: FROM msc_plans
2060: WHERE plan_id = l_plan_id;
2061:
2062: DBMS_LOCK.SLEEP(10);
2063: END LOOP;

Line 2068: FROM msc_plans

2064:
2065: -- Request_id is populated. Get the planning Mode
2066: SELECT planning_mode
2067: INTO l_planning_mode
2068: FROM msc_plans
2069: WHERE plan_id = l_plan_id;
2070:
2071: IF (l_planning_mode is null ) -- Both snapshot and planner would be launched
2072: THEN

Line 2091: FROM msc_plans

2087: IF (l_snapshot_request_id <> NULL_VALUE )
2088: THEN
2089: SELECT nvl(request_id, NULL_VALUE)
2090: INTO l_request_id
2091: FROM msc_plans
2092: WHERE plan_id = l_plan_id;
2093:
2094: -- Wait until the Plan_request_id is populated in msc_Plans.
2095: WHILE ( l_request_id < l_snapshot_request_id)

Line 2094: -- Wait until the Plan_request_id is populated in msc_Plans.

2090: INTO l_request_id
2091: FROM msc_plans
2092: WHERE plan_id = l_plan_id;
2093:
2094: -- Wait until the Plan_request_id is populated in msc_Plans.
2095: WHILE ( l_request_id < l_snapshot_request_id)
2096: LOOP
2097: SELECT nvl(request_id, NULL_VALUE)
2098: INTO l_request_id

Line 2099: FROM msc_plans

2095: WHILE ( l_request_id < l_snapshot_request_id)
2096: LOOP
2097: SELECT nvl(request_id, NULL_VALUE)
2098: INTO l_request_id
2099: FROM msc_plans
2100: WHERE plan_id = l_plan_id;
2101:
2102: DBMS_LOCK.SLEEP(10);
2103: END LOOP;

Line 2221: select rowid from msc_plans

2217: l_Counter NUMBER :=0;
2218: l_max_tries CONSTANT Number := 100000;
2219:
2220: cursor c_lock_child_plans(var_plan_id in number) is
2221: select rowid from msc_plans
2222: where base_plan_id=arg_plan_id
2223: for update of plan_completion_date,has_run,base_plan_id nowait;
2224:
2225: TYPE tab_type IS TABLE OF ROWID INDEX BY BINARY_INTEGER;

Line 2232: MSC_UTIL.msc_Debug('In process_child_rp_plans: Attempting to update Msc_Plans for child rp plans...');

2228: begin
2229: MSC_UTIL.msc_Debug('Debug Only: In process_child_rp_plans...');
2230: --Step 1: Check for lock and update child plan rows
2231: savepoint BF_UPD_CHILD_RP;
2232: MSC_UTIL.msc_Debug('In process_child_rp_plans: Attempting to update Msc_Plans for child rp plans...');
2233: l_Counter := 0;
2234: MSC_UTIL.msc_Debug('Debug Only: Attempting to lock any child plans...');
2235: LOOP
2236: BEGIN

Line 2246: UPDATE MSC_PLANS

2242:
2243: MSC_UTIL.msc_Debug('Debug Only: Got count of child plans...'||l_rowlist.count);
2244:
2245: FORALL I IN 1..l_rowlist.count
2246: UPDATE MSC_PLANS
2247: SET plan_completion_date=null,
2248: has_run=0,
2249: base_plan_id=null
2250: WHERE ROWID=l_rowlist(I);

Line 2260: MSC_UTIL.msc_Debug('Unable to lock msc_plans for updating Calculate lateness constraints.');

2256: IF c_lock_child_plans%ISOPEN THEN
2257: CLOSE c_lock_child_plans;
2258: END IF;
2259: IF l_Counter > l_max_tries THEN
2260: MSC_UTIL.msc_Debug('Unable to lock msc_plans for updating Calculate lateness constraints.');
2261: --RAISE;
2262: rollback to BF_UPD_CHILD_RP;
2263: EXIT;
2264: END IF;

Line 2266: MSC_UTIL.msc_Debug('Unable to lock/update msc_plans row after: ('||l_Counter||') Tries...');

2262: rollback to BF_UPD_CHILD_RP;
2263: EXIT;
2264: END IF;
2265: IF TRUNC(l_Counter/100)*100 = l_Counter THEN
2266: MSC_UTIL.msc_Debug('Unable to lock/update msc_plans row after: ('||l_Counter||') Tries...');
2267: END IF;
2268: END;
2269: END LOOP;
2270: MSC_UTIL.msc_Debug('Debug Only: Out of lock loop...');

Line 2291: select rowid from msc_plans

2287: l_Counter NUMBER :=0;
2288: l_max_tries CONSTANT Number := 100000;
2289:
2290: cursor c_lock_plan_row(var_plan_id in number) is
2291: select rowid from msc_plans
2292: where plan_id=var_plan_id
2293: for update of COMPUTE_CONSTRAINTS nowait;
2294:
2295: cursor c_get_designator (var_plan_id in number) is

Line 2296: select compile_designator from msc_plans

2292: where plan_id=var_plan_id
2293: for update of COMPUTE_CONSTRAINTS nowait;
2294:
2295: cursor c_get_designator (var_plan_id in number) is
2296: select compile_designator from msc_plans
2297: where plan_id=var_plan_id;
2298: l_designator varchar2(10);
2299: l_row ROWID :=null;
2300:

Line 2307: select 1 from msc_plans where status>0 and status <=50 and plan_id =var_plan_id

2303: cursor c_ws_status (var_plan_id in number) is
2304: select count(*) from msc_web_services where
2305: plan_id in (-1, var_plan_id)
2306: and not exists (
2307: select 1 from msc_plans where status>0 and status <=50 and plan_id =var_plan_id
2308: );
2309:
2310:
2311: /*

Line 2341: MSC_UTIL.msc_Debug('In msc_launch_rp_plan: Attempting to update Msc_Plans for lateness constraints...');

2337:
2338: /*Step 1: Check for lock and update lateness_constraints*/
2339:
2340: savepoint BF_UPD_RP;
2341: MSC_UTIL.msc_Debug('In msc_launch_rp_plan: Attempting to update Msc_Plans for lateness constraints...');
2342:
2343: l_Counter := 0;
2344: LOOP
2345: BEGIN

Line 2354: UPDATE MSC_PLANS

2350: CLOSE c_lock_plan_row;
2351:
2352: MSC_UTIL.msc_Debug('Locked the plan...');
2353:
2354: UPDATE MSC_PLANS
2355: SET
2356: STATUS=1,
2357: COMPUTE_CONSTRAINTS = nvl(arg_calc_lateness,2),
2358: SAVE_TO_DB =nvl(arg_save_option,3)

Line 2373: MSC_UTIL.msc_Debug('Unable to lock msc_plans for updating Calculate lateness constraints.');

2369: IF c_lock_plan_row%ISOPEN THEN
2370: CLOSE c_lock_plan_row;
2371: END IF;
2372: IF l_Counter > l_max_tries THEN
2373: MSC_UTIL.msc_Debug('Unable to lock msc_plans for updating Calculate lateness constraints.');
2374: --RAISE;
2375: rollback to BF_UPD_RP;
2376: EXIT;
2377: END IF;

Line 2379: MSC_UTIL.msc_Debug('Unable to lock/update msc_plans row after: ('||l_Counter||') Tries...');

2375: rollback to BF_UPD_RP;
2376: EXIT;
2377: END IF;
2378: IF TRUNC(l_Counter/100)*100 = l_Counter THEN
2379: MSC_UTIL.msc_Debug('Unable to lock/update msc_plans row after: ('||l_Counter||') Tries...');
2380: END IF;
2381: END;
2382: END LOOP;
2383: