The following lines contain the word 'select', 'insert', 'update' or 'delete':
select structure_id
into l_p_struct_num
from mtl_default_sets_view
where functional_area_id = 2 ;
select sum(rct.primary_quantity) into ret_qty
from rcv_transactions rct
where rct.transaction_type = 'RETURN TO VENDOR'
and rct.po_line_location_id = parent_line_location_id
UNION
select sum(rct.primary_quantity)
from rcv_transactions rct
where rct.transaction_type = 'RETURN TO VENDOR'
and rct.po_line_location_id = parent_line_location_id
and Item_id is NULL
group by rct.po_line_location_id;
select sum(rct.primary_quantity) into cor_qty
from rcv_transactions rct, rcv_transactions rct1
where rct.transaction_type = 'CORRECT'
and rct.po_line_location_id = parent_line_location_id
and rct.parent_transaction_id = rct1.transaction_id
and rct1.transaction_type = 'RETURN TO VENDOR'
UNION
select sum(rct.primary_quantity)
from rcv_transactions rct, rcv_transactions rct1
where rct.transaction_type = 'CORRECT'
and rct.po_line_location_id = parent_line_location_id
and Item_id is NULL
and rct.parent_transaction_id = rct1.transaction_id
and rct1.transaction_type = 'RETURN TO VENDOR'
group by rct.po_line_location_id;
select sum(rct.primary_quantity) into ins_qty
from rcv_transactions rct
where rct.transaction_type = 'RETURN TO VENDOR'
and nvl(rct.inspection_status_code,'NOT INSPECTED') = 'NOT INSPECTED'
and rct.po_line_location_id = parent_line_location_id
UNION
select sum(rct.primary_quantity)
from rcv_transactions rct
where rct.transaction_type = 'RETURN TO VENDOR'
and nvl(rct.inspection_status_code,'NOT INSPECTED') = 'NOT INSPECTED'
and rct.po_line_location_id = parent_line_location_id
and Item_id is NULL
group by rct.po_line_location_id;
select sum(rct.primary_quantity) into cor_qty
from rcv_transactions rct, rcv_transactions rct1
where rct.transaction_type = 'CORRECT'
and rct.po_line_location_id = parent_line_location_id
and rct.parent_transaction_id = rct1.transaction_id
and rct1.transaction_type = 'RETURN TO VENDOR'
and nvl(rct1.inspection_status_code,'NOT INSPECTED') = 'NOT INSPECTED'
UNION
select sum(rct.primary_quantity)
from rcv_transactions rct, rcv_transactions rct1
where rct.transaction_type = 'CORRECT'
and rct.po_line_location_id = parent_line_location_id
and Item_id is NULL
and rct.parent_transaction_id = rct1.transaction_id
and rct1.transaction_type = 'RETURN TO VENDOR'
and nvl(rct1.inspection_status_code,'NOT INSPECTED') = 'NOT INSPECTED'
group by rct.po_line_location_id;
select sum(rct.primary_quantity) into rec_qty
from rcv_transactions rct
where rct.transaction_type = 'RECEIVE'
and rct.po_line_location_id = parent_line_location_id
UNION
select sum(rct.primary_quantity)
from rcv_transactions rct
where rct.transaction_type = 'RECEIVE'
and rct.po_line_location_id = parent_line_location_id
and Item_id is NULL
group by rct.po_line_location_id;
select sum(rct.primary_quantity) into cor_qty
from rcv_transactions rct, rcv_transactions rct1
where rct.transaction_type = 'CORRECT'
and rct.po_line_location_id = parent_line_location_id
and rct.parent_transaction_id = rct1.transaction_id
and rct1.transaction_type = 'RECEIVE'
UNION
select sum(rct.primary_quantity)
from rcv_transactions rct, rcv_transactions rct1
where rct.transaction_type = 'CORRECT'
and rct.po_line_location_id = parent_line_location_id
and Item_id is NULL
and rct.parent_transaction_id = rct1.transaction_id
and rct1.transaction_type = 'RECEIVE'
group by rct.po_line_location_id;