The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_update_flag BOOLEAN := FALSE;
l_dense_select VARCHAR2(2000);
l_wdd_update_flag WSH_UTIL_CORE.Column_Tab_Type;
SELECT distributed_organization_flag
FROM mtl_parameters
WHERE organization_id = p_organization_id;
l_order_query := ' select to_char(order_number) from oe_order_headers_all where order_number ';
l_dyn_query := 'SELECT wdd.rowid, ';
select source_header_id
into l_src_header_id
from wsh_delivery_details
where rowid = l_rowid_tbl(i)
for update nowait;
l_wdd_update_flag(i) := 'Y';
IF NOT l_update_flag THEN
l_update_flag := TRUE;
l_wdd_update_flag(i) := 'N';
l_wdd_update_flag(i) := 'N';
SELECT Wsh_Shipment_Batches_S.nextval
INTO l_batch_id
FROM DUAL;
INSERT INTO Wsh_Shipment_Batches (
batch_id,
name,
org_id,
currency_code,
customer_id,
organization_id,
ship_from_location_id,
ship_to_site_use_id,
invoice_to_site_use_id,
deliver_to_site_use_id,
ship_to_contact_id,
invoice_to_contact_id,
deliver_to_contact_id,
ship_method_code,
freight_terms_code,
fob_code,
pending_request_flag,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
request_id,
program_application_id,
program_id,
program_update_date )
VALUES (
l_batch_id,
to_char(l_batch_id),
l_shipment_batch_tbl(l_cnt).org_id,
l_shipment_batch_tbl(l_cnt).currency_code,
l_shipment_batch_tbl(l_cnt).customer_id,
l_shipment_batch_tbl(l_cnt).organization_id,
l_shipment_batch_tbl(l_cnt).ship_from_location_id,
l_shipment_batch_tbl(l_cnt).ship_to_site_use_id,
l_shipment_batch_tbl(l_cnt).invoice_to_site_use_id,
l_shipment_batch_tbl(l_cnt).deliver_to_site_use_id,
l_shipment_batch_tbl(l_cnt).ship_to_contact_id,
l_shipment_batch_tbl(l_cnt).invoice_to_contact_id,
l_shipment_batch_tbl(l_cnt).deliver_to_contact_id,
l_shipment_batch_tbl(l_cnt).ship_method_code,
l_shipment_batch_tbl(l_cnt).freight_terms_code,
l_shipment_batch_tbl(l_cnt).fob_code,
'Y',
SYSDATE,
FND_GLOBAL.user_id,
SYSDATE,
FND_GLOBAL.user_id,
FND_GLOBAL.Login_Id,
FND_GLOBAL.Conc_Request_Id,
FND_GLOBAL.Prog_Appl_Id,
FND_GLOBAL.Conc_Program_Id,
SYSDATE );
IF l_update_flag THEN
FORALL i in l_rowid_tbl.first..l_rowid_tbl.last
update wsh_delivery_details
set shipment_batch_id = l_dd_batch_id_tbl(i),
shipment_line_number = l_dd_line_num_tbl(i),
reference_line_id = l_src_line_id_tbl(i),
last_update_date = SYSDATE,
last_updated_by = FND_GLOBAL.User_Id,
last_update_login = FND_GLOBAL.Login_Id,
request_id = FND_GLOBAL.Conc_Request_Id,
program_application_id = FND_GLOBAL.Prog_Appl_Id,
program_id = FND_GLOBAL.Conc_Program_Id,
program_update_date = SYSDATE
where rowid = l_rowid_tbl(i)
and l_wdd_update_flag(i) = 'Y';
WSH_DEBUG_SV.log(l_module_name, 'No. of delivery details updated', l_upd_count);
SELECT to_char(WSH_DOCUMENT_NUMBER_S.nextval) INTO l_txns_history_rec.document_number FROM dual;
l_rowid_tbl.delete;
l_del_detail_tbl.delete;
l_src_line_id_tbl.delete;
l_org_id_tbl.delete;
l_customer_id_tbl.delete;
l_organization_id_tbl.delete;
l_ship_from_loc_tbl.delete;
l_ship_to_site_tbl.delete;
l_invoice_to_site_tbl.delete;
l_deliver_to_site_tbl.delete;
l_ship_to_con_tbl.delete;
l_invoice_to_con_tbl.delete;
l_deliver_to_con_tbl.delete;
l_ship_method_tbl.delete;
l_freight_terms_tbl.delete;
l_fob_code_tbl.delete;
l_group_id_tbl.delete;
l_shipment_batch_tbl.delete;
l_dd_line_num_tbl.delete;
l_wdd_update_flag.delete;
l_dd_batch_id_tbl.delete;
l_raise_batch_tbl.delete; --Fulfillment Batch XML Project
select src_requested_quantity,
requested_quantity,
delivery_detail_id
from wsh_delivery_details wdd,
wsh_transactions_history wth,
wsh_shipment_batches wsb
where source_code = 'OE'
and released_status in ( 'R', 'B', 'X' )
and wdd.shipment_batch_id = wsb.batch_id
and wsb.name = entity_number
and shipment_line_number = p_line_number
and entity_type = 'BATCH'
and document_direction = 'O'
and document_type = 'SR'
and document_number = p_document_number
order by requested_quantity desc
for update nowait;
update wsh_delivery_details
set shipment_batch_id = null,
shipment_line_number = null,
reference_line_id = null,
last_update_date = SYSDATE,
last_updated_by = FND_GLOBAL.User_Id,
last_update_login = FND_GLOBAL.Login_Id,
request_id = FND_GLOBAL.Conc_Request_Id,
program_application_id = FND_GLOBAL.Prog_Appl_Id,
program_id = FND_GLOBAL.Conc_Program_Id,
program_update_date = SYSDATE
where delivery_detail_id = l_unassign_detail_tab(i);