The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT subinventory_code
FROM mtl_item_sub_defaults
WHERE inventory_item_id = l_inventory_item_id
AND organization_id = l_organization_id
AND default_type = 3; -- default transfer order sub
SELECT status_id
FROM mtl_secondary_inventories
WHERE secondary_inventory_name = l_putaway_sub
AND organization_id = l_organization_id ;
SELECT locator_type
FROM mtl_secondary_inventories
WHERE secondary_inventory_name = l_putaway_sub
AND organization_id = l_organization_id ;
SELECT status_id
FROM mtl_item_locations
WHERE inventory_location_id = l_putaway_loc
AND organization_id = l_organization_id ;
SELECT locator_id
FROM mtl_item_loc_defaults mtld,
mtl_item_locations mil
WHERE mtld.locator_id = mil.inventory_location_id
AND mtld.organization_id = mil.organization_id
AND mtld.inventory_item_id = l_inventory_item_id
AND mtld.organization_id = l_organization_id
AND mtld.subinventory_code = l_putaway_sub
AND mtld.default_type = 3
AND nvl(mil.disable_date,sysdate + 1) > sysdate;
SELECT primary_cost_method
,default_cost_group_id
FROM mtl_parameters mp
WHERE mp.organization_id = p_organization_id;
SELECT default_cost_group_id
FROM mtl_secondary_inventories msi
WHERE msi.secondary_inventory_name = l_putaway_sub
AND msi.organization_id = p_organization_id;
' SELECT inventory_location_id ' || g_line_feed ||
' FROM mtl_item_locations ' || g_line_feed ||
' WHERE inventory_location_id = base.locator_id'|| g_line_feed ||
' AND organization_id = base.organization_id' || g_line_feed ||
' AND project_id IS NULL ' || g_line_feed ||
' AND task_id IS NULL)))) ';
' SELECT inventory_location_id ' || g_line_feed ||
' FROM mtl_item_locations ' || g_line_feed ||
' WHERE inventory_location_id = base.locator_id ' || g_line_feed ||
' AND organization_id = base.organization_id ' || g_line_feed ||
' AND nvl(project_id,' || l_identifier || ') = ' || g_line_feed ||
l_identifier || g_line_feed ||
' AND task_id IS NULL))) ';
' SELECT inventory_location_id ' || g_line_feed ||
' FROM mtl_item_locations ' || g_line_feed ||
' WHERE inventory_location_id = base.locator_id ' || g_line_feed ||
' AND organization_id = base.organization_id ' || g_line_feed ||
' AND ((project_id = ' || g_line_feed ||
l_identifier || g_line_feed ||
' AND task_id = ' || g_line_feed ||
l_id2 || g_line_feed ||
') OR (project_id IS NULL ' || g_line_feed ||
' AND task_id IS NUL))' || g_line_feed ||
'))) ';
' SELECT inventory_location_id ' || g_line_feed ||
' FROM mtl_item_locations ' || g_line_feed ||
' WHERE inventory_location_id = base.locator_id ' || g_line_feed ||
' AND organization_id = base.organization_id ' || g_line_feed ||
' AND project_id = ' || g_line_feed ||
l_identifier || g_line_feed ||
' AND task_id IS NULL))) ';
' SELECT inventory_location_id ' || g_line_feed ||
' FROM mtl_item_locations ' || g_line_feed ||
' WHERE inventory_location_id = base.locator_id ' || g_line_feed ||
' AND organization_id = base.organization_id ' || g_line_feed ||
' AND project_id = ' || g_line_feed ||
l_identifier || g_line_feed ||
' AND task_id = ' || g_line_feed ||
l_id2 || g_line_feed ||
'))) ';
l_sub_select VARCHAR2(3000);
l_loc_select VARCHAR2(3000);
SELECT
revision_rule
,lot_rule
,subinventory_rule
,locator_rule
FROM mtl_picking_rules
WHERE picking_rule_id = p_rule_id ;
select project_reference_enabled
into l_pjm_org
from mtl_parameters
where organization_id = p_request_line_rec.organization_id;
l_sub_select := ' ,msi.picking_order';
l_loc_select := ' , mil.picking_order';
' SELECT base.revision
,base.lot_number
,base.lot_expiration_date
,base.subinventory_code
,base.locator_id
,base.cost_group_id '
|| g_line_feed || ', base.date_received '
|| g_line_feed || ', base.primary_quantity'
|| g_line_feed || l_sub_select || l_loc_select
|| g_line_feed || ' FROM ('||g_stmt||') base '
|| g_line_feed || l_from ;
l_qty_to_update NUMBER;
SELECT *
FROM MTL_SECONDARY_INVENTORIES
WHERE secondary_inventory_name = l_from_subinventory
AND organization_id = p_request_line_rec.organization_id;
SELECT *
FROM MTL_SECONDARY_INVENTORIES
WHERE secondary_inventory_name = l_to_subinventory
AND organization_id = p_request_line_rec.organization_id;
SELECT *
FROM MTL_PARAMETERS
WHERE organization_id = p_request_line_rec.organization_id;
SELECT *
FROM MTL_SYSTEM_ITEMS
WHERE inventory_item_id = p_request_line_rec.inventory_item_id
AND organization_id = p_request_line_rec.organization_id;
SELECT move_order_type
FROM mtl_txn_request_headers
WHERE header_id = p_request_line_rec.header_id;
l_qty_to_update := l_qty_to_detail;
l_qty_to_update := l_att_om_indivisible;
l_qty_to_update := l_att;
l_required_sl_qty := l_qty_to_update;
, x_available_sl_qty => l_qty_to_update
, x_serial_index => l_serial_index
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
, p_demand_source_type_id => p_request_line_rec.transaction_source_type_id
, p_demand_source_header_id => p_request_line_rec.transaction_header_id
, p_demand_source_line_id => p_request_line_rec.txn_source_line_id );
IF l_qty_to_update > 0 THEN
inv_quantity_tree_pvt.update_quantities
(
p_api_version_number => 1
,p_init_msg_lst => fnd_api.g_false
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,p_tree_id => p_tree_id
,p_revision => l_revision
,p_lot_number => l_lot_number
,p_subinventory_code => l_from_subinventory
,p_locator_id => l_from_locator_id
,p_primary_quantity => l_qty_to_update
,p_quantity_type => inv_quantity_tree_pvt.g_qs_txn
,x_qoh => l_qoh
,x_rqoh => l_rqoh
,x_qr => l_qr
,x_qs => l_qs
,x_att => l_att
,x_atr => l_atr
,p_cost_group_id => l_from_cost_group_id
) ;
FOR l_loop_index IN 1..l_qty_to_update LOOP
l_serial_number :=
inv_detail_util_pvt.g_output_serial_rows
(l_loop_index+l_serial_index-1).serial_number;
l_output_process_rec.primary_quantity := l_qty_to_update;
l_qty_to_update,
p_request_context.primary_uom_code,
p_request_context.transaction_uom_code,
NULL,
NULL);
-- update the quantity remained to detail
l_qty_to_detail := l_qty_to_detail - l_qty_to_update;
END IF; -- (l_qty_to_update > 0) --