The following lines contain the word 'select', 'insert', 'update' or 'delete':
select wmti1.transaction_id
from wip_move_txn_interface wmti,
wip_move_txn_interface wmti1
where wmti.group_id = mov_group_id
and wmti.overcompletion_transaction_id is not NULL
AND wmti.overcompletion_transaction_qty > 0
and wmti1.overcompletion_transaction_id = wmti.overcompletion_transaction_id;
wip_move_alloc_cleanup.fetch_and_delete
(p_mov_grp_id => oc_mov_group_id,
p_mov_allocs => oc_alloc_recs);
wip_move_txn_interface_cleanup.fetch_and_delete
(p_grp_id => oc_mov_group_id,
p_moves => oc_move_recs);
delete wip_cost_txn_interface
where group_id = res_group_id;
wip_move_alloc_cleanup.fetch_and_delete(
p_mov_grp_id => mov_group_id,
p_mov_allocs => alloc_recs);
wip_mtl_txns_temp_cleanup.fetch_and_delete(
p_hdr_id => mtl_header_id,
p_act_id => NULL,
p_materials => mtl_temp_recs,
p_lots => lt_temp_recs,
p_serials => sn_temp_recs,
p_dyn_serials => sn_recs,
p_ser_marks => sn_marks);
wip_move_txn_interface_cleanup.fetch_and_delete(
p_grp_id => mov_group_id,
p_moves => move_recs);
wip_move_txn_interface_cleanup.insert_rows(move_recs);
wip_mtl_txns_temp_cleanup.insert_rows(
p_materials => mtl_temp_recs,
p_lots => lt_temp_recs,
p_serials => sn_temp_recs,
p_dyn_serials => sn_recs,
p_ser_marks => sn_marks,
p_retcode => x_retcode,
p_app => x_app,
p_msg => x_msg);
wip_move_alloc_cleanup.insert_rows(alloc_recs);
wip_mtl_txns_temp_cleanup.fetch_and_delete(
p_hdr_id => mtl_header_id,
p_act_id => NULL,
p_materials => mtl_tmp_recs,
p_lots => mtl_lt_tmp_recs,
p_serials => mtl_sn_tmp_recs,
p_dyn_serials => mtl_dyn_sn_recs,
p_ser_marks => mtl_sn_mrks);
wip_mtl_txns_temp_cleanup.insert_rows(
p_materials => mtl_tmp_recs,
p_lots => mtl_lt_tmp_recs,
p_serials => mtl_sn_tmp_recs,
p_dyn_serials => mtl_dyn_sn_recs,
p_ser_marks => mtl_sn_mrks,
p_retcode => x_retcode,
p_app => x_app,
p_msg => x_msg);
insert_sp IN VARCHAR2,
bf_page IN NUMBER,
err_code OUT NOCOPY NUMBER,
err_app OUT NOCOPY VARCHAR2,
err_msg OUT NOCOPY VARCHAR2) IS
cmp_mtl_tmp_recs wip_mtl_txns_temp_cleanup.MTL_TRANSACTIONS_TEMP_REC;
select wmti.transaction_id
from mtl_material_transactions_temp mmtt,
wip_move_txn_interface wmti
where mmtt.TRANSACTION_HEADER_ID = mtl_header_id
and mmtt.overcompletion_transaction_id is not null
and wmti.overcompletion_transaction_id = mmtt.overcompletion_transaction_id;
wip_move_alloc_cleanup.fetch_and_delete
(p_mov_grp_id => oc_mov_group_id,
p_mov_allocs => oc_alloc_recs);
wip_move_txn_interface_cleanup.fetch_and_delete
(p_grp_id => oc_mov_group_id,
p_moves => oc_move_recs);
wip_mtl_txns_temp_cleanup.fetch_and_delete(
p_hdr_id => mtl_header_id,
p_act_id => action_id,
p_materials => cmp_mtl_tmp_recs,
p_lots => cmp_lt_tmp_recs,
p_serials => cmp_sn_tmp_recs,
p_dyn_serials => cmp_dyn_sn_recs,
p_ser_marks => cmp_sn_mrks);
wip_mtl_txns_temp_cleanup.fetch_and_delete(
p_hdr_id => mtl_header_id,
p_act_id => NULL,
p_materials => bf_mtl_tmp_recs,
p_lots => bf_lt_tmp_recs,
p_serials => bf_sn_tmp_recs,
p_dyn_serials => bf_dyn_sn_recs,
p_ser_marks => bf_sn_mrks);
wip_lot_temp_cleanup.insert_rows(p_lots => cmp_lt_tmp_recs);
wip_serial_temp_cleanup.insert_rows(p_serials => cmp_sn_tmp_recs);
wip_serial_number_cleanup.insert_rows(p_serials => cmp_dyn_sn_recs);
wip_mtl_txns_temp_cleanup.insert_rows(p_mtls => cmp_mtl_tmp_recs);
wip_move_txn_interface_cleanup.insert_rows(oc_move_recs);
wip_utilities.do_sql('SAVEPOINT ' || insert_sp);
wip_mtl_txns_temp_cleanup.insert_rows(
p_materials => bf_mtl_tmp_recs,
p_lots => bf_lt_tmp_recs,
p_serials => bf_sn_tmp_recs,
p_dyn_serials => bf_dyn_sn_recs,
p_ser_marks => bf_sn_mrks,
p_retcode => x_retcode,
p_app => x_app,
p_msg => x_msg);
wip_move_alloc_cleanup.insert_rows(oc_alloc_recs);
delete wip_move_txn_allocations
where transaction_id in
(select transaction_id
from wip_move_txn_interface
where group_id = mov_group_id);
delete wip_move_txn_interface
where group_id = mov_group_id;
delete wip_cost_txn_interface
where group_id = res_group_id;
delete mtl_serial_numbers
where group_mark_id = mtl_header_id
and current_status = 6;
update mtl_serial_numbers
set group_mark_id = null,
line_mark_id = null,
lot_line_mark_id = null
where group_mark_id = mtl_header_id;
delete mtl_serial_numbers_temp
where group_header_id = mtl_header_id;
delete mtl_transaction_lots_temp
where group_header_id = mtl_header_id;
delete mtl_material_transactions_temp
where transaction_header_id = mtl_header_id;
select count(*)
into ccount
from mtl_material_transactions_temp
where transaction_header_id = mtl_hdr_id;
delete mtl_transaction_lots_temp
where transaction_temp_id in
(select transaction_temp_id
from mtl_material_transactions_temp
where transaction_header_id=txn_hdr_id
and transaction_mode=1);
delete mtl_serial_numbers_temp where
transaction_temp_id in
(select transaction_temp_id
from mtl_material_transactions_temp
where transaction_header_id=txn_hdr_id
and transaction_mode=1);
delete mtl_material_transactions_temp
where transaction_header_id=txn_hdr_id
and transaction_mode=1;
select count(*)
into completion_count1
from mtl_transactions_interface
where transaction_header_id = txn_hdr_id
and transaction_type_id in (l_bind1, l_bind2, l_bind3, l_bind4) ;
select count(*)
into completion_count2
from mtl_transactions_interface
where transaction_header_id = txn_hdr_id
and transaction_type_id in (l_bind1, l_bind2, l_bind3, l_bind4) ;
delete from mtl_transaction_lots_interface
where transaction_interface_id in
( select transaction_interface_id from
mtl_transactions_interface
where transaction_header_id = txn_hdr_id
and transaction_type_id in (35, 43, 38, 48)
) ;
delete from mtl_serial_numbers_interface
where transaction_interface_id in
( select transaction_interface_id from
mtl_transactions_interface
where transaction_header_id = txn_hdr_id
and transaction_type_id in (35, 43, 38, 48)
) ;
delete from mtl_transactions_interface
where transaction_header_id = txn_hdr_id
and transaction_type_id in (35, 43, 38, 48) ;