The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT d.phantom_id
FROM gme_material_details d
WHERE d.batch_id = v_batch_id
AND NVL (d.phantom_id, 0) > 0
AND NOT EXISTS (
SELECT 1
FROM gme_batch_step_items
WHERE material_detail_id = d.material_detail_id
AND d.release_type = 3);
batch_hist_insert_err EXCEPTION;
IF x_batch_header_rec.update_inventory_ind = 'Y'
THEN
-- STEP-3: Check that transaction are not purged
IF gme_api_grp_pk2.Is_batch_purged(p_batch_id => x_batch_header_rec.batch_id) = TRUE
THEN
RAISE BATCH_ALREADY_PURGED;
END IF; --delete only if we have steps in batch
IF NOT (gme_batch_header_dbl.update_row (x_batch_header_rec) ) THEN
x_batch_header_rec.batch_status := 4;
IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
/* Insert the event into the batch history table */
IF NOT gme_common_pvt.create_history
(x_batch_header_rec
,x_batch_header_rec.batch_status) THEN
RAISE batch_hist_insert_err;
RAISE batch_hist_insert_err;
/* Update the row who columns */
x_batch_header_rec.last_update_date := gme_common_pvt.g_timestamp;
x_batch_header_rec.last_updated_by := gme_common_pvt.g_user_ident;
x_batch_header_rec.last_update_login := gme_common_pvt.g_login_id;
WHEN batch_hist_insert_err THEN
x_return_status := fnd_api.g_ret_sts_error;
SELECT gl_posted_ind
FROM gme_batch_header
WHERE gl_posted_ind > 1
AND batch_status = 4
AND batch_id = l_batch_id;
SELECT COUNT (1)
FROM cm_cmpt_dtl cst
,cm_acst_led aled
,gme_material_details md
,gme_batch_header bh
WHERE bh.batch_id = l_batch_id
AND bh.batch_id = md.batch_id
AND md.material_detail_id = aled.transline_id
AND aled.source_ind = 0
AND aled.cmpntcost_id = cst.cmpntcost_id
AND cst.rollover_ind = 1;
SELECT COUNT(1)
FROM cm_cmpt_dtl cst, cm_acst_led aled, gme_material_details md, gme_batch_header bh, gmf_period_statuses d
WHERE bh.batch_id = l_batch_id
AND bh.batch_id = md.batch_id
AND md.material_detail_id = aled.transline_id
AND aled.source_ind = 0
AND aled.cmpntcost_id = cst.cmpntcost_id
AND aled.period_id = d.period_id
AND bh.batch_close_date >= d.start_date
AND bh.batch_close_date <= d.end_date
AND cst.rollover_ind = 1;