/* Formatted on 5/12/2015 4:59:56 PM (QP5 v5.265.14096.37972) */
DECLARE
CURSOR c_jobs
IS
SELECT we.WIP_ENTITY_NAME,
we.DESCRIPTION,
we.creation_date,
mp.organization_code,
wdj.class_code,
wdj.PRIMARY_ITEM_ID,
wdj.COMPLETION_SUBINVENTORY,
wdj.STATUS_TYPE
FROM apps.WIP_ENTITIES we,
apps.mtl_parameters mp,
apps.WIP_DISCRETE_JOBS wdj
WHERE 1 = 1 -- we.created_by = 19087
AND we.organization_id = mp.organization_id
AND wdj.WIP_ENTITY_ID = we.WIP_ENTITY_ID
AND wdj.organization_id = we.organization_id
AND mp.organization_code = 'LSP'
AND we.wip_entity_name IN ('XXXX',);
BEGIN
FOR r_jobs IN c_jobs
LOOP
INSERT INTO apps.wip_job_schedule_interface (organization_code,
primary_item_id,
job_name,
class_code,
status_type,
-- COMPLETION_SUBINVENTORY,
GROUP_ID,
load_type,
process_phase,
process_status,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (r_jobs.organization_code,
r_jobs.primary_item_id,
r_jobs.WIP_ENTITY_NAME, -- job_name
r_jobs.class_code, --'Discrete', --class_code
r_jobs.STATUS_TYPE, --status_type 1.UnReleased 3. Released 4.Complete 6.On Hold 7. Cancelled
-- r_jobs.COMPLETION_SUBINVENTORY,
12345, -- group_id
3, -- load_type
/*
1 Create Standard Discrete Job
2 Create Pending Repetitive Schedule
3 Update Standard or Non-Standard Discrete Job
4 Create Non-Standard Discrete Job
*/
2, -- 1 process_phase 2 Validation 3 Explosion 4 Complete 5 Creation
1, -- process_status 1 Pending 2 Running 3 Error 4 Complete 5 Warning
19087, -- created_by
SYSDATE, -- creation_date
19087, -- last_updated_by
SYSDATE -- last_update_date
);
COMMIT;
END LOOP;
END;
After This Run the Program:
WIP Mass Load Program with Group ID
DECLARE
CURSOR c_jobs
IS
SELECT we.WIP_ENTITY_NAME,
we.DESCRIPTION,
we.creation_date,
mp.organization_code,
wdj.class_code,
wdj.PRIMARY_ITEM_ID,
wdj.COMPLETION_SUBINVENTORY,
wdj.STATUS_TYPE
FROM apps.WIP_ENTITIES we,
apps.mtl_parameters mp,
apps.WIP_DISCRETE_JOBS wdj
WHERE 1 = 1 -- we.created_by = 19087
AND we.organization_id = mp.organization_id
AND wdj.WIP_ENTITY_ID = we.WIP_ENTITY_ID
AND wdj.organization_id = we.organization_id
AND mp.organization_code = 'LSP'
AND we.wip_entity_name IN ('XXXX',);
BEGIN
FOR r_jobs IN c_jobs
LOOP
INSERT INTO apps.wip_job_schedule_interface (organization_code,
primary_item_id,
job_name,
class_code,
status_type,
-- COMPLETION_SUBINVENTORY,
GROUP_ID,
load_type,
process_phase,
process_status,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (r_jobs.organization_code,
r_jobs.primary_item_id,
r_jobs.WIP_ENTITY_NAME, -- job_name
r_jobs.class_code, --'Discrete', --class_code
r_jobs.STATUS_TYPE, --status_type 1.UnReleased 3. Released 4.Complete 6.On Hold 7. Cancelled
-- r_jobs.COMPLETION_SUBINVENTORY,
12345, -- group_id
3, -- load_type
/*
1 Create Standard Discrete Job
2 Create Pending Repetitive Schedule
3 Update Standard or Non-Standard Discrete Job
4 Create Non-Standard Discrete Job
*/
2, -- 1 process_phase 2 Validation 3 Explosion 4 Complete 5 Creation
1, -- process_status 1 Pending 2 Running 3 Error 4 Complete 5 Warning
19087, -- created_by
SYSDATE, -- creation_date
19087, -- last_updated_by
SYSDATE -- last_update_date
);
COMMIT;
END LOOP;
END;
After This Run the Program:
WIP Mass Load Program with Group ID
No comments:
Post a Comment