The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT *
FROM gme_material_details
WHERE batch_id = v_batch_id
ORDER BY line_no;
SELECT batch_status
FROM gme_batch_header
WHERE batch_id = v_batch_id;
SELECT s.batchstep_no, step_status
FROM gme_batch_steps s, gme_batch_step_items i
WHERE s.batchstep_id = i.batchstep_id
AND i.material_detail_id = v_material_detail_id;
SELECT 1
FROM gme_material_details
WHERE batch_id = v_batch_id
GROUP BY line_type
HAVING SUM (DECODE (v_batch_status, 1, plan_qty, 2, wip_plan_qty) ) =
0
AND line_type IN (1, -1);
SELECT *
FROM gmd_recipe_validity_rules
WHERE recipe_validity_rule_id = v_validity_rule_id;
SELECT status_type
FROM gmd_status
WHERE status_code = v_validity_rule_status;
SELECT concatenated_segments
FROM mtl_system_items_kfv
WHERE inventory_item_id = v_item_id AND organization_id = v_org_id;
SELECT qty, scale_type, scale_multiple, scale_rounding_variance
,rounding_direction, contribute_yield_ind, inventory_item_id
,detail_uom, line_no, line_type
FROM fm_matl_dtl
WHERE formulaline_id = v_formulaline_id;
SELECT *
FROM gme_material_details
WHERE batch_id = v_batch_id
ORDER BY line_no;
SELECT DISTINCT batchstep_id
FROM gme_batch_step_items
WHERE batch_id = v_batch_id;
SELECT 1
FROM DUAL
WHERE EXISTS (SELECT 1
FROM gme_batch_step_charges
WHERE batch_id = v_batch_id);
OR l_recipe_validity_rule.delete_mark = 1 THEN
-- Report error that the rule passed in is invalid
-- This is a fatal error and there is no point continuing
gme_common_pvt.log_message ('GME_API_INVALID_RULE');
IF NOT (gme_material_details_dbl.update_row
(x_material_tbl (l_row_number) ) ) THEN
RAISE material_save_failed;
x_material_tbl (l_row_number).last_update_date :=
gme_common_pvt.g_timestamp;
x_material_tbl (l_row_number).last_updated_by :=
gme_common_pvt.g_user_ident;
x_material_tbl (l_row_number).last_update_login :=
gme_common_pvt.g_login_id;
/* Update POC Data if steps are associated to a material line */
/* First fetch all the steps associated to a batch(all material lines) */
/* Checking for the new batch and batch with routing only */
/* we are using p_batch_header_rec for batch status to check whether batch has been created or not*/
IF p_batch_header_rec.batch_status <> 0
AND l_batch_header.poc_ind = 'Y' THEN
IF l_batch_header.automatic_step_calculation = 1 THEN
FOR l_cur_item_step_asso IN
cur_item_step_asso (l_batch_header.batch_id) LOOP
l_batch_step.batchstep_id :=
l_cur_item_step_asso.batchstep_id;
gme_update_step_qty_pvt.update_step_qty
(l_in_batch_step
,l_count
,l_list
,l_return_status
,l_batch_step);
SELECT material_detail_id
FROM gme_material_details
WHERE batch_id = v_batch_id
ORDER BY line_no;
SELECT DISTINCT batchstep_id
FROM gme_batch_step_items
WHERE batch_id = v_batch_id;
SELECT batchstep_id
FROM gme_batch_steps
WHERE batch_id = v_batch_id;
SELECT s.batchstep_no, step_status
FROM gme_batch_steps s, gme_batch_step_items i
WHERE s.batchstep_id = i.batchstep_id
AND i.material_detail_id = v_material_detail_id;
IF NOT (gme_material_details_dbl.update_row
(x_material_details (i) ) ) THEN
RAISE material_save_failed;
x_material_details (i).last_update_date :=
gme_common_pvt.g_timestamp;
x_material_details (i).last_updated_by :=
gme_common_pvt.g_user_ident;
x_material_details (i).last_update_login :=
gme_common_pvt.g_login_id;
gme_update_step_qty_pvt.update_step_qty (l_in_batch_step
,l_count
,l_list
,l_return_status
,l_batch_step);
SELECT routing_uom
FROM gmd_routings_b
WHERE routing_id = (SELECT routing_id
FROM gme_batch_header
WHERE batch_id = v_batch_id);
SELECT concatenated_segments
FROM mtl_system_items_kfv
WHERE inventory_item_id = v_item_id AND organization_id = v_org_id;
l_update_inventory_ind VARCHAR2 (1);
update_res_error EXCEPTION;
update_res_txn_error EXCEPTION;
SELECT automatic_step_calculation, update_inventory_ind
FROM gme_batch_header
WHERE batch_id = p_batch_id;
SELECT batchstep_id
FROM gme_batch_steps
WHERE batch_id = v_batch_id;
SELECT batchstep_resource_id
FROM gme_batch_step_resources
WHERE batchstep_id = v_step_id AND scale_type <> 0;
SELECT poc_trans_id
FROM gme_resource_txns_gtmp
WHERE doc_id = v_batch_id AND line_id = v_res_id;
INTO l_auto_step_calc, l_update_inventory_ind;
gme_update_step_qty_pvt.calc_charge
(p_step_id => l_batch_step.batchstep_id
,p_mass_qty => l_batch_step.actual_mass_qty
,p_vol_qty => l_batch_step.actual_volume_qty
,x_charge => l_charge
,x_return_status => l_return_status);
IF NOT (gme_batch_steps_dbl.update_row (l_batch_step) ) THEN
RAISE error_updating_steps;
gme_update_step_qty_pvt.update_step_qty
(p_batch_step_rec => l_in_batch_step
,x_batch_step_rec => l_batch_step
,x_message_count => l_message_count
,x_message_list => l_message_list
,x_return_status => l_return_status
,p_routing_scale_factor => p_routing_scale_factor);
/* We cannot invoke the update step qty API for certified non asqc steps */
/* as it would not update the resources if the actuals already populated */
/* Fetch all the resources associated with the step */
OPEN cur_get_res (l_batch_step.batchstep_id);
IF l_update_inventory_ind = 'Y' THEN
gme_update_step_qty_pvt.adjust_actual_usage
(p_batch_step_resources_rec => l_gme_batchstep_resources
,x_return_status => l_return_status);
RAISE update_res_txn_error;
END IF; /* IF l_update_inventory_ind = 'Y' */
IF NOT (gme_batch_step_resources_dbl.update_row
(l_gme_batchstep_resources) ) THEN
RAISE update_res_error;
WHEN error_updating_steps OR activity_rsrc_fetch_error OR update_res_error OR batch_step_fetch_err THEN
x_return_status := fnd_api.g_ret_sts_error;
WHEN error_updating_step_qty OR update_res_txn_error THEN
x_return_status := l_return_status;