The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT fifst.id_flex_num
into p_item_flex_num
FROM fnd_id_flex_structures fifst
WHERE fifst.application_id = 401
AND fifst.id_flex_code = 'MSTK'
AND fifst.enabled_flag = 'Y'
AND fifst.freeze_flex_definition_flag = 'Y'
and rownum<2;
SELECT
OOD.ORGANIZATION_NAME,
SOB.CURRENCY_CODE,
FC.EXTENDED_PRECISION,
FC.PRECISION,
RPT_SORT_OPT.MEANING,
RPT_RUN_OPT.MEANING,
CLS_TYPE.MEANING
INTO ORG_NAME,CURRENCY_CODE,EXT_PRECISION,PRECISION,REPORT_SORT,REPORT_OPTION,CLASS_TYPE_NAME
FROM
FND_CURRENCIES FC,
GL_SETS_OF_BOOKS SOB,
ORG_ORGANIZATION_DEFINITIONS OOD,
MFG_LOOKUPS RPT_SORT_OPT,
MFG_LOOKUPS RPT_RUN_OPT,
MFG_LOOKUPS CLS_TYPE
WHERE OOD.ORGANIZATION_ID = ORG_ID
AND OOD.SET_OF_BOOKS_ID = SOB.SET_OF_BOOKS_ID
AND SOB.CURRENCY_CODE = FC.CURRENCY_CODE
AND FC.ENABLED_FLAG = 'Y'
AND RPT_SORT_OPT.LOOKUP_TYPE = 'CST_WIP_REPORT_SORT'
AND RPT_SORT_OPT.LOOKUP_CODE = REPORT_SORT_OPT
AND CLS_TYPE.LOOKUP_TYPE = 'WIP_CLASS_TYPE'
AND CLS_TYPE.LOOKUP_CODE = 4
AND RPT_RUN_OPT.LOOKUP_TYPE = 'CST_BICR_DETAIL_OPTION'
AND RPT_RUN_OPT.LOOKUP_CODE = REPORT_RUN_OPT;
SELECT
STS_TYPE.MEANING
INTO STATUS_TYPE_NAME
FROM
MFG_LOOKUPS STS_TYPE
WHERE STS_TYPE.LOOKUP_TYPE = 'WIP_JOB_STATUS'
AND STS_TYPE.LOOKUP_CODE = STATUS_TYPE;
P_SUBSELECT := 'and (:SUBMITTED_BY = ''SRS''
and exists
(select ''x''
from wip_period_balances wpb
where wpb.wip_entity_id = wp.wip_entity_id
and wpb.organization_id = wp.organization_id
and wpb.acct_period_id IN
(select oap.acct_period_id
from org_acct_periods oap
where trunc(oap.period_start_date) >= :PER_START_DATE
and trunc(oap.schedule_close_date) <= :PER_SCHD_CLS_DATE
and oap.organization_id = wp.organization_id))
) ';
P_SUBSELECT := 'and (:SUBMITTED_BY = ''PLS'' and
wp.wip_entity_id in
(select wip_entity_id
from wip_dj_close_temp
where group_id = :GROUP_ID)
)
';