The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT nvl(SUM(decode(quantity,
null,
amount,
(quantity * unit_price)
)
), 0)
into X_req_total
FROM po_requisition_lines_all
WHERE requisition_header_id = p_header_id and
nvl(cancel_flag,'N') <> 'Y' and -- Bug 554452 Ignore cancelled lines
nvl(MODIFIED_BY_AGENT_FLAG, 'N') = 'N' and -- Bug 574676
nvl(CLOSED_CODE, 'OPEN') <> 'FINALLY CLOSED'; -- Bug 574676
SELECT T.TYPE_NAME into L_Type_Name
from PO_DOCUMENT_TYPES_ALL_TL T
WHERE T.LANGUAGE = userenv('LANG')
and T.DOCUMENT_TYPE_CODE = 'RELEASE'
AND T.DOCUMENT_SUBTYPE = X_Sybtype
and T.org_id = X_Org_Id;
SELECT DECODE(VC.LAST_NAME, NULL, NULL, VC.LAST_NAME||', '||VC.FIRST_NAME)
into L_Contact_Name
from PO_VENDOR_CONTACTS VC
where VC.VENDOR_CONTACT_ID = X_Contact_id;
SELECT CONCATENATED_SEGMENTS into L_Item_Number
from mtl_system_items_kfv
where inventory_item_id = X_Item_Id
and organization_id = X_Organization_Id;
SELECT NAME into L_Payment_Term
from AP_TERMS_TL B
WHERE term_id = X_Term_Id
AND LANGUAGE = userenv('LANG');
SELECT full_name into L_Full_Name
from PER_ALL_PEOPLE_F
where person_id = X_Person_Id
AND TRUNC(SYSDATE) BETWEEN EFFECTIVE_START_DATE
AND EFFECTIVE_END_DATE;
SELECT meaning into L_meaning
from OE_LOOKUPS
where Lookup_Code = X_Lookup_Code
and Lookup_Type = X_Lookup_Type;
SELECT DISPLAYED_FIELD into L_Displayed_filed
from po_lookup_codes
where Lookup_Code = X_Lookup_Code
and Lookup_Type = X_Lookup_Type;
SELECT location_code into L_Location_Code
from hr_locations_all_tl
where location_id = X_Location_Id
and language = userenv('LANG');
SELECT VENDOR_SITE_CODE into L_Vendor_Site
from PO_VENDOR_SITES_ALL
where vendor_id = X_Vendor_id
and vendor_site_id = X_Vendor_Site_Id;
SELECT vendor_name into L_Vendor_Name
from po_vendors
where vendor_id = X_Vendor_id;
SELECT T.TYPE_NAME into L_Type_Name
from PO_DOCUMENT_TYPES_ALL_TL T
WHERE T.LANGUAGE = userenv('LANG')
and T.DOCUMENT_TYPE_CODE IN ('PO', 'PA')
AND T.DOCUMENT_SUBTYPE = 'STANDARD'
and T.org_id = X_Org_Id;
SELECT SUM( decode(line_category_code,'RETURN',
(-1)*(NVL(ordered_quantity,0)-NVL(cancelled_quantity,0)),
(NVL(ordered_quantity,0)-NVL(cancelled_quantity,0))
)
* NVL(unit_selling_price , 0) )
INTO L_Order_Total
FROM oe_order_lines_all
WHERE header_id = X_Header_ID
AND project_id = NVL(x_project_id, project_id)
AND (task_id IS NULL OR task_id = NVL(x_task_id, task_id)) --Bug 13455756: still need to return value even if task_id column is null
AND line_id = x_line_id;
SELECT decode(loc.city , null , null , loc.city || ', ')
|| decode(loc.postal_code , null , null , loc.postal_code || ', ')
|| decode(loc.country , null , null , loc.country)
INTO L_Org_Address
FROM hz_cust_site_uses_all site
, hz_locations loc
, hz_party_sites party_site
, hz_cust_acct_sites_all acct_site
WHERE site.site_use_id = X_Org_ID
AND site.cust_acct_site_id = acct_site.cust_acct_site_id
AND acct_site.party_site_id = party_site.party_site_id
AND party_site.location_id = loc.location_id
AND nvl(site.org_id, -99 ) = nvl( acct_site.org_id, -99 );
SELECT decode(loc.city , null , null , loc.city || ', ')
|| decode(loc.postal_code , null , null , loc.postal_code || ', ')
|| decode(loc.country , null , null , loc.country)
INTO L_Org_Address
FROM hz_cust_site_uses_all site
, hz_locations loc
, hz_party_sites party_site
, hz_cust_acct_sites_all acct_site
WHERE site.site_use_id = X_Org_ID
AND site.cust_acct_site_id = acct_site.cust_acct_site_id
AND acct_site.party_site_id = party_site.party_site_id
AND party_site.location_id = loc.location_id
AND nvl(site.org_id, -99 ) = nvl( acct_site.org_id, -99 );
SELECT meaning
FROM fnd_lookups
WHERE lookup_type = 'YES_NO'
AND lookup_code = X_Lookup_Code;
SELECT meaning
FROM mfg_lookups
WHERE lookup_type = 'SYS_YES_NO'
AND lookup_code = X_Lookup_Code;
SELECT meaning
INTO L_Return_Value
FROM mfg_lookups
WHERE lookup_type = 'MTL_LOCATION_CONTROL'
AND lookup_code = X_Lookup_Code;
SELECT mut.serial_number
FROM mtl_unit_transactions mut
, mtl_material_transactions mmt
WHERE mmt.inventory_item_id = X_Item_ID
AND mmt.organization_id = X_Organization_ID
AND mmt.transaction_source_type_id = 5
AND mmt.transaction_source_id = X_Wip_Entity_ID
AND mmt.operation_seq_num = X_Op_Seq_Num
AND mmt.transaction_type_id in (35 , 38 , 43 , 48)
AND mut.transaction_id = mmt.transaction_id
AND mut.inventory_item_id = X_Item_ID
AND mut.organization_id = X_Organization_ID
AND mut.transaction_source_type_id = 5
AND mut.transaction_source_id = X_Wip_Entity_ID
GROUP BY mut.serial_number
HAVING sum(sign(mmt.primary_quantity)) < 0
ORDER BY mut.serial_number;
SELECT segment1
FROM po_headers_all
WHERE po_header_id = X_Trx_Source_ID;
SELECT substr(concatenated_segments , 1 , 240)
FROM mtl_sales_orders_kfv
WHERE sales_order_id = X_Trx_Source_ID;
SELECT k_number_disp
FROM oke_k_headers_v
WHERE k_header_id = X_Trx_Source_ID;