The following lines contain the word 'select', 'insert', 'update' or 'delete':
Refresh the variable data before the next update
so that the timestamp is accurate.
PROCEDURE: create_phantom
REM **********************************************************************
*/
/*************************************************************************
* This file contains procedures for the Phantom Batch APIs for GME in *
* Oracle Process Manufacturing (OPM). Each procedure has a common set of *
* parameters to which API-specific parameters are appended. *
*************************************************************************/
g_pkg_name CONSTANT VARCHAR2 (30) := 'gme_phantom_pvt';
SELECT d.plan_start_date, d.plan_cmplt_date
FROM gme_batch_step_items i, gme_batch_steps d
WHERE d.batchstep_id = i.batchstep_id
AND i.material_detail_id = v_material_detail_id;
SELECT material_detail_id
FROM gme_material_details
WHERE batch_id = v_batch_id
AND inventory_item_id = v_inventory_item_id
AND line_type = gme_common_pvt.g_line_type_prod
ORDER BY line_no;
l_phant_batch.update_inventory_ind :=
l_batch_header.update_inventory_ind;
gme_debug.put_line ('Update batch_id '|| l_phant_batch.batch_id||' with parentline_id '||p_material_detail_rec.material_detail_id);
IF NOT gme_batch_header_dbl.update_row (p_batch_header => l_phant_batch) THEN
RAISE batch_upd_error;
gme_debug.put_line ('Lets Update line ids now');
gme_debug.put_line ('Update phantom prod material_detail_id '|| l_prod_mtl_dtl_id||' with phantom_line_id '||p_material_detail_rec.material_detail_id);
UPDATE gme_material_details
SET phantom_line_id = p_material_detail_rec.material_detail_id
,release_type = x_material_detail_rec.release_type
,subinventory = x_material_detail_rec.subinventory
,locator_id = x_material_detail_rec.locator_id
,last_update_date = gme_common_pvt.g_timestamp
,last_updated_by = gme_common_pvt.g_user_ident
,last_update_login = gme_common_pvt.g_login_id
WHERE material_detail_id = l_prod_mtl_dtl_id;
gme_debug.put_line ('Update material_detail_id '|| p_material_detail_rec.material_detail_id||' with phantom_line_id '||l_prod_mtl_dtl_id);
UPDATE gme_material_details
SET phantom_line_id = l_prod_mtl_dtl_id
,phantom_id = l_phant_batch.batch_id
,last_update_date = gme_common_pvt.g_timestamp
,last_updated_by = gme_common_pvt.g_user_ident
,last_update_login = gme_common_pvt.g_login_id
WHERE material_detail_id = p_material_detail_rec.material_detail_id;
SELECT d.phantom_id
FROM gme_batch_step_items i, gme_material_details d
WHERE d.batch_id = v_batch_id
AND i.material_detail_id = d.material_detail_id
AND batchstep_id = v_batchstep_id
AND ( d.release_type = gme_common_pvt.g_mtl_autobystep_release
OR ( d.release_type IN
(gme_common_pvt.g_mtl_manual_release
,gme_common_pvt.g_mtl_incremental_release)
AND p_all_release_type_assoc = 1) )
AND NVL (d.phantom_id, 0) > 0;
SELECT d.phantom_id
FROM gme_material_details d
WHERE d.batch_id = v_batch_id
AND d.release_type <= v_release_type
AND NVL (d.phantom_id, 0) > 0;