The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
NVL(common_assembly_item_id,assembly_item_id),
NVL(common_organization_id ,organization_id)
INTO
l_item,l_org
from
bom_bill_of_materials
where
assembly_item_id = l_item_temp and
organization_id = l_org_master and
alternate_bom_designator IS NULL;
x_custom_sql :=' SELECT NULL AS VIEWBY,
1 AS ENI_MEASURE1,
2 AS ENI_MEASURE2,
3 AS ENI_MEASURE2,
4 AS ENI_MEASURE4,
6 AS ENI_MEASURE5 FROM DUAL where 1 = 2';
SELECT DESCRIPTION
INTO
l_unassigned_desc
FROM
FND_LOOKUP_VALUES
WHERE
LOOKUP_TYPE = 'ITEM' AND LOOKUP_CODE = '-1'
AND LANGUAGE = USERENV( 'LANG' );
SELECT
item_name AS ENI_MEASURE1
, DECODE(
item_id
, -1, :UNASSIGNED_DESC
, MTI_TL.DESCRIPTION )
AS ENI_MEASURE2
, revision AS ENI_MEASURE3
, status_code AS ENI_MEASURE4
, ' || l_drill_to_item_page || '
AS ENI_MEASURE5
FROM
( SELECT
( rank() over ( &ORDER_BY_CLAUSE nulls last, pco.rowid ) - 1 ) AS rnk,
star.value AS item_name,
pco.component_item_id AS item_id,
pco.organization_id AS org_id,
star.organization_id AS base_org,
NVL((select mir.revision from MTL_ITEM_REVISIONS_B mir
where mir.inventory_item_id = pco.component_item_id
and mir.organization_id = :ORG_MASTER
and mir.effectivity_date =
(select max(mir1.effectivity_date) from MTL_ITEM_REVISIONS_B mir1
where mir1.inventory_item_id = pco.component_item_id
and mir1.organization_id = :ORG_MASTER
and mir1.implementation_date IS NOT NULL
and trunc(mir1.effectivity_date) <= &BIS_CURRENT_ASOF_DATE )), -1) revision,
(select msi.inventory_item_status_code from MTL_SYSTEM_ITEMS_B msi
where inventory_item_id = pco.component_item_id
and organization_id = :ORG_MASTER ) status_code
FROM
ENI_DBI_PART_COUNT_F pco
, ( select value as ENI_MEASURE1, value, organization_id, inventory_item_id, item_catalog_group_id
FROM ENI_OLTP_ITEM_STAR ) star
WHERE
(&BIS_CURRENT_ASOF_DATE BETWEEN
pco.effectivity_date AND pco.disable_date)
' || l_item_where || l_cat_where || '
) pcofact
, MTL_SYSTEM_ITEMS_TL MTI_TL
WHERE
( ( pcofact.rnk between &START_INDEX and &END_INDEX ) OR (&END_INDEX = -1) )
and pcofact.base_org = MTI_TL.ORGANIZATION_ID(+)
and pcofact.item_id = MTI_TL.INVENTORY_ITEM_ID(+)
and MTI_TL.LANGUAGE(+) = USERENV( ''LANG'' )
&ORDER_BY_CLAUSE NULLS LAST' ;