The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT PROCESS_QUALITY_ENABLED_FLAG
FROM mtl_system_items_b mi
WHERE mi.inventory_item_id = x_item_id
AND mi.organization_id = x_organization_id;
Select process_enabled_flag
Into l_process_org
From mtl_parameters
Where organization_id = x_organization_id;
Select Sum(trans_qty),trans_um
From ic_tran_pnd itp,
rcv_transactions rcv
Where rcv.oe_order_header_id = p_oe_header_id
And (rcv.oe_order_line_id = p_oe_line_id
or
rcv.oe_order_line_id in
(select line_id
from oe_order_lines_all
where header_id = p_oe_header_id
and line_set_id = p_line_set_id
)
)
And rcv.shipment_header_id = itp.doc_id
And rcv.transaction_id = itp.line_id
And itp.doc_type = 'PORC'
And itp.lot_id = p_lot_id
And itp.delete_mark = 0
Group by trans_um;
/*Select ORDER_QUANTITY_UOM
Into l_rma_lot_uom
From oe_order_lines_all
Where header_id = p_oe_header_id
And line_id = p_oe_line_id;
Select decode(length(uom.unit_of_measure), 1, uom.unit_of_measure,
2, uom.unit_of_measure, 3, uom.unit_of_measure,
4, uom.unit_of_measure, uom.uom_code)
Into l_rma_lot_opm_uom
From oe_order_lines_all , mtl_units_of_measure uom
Where header_id = p_oe_header_id
And line_id = p_oe_line_id
And uom_code = ORDER_QUANTITY_UOM;
Select decode(length(uom.unit_of_measure), 1, uom.unit_of_measure,
2, uom.unit_of_measure, 3, uom.unit_of_measure,
4, uom.unit_of_measure, uom.uom_code)
Into l_rma_lot_opm_uom
From mtl_units_of_measure uom
Where uom_code = p_rma_lot_uom;
Select nvl(SUM(QUANTITY),0)
Into l_rma_lot_qty
From oe_lot_Serial_numbers
Where (line_id = p_oe_line_id OR line_set_id = p_line_set_id)
And lot_number = p_lot_no
And nvl(sublot_number,' ') = nvl(p_sublot_no,' ');
Select item_um
Into l_lot_recv_uom
From ic_item_mst
Where item_id = p_opm_item_id;
/* Selecting the shipped quantity for that Lot and Sublot */
Cursor Cr_Io_lot_shipped_qty IS
SELECT ic.trans_um ,sum(ic.trans_qty)*-1
FROM wsh_delivery_details wdd, wsh_delivery_assignments assign,ic_tran_pnd ic,
oe_order_lines_all ol
WHERE ic.lot_id = p_lot_id
and assign.delivery_id = p_order_num
and wdd.delivery_detail_id =assign.delivery_detail_id
and wdd.delivery_detail_id = ic.line_detail_id
and wdd.source_header_id = ol.header_id
and wdd.source_line_id = ol.line_id
and ol.source_document_id =p_req_header_id
and ol.source_document_line_id = p_req_line_id
and ic.line_id = ol.line_id
and ic.doc_type ='OMSO'
and ic.delete_mark = 0
and ic.completed_ind = 1
group by ic.trans_um;
/* Selecting the quantity received for that Lot and Sublot*/
Cursor Cr_Io_delivered_quantity IS
SELECT ic.trans_um,sum(ic.trans_qty)
FROM ic_tran_pnd ic ,rcv_transactions rcv
WHERE ic.lot_id = p_lot_id and ic.doc_type ='PORC'
and ic.line_id =rcv.transaction_id
and rcv.requisition_line_id = p_req_line_id
and rcv.shipment_header_id = p_shipment_header_id
and rcv.transaction_type in ('DELIVER')
and rcv.shipment_line_id = p_shipment_line_id
and (rcv.req_distribution_id = p_req_distribution_id or rcv.req_distribution_id is null)
group by ic.trans_um ;