The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT sample_id, source, organization_id, sample_no, sample_desc, inventory_item_id, revision, priority,
sample_qty, sample_qty_uom, subinventory, locator_id, parent_lot_number, lot_number,
lab_organization_id, expiration_date, lot_retest_ind, storage_organization_id, storage_subinventory,
storage_locator_id, sample_instance,date_drawn, resources, instance_id,
time_point_id, retain_as
FROM GMD_SAMPLES
WHERE ((p_organization_id IS NULL) OR (ORGANIZATION_ID = p_organization_id))
AND ((p_from_sample_no IS NULL) OR (sample_no between p_from_sample_no and p_to_sample_no))
AND ((p_variant_id IS NULL) OR (variant_id = p_variant_id))
AND ((p_time_point_id IS NULL ) OR (time_point_id = p_time_point_id))
ORDER BY 1
;
SELECT meaning
FROM GEM_LOOKUPS
WHERE LOOKUP_TYPE = 'GMD_QC_TEST_PRIORITY'
AND LOOKUP_CODE = p_priority;
SELECT meaning
FROM GEM_LOOKUPS
WHERE LOOKUP_TYPE = 'GMD_QC_SOURCE'
AND LOOKUP_CODE = p_source;
SELECT /*organization_id, BUG# 4612611*/ batch_no, formula_no, formula_vers, oprn_no, oprn_vers,
recipe_no, recipe_version, routing_no, routing_vers
FROM GMD_QC_E_WIP_SAMPLE_DTLS_V
WHERE sample_id = p_sample_id;
/*SELECT customer_name, operating_unit_name,
ship_to_site_name, order_type,
order_number, order_line_number
FROM GMD_QC_E_CUST_SAMPLE_DTLS_V
WHERE sample_id = p_sample_id; */
SELECT
hzp.party_name customer_name ,
hrou.NAME operating_unit_name,
hzcsua.LOCATION ship_to_site_name ,
oeoha.order_number order_number,
oetrtyp.NAME order_type ,
oeola.line_number order_line_number
FROM
gmd_samples gsmp ,
hz_parties hzp ,
hz_cust_accounts_all hzca ,
hr_all_organization_units_tl hrou ,
HR_ORGANIZATION_INFORMATION O2,
hz_cust_site_uses_all hzcsua ,
oe_order_headers_all oeoha ,
oe_transaction_types_tl oetrtyp ,
oe_order_lines_all oeola
WHERE
hzp.party_id = hzca.party_id AND
hzca.cust_account_id = gsmp.cust_id AND
hrou.organization_id(+) = gsmp.org_id AND
O2.ORGANIZATION_ID = hrou.ORGANIZATION_ID AND
O2.ORG_INFORMATION1 = 'OPERATING_UNIT' AND
O2.ORG_INFORMATION2 = 'Y' AND
hrou.language = userenv('LANG') AND
hzcsua.site_use_id(+) = gsmp.ship_to_site_id AND
oeoha.header_id(+) = gsmp.order_id AND
oetrtyp.transaction_type_id(+) = oeoha.order_type_id AND
oetrtyp.language = userenv('LANG') AND
oeola.line_id(+) = gsmp.order_line_id AND
gsmp.SOURCE = 'C' AND
sample_id = p_sample_id;
/*SELECT supplier_code, supplier_name,supplier_site,
po_number, po_line_number, receipt_number,
receipt_line_number
FROM GMD_QC_E_SUPP_SAMPLE_DTLS_V
WHERE sample_id = p_sample_id; */
SELECT
povend.segment1 supplier_code ,
povend.vendor_name supplier_name ,
povendsites.vendor_site_code supplier_site ,
pohdrall.segment1 po_number,
polinesall.line_num po_line_number ,
rcvshiphdr.receipt_num receipt_number ,
rcvshiplines.line_num receipt_line_number
FROM
gmd_samples gsmp ,
po_vendors povend ,
po_vendor_sites_all povendsites ,
po_headers_all pohdrall ,
po_lines_all polinesall ,
rcv_shipment_headers rcvshiphdr ,
rcv_shipment_lines rcvshiplines ,
hr_operating_units hrops ,
mtl_parameters mp
WHERE
gsmp.supplier_id = povend.vendor_id AND
gsmp.supplier_site_id = povendsites.vendor_site_id(+) AND
gsmp.po_header_id = pohdrall.po_header_id(+) AND
gsmp.po_line_id = polinesall.po_line_id(+) AND
gsmp.receipt_id = rcvshiphdr.shipment_header_id(+) AND
gsmp.receipt_line_id = rcvshiplines.shipment_line_id(+) AND
gsmp.SOURCE = 'S' AND
hrops.organization_id = gsmp.org_id AND
mp.organization_id = gsmp.organization_id
and gsmp.sample_id = p_sample_id;
SELECT f.organization_id, f.ss_no,c.spec_name item_spec, c.spec_vers item_spec_version,
d.spec_name storage_spec, d.spec_vers storage_spec_version,
a.variant_no, b.name time_interval_name, b.scheduled_date
FROM GMD_SS_VARIANTS A, GMD_SS_TIME_POINTS B,
GMD_SPECIFICATIONS_B C, GMD_SPECIFICATIONS D,
GMD_SAMPLES E,GMD_STABILITY_STUDIES f
WHERE e.sample_id = p_sample_id
AND e.variant_id = p_variant_id
AND e.time_point_id = b.time_point_id
AND e.variant_id = b.variant_id
AND a.variant_id = b.variant_id
AND b.spec_id = c.spec_id
AND a.storage_spec_id = d.spec_id
AND a.ss_id = f.ss_id;
SELECT f.organization_id, f.ss_no,c.spec_name item_spec, c.spec_vers item_spec_version,
d.spec_name storage_spec, d.spec_vers storage_spec_version,
a.variant_no, null time_interval_name, null scheduled_date --null for retained sample.
FROM GMD_SS_VARIANTS A,
GMD_SPECIFICATIONS_B C, GMD_SPECIFICATIONS D,
GMD_SAMPLES E,GMD_STABILITY_STUDIES f
WHERE e.sample_id = p_sample_id
AND e.variant_id = p_variant_id
AND e.variant_id = a.variant_id
AND a.default_spec_id = c.spec_id
AND a.storage_spec_id = d.spec_id
AND a.ss_id = f.ss_id;
SELECT a.instance_number, b.resources, b.storage_organization_id, b.storage_subinventory, b.storage_locator_id
FROM GMP_RESOURCE_INSTANCES a, GMD_SS_VARIANTS B
WHERE a.INSTANCE_ID(+) = b.resource_instance_id
AND b.variant_id = p_variant_id;
SELECT meaning
FROM GEM_LOOKUPS
WHERE LOOKUP_TYPE = 'GMD_QC_RETAIN_AS'
AND LOOKUP_CODE = p_retain_as;
SELECT organization_code
FROM mtl_parameters
WHERE organization_id = v_organization_id;
SELECT concatenated_segments
FROM mtl_system_items_b_kfv
WHERE organization_id = p_organization_id
AND inventory_item_id = p_inventory_item_id;
SELECT segment1
FROM mtl_item_locations
WHERE inventory_location_id = v_locator_id;