The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT lot_control_code,
child_lot_flag
FROM mtl_system_items
WHERE inventory_item_id = p_inventory_item_id
AND organization_id = p_organization_id;
SELECT copy_lot_attribute_flag,
lot_number_generation
FROM mtl_parameters
WHERE organization_id = cp_organization_id;
SELECT lot_number
FROM mtl_lot_numbers
WHERE lot_number = cp_lot_number AND
inventory_item_id = cp_inventory_item_id AND
organization_id = cp_organization_id ;
SELECT *
FROM mtl_lot_numbers
WHERE lot_number = cp_lot_number ;
SELECT copy_lot_attribute_flag INTO l_copy_lot_attribute_flag
FROM mtl_system_items
WHERE inventory_item_id = p_lot_rec.inventory_item_id
AND organization_id = p_lot_rec.organization_id;
SELECT grade_control_flag
, default_grade
, shelf_life_code
, shelf_life_days
, expiration_action_code
, expiration_action_interval
, retest_interval
, maturity_days
, hold_days
, default_lot_status_id --bug10257769
FROM mtl_system_items_b
WHERE organization_id = cp_organization_id
AND inventory_item_id = cp_inventory_item_id;
SELECT grade_code
, expiration_date
, expiration_action_code
, expiration_action_date
, origination_date
, origination_type
, retest_date
, maturity_date
, hold_date
FROM mtl_lot_numbers
WHERE organization_id = cp_organization_id
AND inventory_item_id = cp_inventory_item_id
AND lot_number = cp_lot_number;
SELECT * FROM mtl_transactions_interface
WHERE transaction_interface_id = c_mti_hdr_id;
SELECT * FROM mtl_transaction_lots_interface
WHERE ROWID = c_mtli_hdr_id;
SELECT * FROM mtl_material_transactions_temp
WHERE transaction_header_id = c_mmtt_hdr_id;
SELECT * FROM mtl_transaction_lots_temp
WHERE ROWID = c_mtlt_hdr_id;
select nvl(allow_different_status,2)
into l_allow_different_status
from mtl_parameters
where organization_id = p_lot_rec.organization_id;
SELECT shelf_life_days
, shelf_life_code
INTO l_shelf_life_days
, l_shelf_life_code
FROM mtl_system_items
WHERE inventory_item_id = p_inventory_item_id
AND organization_id = p_organization_id;
SELECT SYSDATE + l_shelf_life_days
INTO l_expiration_date
FROM DUAL;
SELECT lot_status_enabled , default_lot_status_id
INTO l_lot_status_flag , l_def_lot_status
FROM mtl_system_items
WHERE organization_id = p_organization_id
AND inventory_item_id = p_inventory_item_id ;
x_lot_rec.last_update_date := SYSDATE;
x_lot_rec.last_updated_by := fnd_global.user_id;
SELECT *
FROM mtl_lot_numbers
WHERE lot_number = p_lot_number
AND inventory_item_id = p_inventory_item_id
AND organization_id = p_organization_id;
SELECT *
FROM mtl_system_items
WHERE organization_id = p_organization_id
AND inventory_item_id = p_inventory_item_id ;
PROCEDURE Delete_Lot(
x_return_status OUT NOCOPY VARCHAR2
, x_msg_count OUT NOCOPY NUMBER
, x_msg_data OUT NOCOPY VARCHAR2
, p_inventory_item_id IN NUMBER
, p_organization_id IN NUMBER
, p_lot_number IN VARCHAR2
) IS
CURSOR c_lot_rec IS
SELECT *
FROM mtl_lot_numbers
WHERE inventory_item_id = p_inventory_item_id
AND organization_id = p_organization_id
AND lot_number = p_lot_number ;
SELECT *
FROM mtl_object_genealogy
WHERE object_id = cp_gen_obj_id ;
SELECT *
FROM mtl_lot_uom_class_conversions
WHERE lot_number = p_lot_number ;
SAVEPOINT inv_delete_lot ;
DELETE FROM mtl_lot_numbers
WHERE inventory_item_id = p_inventory_item_id
AND organization_id = p_organization_id
AND lot_number = p_lot_number ;
print_debug('Delete_Lot. After deleting Lot Record', 9);
DELETE FROM mtl_object_genealogy
WHERE object_id = l_gen_obj_id ;
print_debug('Delete_Lot. After deleting Geneology Record', 9);
DELETE FROM mtl_lot_uom_class_conversions
WHERE lot_number = p_lot_number ;
print_debug('Delete_Lot. After deleting UOM Conversion Record', 9);
print_debug('End of the program Delete_Lot. Program has completed successfully ', 9);
ROLLBACK TO inv_delete_lot;
print_debug('In Delete_Lot, No data found ' || SQLERRM, 9);
ROLLBACK TO inv_delete_lot;
print_debug('In Delete_Lot, g_exc_error ' || SQLERRM, 9);
ROLLBACK TO inv_delete_lot;
print_debug('In Delete_Lot, g_exc_unexpected_error ' || SQLERRM, 9);
ROLLBACK TO inv_delete_lot;
print_debug('In Delete_Lot, Others ' || SQLERRM, 9);
END Delete_Lot;
SELECT count('1')
INTO l_exists
FROM mtl_lot_numbers
WHERE inventory_item_id = p_inventory_item_id
AND organization_id = p_org_id
AND lot_number = p_lot_number
AND ROWNUM = 1;