The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT
CONCATENATED_SEGMENTS
INTO P_ITEM_NAME
FROM
MTL_SYSTEM_ITEMS_KFV
WHERE INVENTORY_ITEM_ID = P_ITEM
AND CUSTOMER_ORDER_ENABLED_FLAG = 'Y'
AND BOM_ITEM_TYPE in ( 1 , 4 )
AND ORGANIZATION_ID = OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID');
SELECT
SOB.NAME,
SOB.CURRENCY_CODE
INTO L_COMPANY_NAME,L_FUNCTIONAL_CURRENCY
FROM
GL_SETS_OF_BOOKS SOB,
FND_CURRENCIES CUR
WHERE SOB.SET_OF_BOOKS_ID = P_SOB_ID
AND SOB.CURRENCY_CODE = CUR.CURRENCY_CODE;
SELECT
CP.USER_CONCURRENT_PROGRAM_NAME
INTO L_REPORT_NAME
FROM
FND_CONCURRENT_PROGRAMS_VL CP,
FND_CONCURRENT_REQUESTS CR
WHERE CR.REQUEST_ID = P_CONC_REQUEST_ID
AND CP.APPLICATION_ID = CR.PROGRAM_APPLICATION_ID
AND CP.CONCURRENT_PROGRAM_ID = CR.CONCURRENT_PROGRAM_ID;
SELECT
MEANING
INTO L_MEANING
FROM
OE_LOOKUPS
WHERE LOOKUP_TYPE = 'ITEM_DISPLAY_CODE'
AND LOOKUP_CODE = SUBSTR(UPPER(P_PRINT_DESCRIPTION)
,1
,1);
SELECT
MEANING
INTO L_MEANING
FROM
OE_LOOKUPS
WHERE LOOKUP_TYPE = 'YES_NO'
AND LOOKUP_CODE = SUBSTR(UPPER(P_OPEN_RETURNS_ONLY)
,1
,1);
SELECT
OEOT.NAME
INTO L_ORDER_TYPE
FROM
OE_TRANSACTION_TYPES_TL OEOT
WHERE OEOT.TRANSACTION_TYPE_ID = P_RETURN_TYPE
AND OEOT.LANGUAGE = USERENV('LANG');
SELECT
USERENV('LANG')
INTO P_LANG
FROM
DUAL;
SELECT
OEOT.NAME
INTO L_LINE_TYPE
FROM
OE_TRANSACTION_TYPES_TL OEOT
WHERE OEOT.TRANSACTION_TYPE_ID = P_RETURN_LINE_TYPE
AND OEOT.LANGUAGE = USERENV('LANG');
SELECT
SUBSTR(MEANING
,1
,50)
INTO SORT_BY_MEANING
FROM
OE_LOOKUPS
WHERE LOOKUP_TYPE = 'OEXOEORD ORDER BY'
AND LOOKUP_CODE = P_ORDER_BY;
SELECT
SUBSTR(MEANING
,1
,50)
INTO SORT_BY_MEANING
FROM
OE_LOOKUPS
WHERE LOOKUP_TYPE = 'OEXOEORD ORDER BY'
AND LOOKUP_CODE = 'RETURN_NUMBER';
SELECT
SUBSTR(MEANING
,1
,5)
INTO CREDIT_ONLY_MEANING
FROM
FND_LOOKUPS
WHERE LOOKUP_TYPE = 'YES_NO'
AND LOOKUP_CODE = SUBSTR(UPPER(P_CREDIT_ONLY)
,1
,1);
SELECT
TRX.TRX_NUMBER
INTO REF_NUMBER
FROM
RA_CUSTOMER_TRX TRX,
RA_CUSTOMER_TRX_LINES_ALL TRXL
WHERE TRXL.CUSTOMER_TRX_LINE_ID = REF_ID
AND TRXL.CUSTOMER_TRX_ID = TRX.CUSTOMER_TRX_ID;
SELECT
L2.RETURN_ATTRIBUTE2
INTO REF_NUMBER
FROM
OE_ORDER_LINES_ALL L2
WHERE L2.LINE_ID = LINE_ID;
SELECT
OH2.ORDER_NUMBER
INTO REF_NUMBER
FROM
OE_ORDER_HEADERS OH2
WHERE OH2.HEADER_ID = REF_ID;
SELECT
OH2.CUST_PO_NUMBER
INTO REF_NUMBER
FROM
OE_ORDER_HEADERS OH2
WHERE OH2.HEADER_ID = REF_ID;
select sitems.concatenated_segments item,
sitems.description description
into v_item,v_description
from mtl_system_items_vl sitems
-- where sitems.customer_order_enabled_flag = 'Y'
-- and sitems.bom_item_type in (1,4)
where nvl(sitems.organization_id,0) = NVL(OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID',MO_GLOBAL.GET_CURRENT_ORG_ID),0)
and sitems.inventory_item_id = inventory_item_id1;
select citems.customer_item_number item,
nvl(citems.customer_item_desc,sitems.description) description
into v_item,v_description
from mtl_customer_items citems,
mtl_customer_item_xrefs cxref,
mtl_system_items_vl sitems
where citems.customer_item_id = cxref.customer_item_id
and cxref.inventory_item_id = sitems.inventory_item_id
and citems.customer_item_id = ordered_item_id
and nvl(sitems.organization_id,0) = NVL(OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID',MO_GLOBAL.GET_CURRENT_ORG_ID),0)
and sitems.inventory_item_id = inventory_item_id1;
select items.cross_reference item,
nvl(items.description,sitems.description) description
into v_item,v_description
from mtl_cross_reference_types xtypes,
mtl_cross_references items,
mtl_system_items_vl sitems
where xtypes.cross_reference_type = items.cross_reference_type
and items.inventory_item_id = sitems.inventory_item_id
and items.cross_reference = ordered_item
and items.cross_reference_type = item_identifier_type
and nvl(sitems.organization_id,0) = NVL(OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID',MO_GLOBAL.GET_CURRENT_ORG_ID),0)
and sitems.inventory_item_id = inventory_item_id1
--Bug 3433353 Start
and items.org_independent_flag = 'N'
and items.organization_id = NVL(OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID',MO_GLOBAL.GET_CURRENT_ORG_ID),0);
Select items.cross_reference item,
nvl(items.description,sitems.description) description into
v_item,v_description
from mtl_cross_reference_types xtypes,
mtl_cross_references items,
mtl_system_items_vl sitems
where xtypes.cross_reference_type =
items.cross_reference_type
and items.inventory_item_id =
sitems.inventory_item_id
and items.cross_reference = ordered_item
and items.cross_reference_type = item_identifier_type
and nvl(sitems.organization_id,0) = NVL(OE_SYS_PARAMETERS.VALUE('MASTER_ORGANIZATION_ID',MO_GLOBAL.GET_CURRENT_ORG_ID),0)
and sitems.inventory_item_id = inventory_item_id1
and items.org_independent_flag = 'Y';