The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT subtype,
preparer_id,
type_name,
document_number
INTO x_subtype_code,
x_preparer_id,
x_type_name,
x_document_number
FROM PO_DOCUMENT_HEADERS_VIEW
WHERE document_id = x_object_id
AND type_code = x_object_type_code;
SELECT podt.security_level_code
INTO x_security_level
FROM po_document_types podt
WHERE podt.document_subtype = x_subtype_code
AND podt.document_type_code = x_object_type_code;
SELECT psp.security_position_structure_id
INTO x_security_hierarchy_id
FROM po_system_parameters psp;
SELECT security_level_code, document_type_code, document_subtype
BULK COLLECT into l_sec_level_tbl, l_doc_type_code_tbl, l_doc_subtype_tbl
FROM po_document_types_b
WHERE (document_type_code = 'PO' and document_subtype = 'STANDARD')
or (document_type_code = 'PA' and document_subtype = 'BLANKET')
or (document_type_code = 'PA' and document_subtype = 'CONTRACT')
or (document_type_code = 'PO' and document_subtype = 'PLANNED')
or (document_type_code = 'RELEASE' and document_subtype = 'BLANKET')
or (document_type_code = 'RELEASE' and document_subtype = 'SCHEDULED')
;
SELECT psp.security_position_structure_id
INTO x_security_hierarchy_id
FROM po_system_parameters psp;
SELECT poll.value_basis
INTO l_value_basis
FROM po_line_locations_all poll
WHERE poll.line_location_id = p_po_line_loc_id;
SELECT fc.minimum_accountable_unit,
fc.precision
INTO x_min_unit,
x_precision
FROM fnd_currencies fc,
gl_sets_of_books sob,
financials_system_parameters fsp
WHERE fsp.set_of_books_id = sob.set_of_books_id
AND sob.currency_code = fc.currency_code;
SELECT prf.full_name
INTO x_person_name
FROM per_all_people_f prf
WHERE prf.person_id = x_person_id
AND trunc(sysdate) between prf.effective_start_date and prf.effective_end_date;
SELECT bso.operation_code
INTO x_wip_operation_code
FROM bom_standard_operations bso,
wip_operations wop
WHERE ( x_wip_rep_schedule_id IS NULL
OR wop.repetitive_schedule_id
= x_wip_rep_schedule_id)
AND wop.wip_entity_id = x_wip_entity_id
AND wop.organization_id = x_destination_org_id
AND wop.operation_seq_num = x_wip_operation_seq_num
AND wop.standard_operation_id = bso.standard_operation_id(+)
AND NVL(bso.organization_id,x_destination_org_id)
= x_destination_org_id;
SELECT bod.department_code
INTO x_bom_department_code
FROM bom_departments bod,
wip_operations wop
WHERE ( x_wip_rep_schedule_id IS NULL
OR wop.repetitive_schedule_id
= x_wip_rep_schedule_id)
AND wop.wip_entity_id = x_wip_entity_id
AND wop.organization_id = x_destination_org_id
AND wop.operation_seq_num = x_wip_operation_seq_num
AND wop.department_id = bod.department_id
AND bod.organization_id = x_destination_org_id;
SELECT inventory_organization_id
INTO l_item_organization_id
FROM financials_system_parameters;
SELECT decode(msi.outside_operation_uom_type,
'ASSEMBLY',x_quantity_ordered,
'RESOURCE',x_quantity_ordered /
decode(wor.usage_rate_or_amount,
0,x_quantity_ordered,
wor.usage_rate_or_amount)
)
INTO x_assembly_quantity
FROM wip_operation_resources wor,
mtl_system_items msi
WHERE wor.wip_entity_id = x_wip_entity_id
AND nvl(wor.repetitive_schedule_id,-1) = nvl(x_wip_rep_schedule_id,-1)
AND wor.operation_seq_num = x_wip_operation_seq_num
AND wor.resource_seq_num = x_wip_resource_seq_num
AND wor.organization_id = x_destination_org_id
AND msi.inventory_item_id = x_item_id
AND msi.organization_id = l_item_organization_id; --
SELECT inventory_organization_id
INTO l_item_organization_id
FROM financials_system_parameters;
SELECT decode(msi.outside_operation_uom_type,
'ASSEMBLY',x_quantity_ordered * wor.usage_rate_or_amount,
'RESOURCE',x_quantity_ordered)
INTO x_resource_quantity
FROM wip_operation_resources wor,
mtl_system_items msi
WHERE wor.wip_entity_id = x_wip_entity_id
AND nvl(wor.repetitive_schedule_id,-1) = nvl(x_wip_rep_schedule_id,-1)
AND wor.operation_seq_num = x_wip_operation_seq_num
AND wor.resource_seq_num = x_wip_resource_seq_num
AND wor.organization_id = x_destination_org_id
AND msi.inventory_item_id = x_item_id
AND msi.organization_id = l_item_organization_id; --
SELECT po_num
INTO x_po_number
FROM po_line_locations_inq_v
WHERE x_line_location_id = line_location_id;
SELECT POH.segment1
INTO x_po_number
FROM po_headers_all POH, po_line_locations_all PLL --
WHERE POH.po_header_id = PLL.po_header_id and
PLL.line_location_id = x_line_location_id;
/* replacing the select statement with the new OE API. */
select order_source_id
into x_order_source_id
from po_system_parameters;
/* SELECT distinct(soh.order_number)
INTO x_so_number
FROM so_lines sol,
so_headers soh,
po_system_parameters psp
WHERE sol.original_system_line_reference = to_char(x_line_num)
AND soh.original_system_reference = x_segment1
AND sol.header_id = soh.header_id
AND soh.original_system_source_code = psp.order_source_id;
SELECT count(*)
INTO x_num_records
FROM po_requisition_lines_all --
WHERE line_location_id = x_line_location_id;
select pol.po_header_id ,
pol.amount,
plt.order_type_lookup_code
into l_po_header_id,
l_db_amount, -- SERVICES FPJ
l_value_basis -- SERVICES FPJ
from po_lines_all pol,
po_line_types_b plt
where pol.po_line_id = x_po_line_id
and pol.line_type_id = plt.line_type_id;
select hout.name
from hr_all_organization_units_tl hout,
hr_org_units_no_join hrou
where hrou.organization_id = x_org_id
and hrou.organization_id = hout.organization_id
and hout.language = userenv('lang');
select location_code
from hr_locations
where location_id = x_location_id;
select line_code
from wip_lines
where line_id = x_wip_line_id
and organization_id = x_destination_org_id ;
select wip_entity_name
from wip_entities
where wip_entity_id = x_wip_entity_id
and organization_id = x_destination_org_id ;
select resource_code,
unit_of_measure
from bom_resources
where resource_id = x_bom_resource_id and
organization_id = x_destination_org_id ;
select vendor_name
from po_vendors
where vendor_id = x_vendor_id ;
select vendor_site_code
from po_vendor_sites_all --
where vendor_site_id = x_vendor_site_id;
select name
from ap_terms
where term_id = x_terms_id;
select ship_to_organization_id ,
ship_to_location_id
from po_line_locations_all --< Shared Proc FPJ >
where line_location_id = x_po_line_location_id;
select terms_id
from po_headers_all --< Shared Proc FPJ >
where po_header_id = x_po_header_id;
SELECT gsb.chart_of_accounts_id
INTO x_purchasing_ou_coa_id
FROM gl_sets_of_books gsb,
financials_system_params_all fspa,
po_line_locations_all pll
WHERE pll.line_location_id = x_po_line_location_id
AND fspa.org_id = pll.org_id
AND gsb.set_of_books_id = fspa.set_of_books_id;
SELECT segment1,
type_lookup_code,
global_agreement_flag,
org_id,
quote_vendor_quote_number
INTO x_segment1,
x_type_lookup_code,
x_global_agreement_flag,
x_owning_org_id,
x_quote_vendor_quote_number
FROM po_headers_all
WHERE po_header_id = p_po_header_id;
SELECT type_name
INTO x_type_name
FROM po_document_types_vl
WHERE document_type_code = p_document_type_code
AND document_subtype = p_document_subtype;
select GLDC.USER_CONVERSION_TYPE from GL_DAILY_CONVERSION_TYPES GLDC
where GLDC.CONVERSION_TYPE = (select POH.RATE_TYPE
from po_headers_all POH
where poh.po_header_id = x_header_id);
SELECT hp.party_name
INTO x_vendor_name
FROM hz_parties hp,
hz_relationships h2,
fnd_user fu
WHERE hp.party_id = h2.subject_id
AND h2.subject_type = 'ORGANIZATION'
AND h2.object_type = 'PERSON'
AND h2.relationship_type = 'POS_EMPLOYMENT'
AND h2.relationship_code = 'EMPLOYER_OF'
AND h2.subject_table_name = 'HZ_PARTIES'
AND h2.object_table_name = 'HZ_PARTIES'
AND h2.status = 'A'
AND h2.start_date <= sysdate
AND h2.end_date >= sysdate
AND h2.object_id = fu.customer_id
AND h2.subject_id IN
(SELECT owner_table_id
FROM hz_code_assignments
WHERE owner_table_name = 'HZ_PARTIES'
AND status = 'A'
AND class_category = 'POS_PARTICIPANT_TYPE'
AND class_code = 'VENDOR')
AND fu.user_name = l_user_name;
SELECT polc.displayed_field
INTO x_displayed_field
FROM po_lookup_codes polc
WHERE lookup_type = p_lookup_type
AND lookup_code = p_lookup_code;
SELECT fu.user_name, hp.party_name
INTO l_user_name, l_party_name
FROM fnd_user fu,hz_parties hp
WHERE hp.party_id = fu.customer_id
AND fu.user_id = p_user_id;
SELECT fu.email_address, hp.email_address
INTO l_fu_email_address, l_hp_email_address
FROM fnd_user fu,hz_parties hp
WHERE hp.party_id = fu.customer_id
AND fu.user_id = p_user_id;