The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT *
FROM gme_batch_steps
WHERE batch_id = v_batch_id
AND step_status = 2 -- terminate only WIP steps
ORDER BY batchstep_id;
SELECT *
FROM gme_batch_steps
WHERE batch_id = v_batch_id
AND step_status = 1 -- cancel pending steps
ORDER BY batchstep_id;
batch_hist_insert_err EXCEPTION;
delete_inv_txns_err EXCEPTION;
/* for the current batch if the update inventory ind is set for the batch */
IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
gme_trans_engine_util.load_rsrc_trans (x_batch_header_rec
,l_rsrc_trans_count
,x_return_status);
END IF; /* IF x_batch_header_rec.update_inventory_ind = 'Y' */
IF x_batch_header_rec.update_inventory_ind = 'Y' THEN
gme_cancel_batch_pvt.purge_batch_exceptions
(p_batch_header_rec => x_batch_header_rec
,p_delete_invis_mo => 'F'
,p_delete_reservations => 'T'
,p_delete_trans_pairs => 'F'
,x_return_status => x_return_status);
/* Now update the batch step status to Terminate (5) */
-- Get batch_step_ids bulk collected for batch
IF (g_debug <= gme_debug.g_log_procedure) THEN
gme_debug.put_line ( g_pkg_name
|| '.'
|| l_api_name
|| ':'
|| 'After fetch_batch_steps return_status='
|| x_return_status);
,p_update_inventory_ind => x_batch_header_rec.update_inventory_ind
,p_actual_cmplt_date => p_batch_header_rec.actual_cmplt_date
,x_return_status => x_return_status
,x_batch_step_rec => l_batch_step_rec);
,p_update_inventory_ind => x_batch_header_rec.update_inventory_ind
,x_return_status => x_return_status
,x_batch_step_rec => l_batch_step_rec);
/* Update the batch step to the database */
IF (g_debug <= gme_debug.g_log_procedure) THEN
gme_debug.put_line ( g_pkg_name
|| '.'
|| l_api_name
|| ':'
|| 'Call BATCH UPDATE_ROW');
IF NOT (gme_batch_header_dbl.update_row (x_batch_header_rec) ) THEN
RAISE batch_header_upd_err;
gme_debug.put_line(g_pkg_name||'.'||l_api_name||' Invoking delete_prod_supply_resv for batch header' );
gme_supply_res_pvt.delete_batch_prod_supply_resv (
p_batch_header_rec => l_batch_header_rec
,x_msg_count => l_message_count
,x_msg_data => l_message_list
,x_return_status => x_return_status);
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
,p_batch_header_rec.batch_status) THEN
RAISE batch_hist_insert_err;
|| ' delete_batch_prod_supply_resv ERROR');
WHEN batch_hist_insert_err THEN
IF (g_debug <= gme_debug.g_log_procedure) THEN
gme_debug.put_line ('BATCH_HIST_INSERT_ERR.');
WHEN delete_inv_txns_err THEN
IF (g_debug <= gme_debug.g_log_procedure) THEN
gme_debug.put_line ( g_pkg_name
|| '.'
|| l_api_name
|| ':'
|| 'DELETE_INV_TXNS_ERR.');