The following lines contain the word 'select', 'insert', 'update' or 'delete':
select control_level
into l_control_level
from mtl_item_attributes
where attribute_name = attr_name;
select count(1)
into l_org_count
from mtl_cycle_count_entries
where inventory_item_id = p_item_id and
organization_id = p_org_id and
entry_status_code = 2 and
rownum = 1;
select count(1)
into l_org_count
from mtl_physical_adjustments
where inventory_item_id = p_item_id
and organization_id = p_org_id
and approval_status = 1
and adjustment_quantity <> 0
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1)
into l_master_count
from mtl_cycle_count_entries
where inventory_item_id = p_item_id and
(organization_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org
)
)
and entry_status_code = 2
and rownum = 1;
select count(1)
into l_master_count
from mtl_physical_adjustments
where inventory_item_id = p_item_id
and (organization_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org
)
)
and approval_status = 1
and adjustment_quantity <> 0
and rownum = 1;
select count(1) into l_org_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and released_status = 'S'
and source_code = 'OE'
and organization_id = p_org_id
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1) into l_master_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and released_status = 'S'
and source_code = 'OE'
and organization_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
and rownum = 1;
select count(1) into l_org_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and released_status = 'Y'
and source_code = 'OE'
and organization_id = p_org_id
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1) into l_master_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and released_status = 'Y'
and source_code = 'OE'
and organization_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
and rownum = 1;
select count(1) into l_org_count
from oe_order_lines_all l,
wsh_delivery_details wdd
where l.inventory_item_id = p_item_id
and nvl(l.open_flag,'Y') = 'Y'
and wdd.released_status not in ('C','D')
and wdd.pickable_flag = 'N'
--and wdd.source_code = 'OE'
and l.line_id = wdd.source_line_id
and l.ship_from_org_id = p_org_id
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1) into l_master_count
from oe_order_lines_all l,
wsh_delivery_details wdd
where l.inventory_item_id = p_item_id
and nvl(l.open_flag,'Y') = 'Y'
and wdd.released_status not in ('C','D')
and wdd.pickable_flag = 'N'
--and wdd.source_code = 'OE'
and l.line_id = wdd.source_line_id
and l.ship_from_org_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
and rownum = 1;
select count(1) into l_org_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and pickable_flag = 'Y'
--Bug 4643978 - Perf fix
and inv_interfaced_flag IN ('N','P')
--and source_code = 'OE'
and released_status <> 'D'
and organization_id = p_org_id
and rownum = 1;
select count(1) into l_org_count
from oe_order_lines_all
where source_type_code = 'EXTERNAL'
and open_flag = 'Y'
and nvl(shipped_quantity,0) = 0
and item_type_code in ('MODEL','STANDARD','OPTION')
and FLOW_STATUS_CODE = 'AWAITING_RECEIPT'
and inventory_item_id = p_item_id
and ship_from_org_id = p_org_id
and rownum = 1;
select count(1) into l_org_count
from oe_order_lines_all l
where booked_flag = 'Y'
and nvl(shipped_quantity,0) = 0
and inventory_item_id = p_item_id
and open_flag = 'Y'
and ship_from_org_id = p_org_id
and exists (select 1
from mtl_transactions_interface
where trx_source_line_id = l.line_id
and transaction_source_type_id in (2,8)
and source_code = 'ORDER ENTRY')
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
for i in (select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
loop
select count(1) into l_master_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and pickable_flag = 'Y'
--Bug 4643978 - Perf fix
and inv_interfaced_flag IN ('N','P')
--and source_code = 'OE'
and released_status <> 'D'
and organization_id = i.organization_id
and rownum = 1;
for i in (select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
loop
select count(1) into l_org_count
from oe_order_lines_all
where source_type_code = 'EXTERNAL'
and open_flag = 'Y'
and nvl(shipped_quantity,0) = 0
and item_type_code in ('MODEL','STANDARD','OPTION')
and FLOW_STATUS_CODE = 'AWAITING_RECEIPT'
and inventory_item_id = p_item_id
and ship_from_org_id = i.organization_id
and rownum = 1;
for i in (select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
loop
select count(1) into l_org_count
from oe_order_lines_all l
where booked_flag = 'Y'
and nvl(shipped_quantity,0) = 0
and inventory_item_id = p_item_id
and open_flag = 'Y'
and ship_from_org_id = i.organization_id
and exists (select 1
from mtl_transactions_interface
where trx_source_line_id = l.line_id
and transaction_source_type_id in (2,8)
and source_code = 'ORDER ENTRY')
and rownum = 1;
select count(1) into l_org_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and oe_interfaced_flag = 'Y'
and nvl(inv_interfaced_flag,'N') not in ('Y','X')
and released_status = 'C'
and source_code = 'OE'
and organization_id = p_org_id
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1)
into l_master_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and oe_interfaced_flag = 'Y'
and nvl(inv_interfaced_flag,'N') not in ('Y','X')
and released_status = 'C'
and source_code = 'OE'
and organization_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
and rownum = 1;
select count(1)
into l_org_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and released_status not in ('B','R','D')
and nvl(inv_interfaced_flag,'N') not in ('Y','X')
and pickable_flag = 'Y'
and source_code = 'OE'
and organization_id = p_org_id
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1)
into l_master_count
from wsh_delivery_details
where inventory_item_id = p_item_id
and released_status not in ('B','R','D')
and nvl(inv_interfaced_flag,'N') not in ('Y','X')
and pickable_flag = 'Y'
and source_code = 'OE'
and organization_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
and rownum = 1;
select count(1) into l_org_count
from oe_order_lines_all
where inventory_item_id = p_item_id
and nvl(open_flag,'Y') = 'Y'
and cancelled_flag = 'N'
and ship_from_org_id = p_org_id
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1) into l_master_count
from oe_order_lines_all
where inventory_item_id = p_item_id
and nvl(open_flag,'Y') = 'Y'
and cancelled_flag = 'N'
and ship_from_org_id in (select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
and rownum = 1;
select count(1) into l_org_count
from oe_order_lines_all
where inventory_item_id = p_item_id
and nvl(open_flag,'Y') = 'Y'
and cancelled_flag = 'N'
and ship_from_org_id = p_org_id
and rownum = 1;
select master_organization_id into l_master_org
from mtl_parameters
where organization_id = p_org_id;
select count(1) into l_master_count
from oe_order_lines_all
where inventory_item_id = p_item_id
and nvl(open_flag,'Y') = 'Y'
and cancelled_flag = 'N'
and ship_from_org_id in
(select organization_id
from mtl_parameters
where master_organization_id = l_master_org)
and rownum = 1;