The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT a.cust_id INTO l_billcust_id
FROM op_cust_mst_v a, op_cust_mst_opm b
WHERE a.cust_no = b.cust_no
AND a.of_cust_id = b.of_cust_id --Bug 5651374 Performance issue.
AND a.co_code = b.co_code
AND b.cust_id = p_opm_cust_id
AND b.bill_ind = 1
AND rownum < 2;
SELECT a.cust_id INTO l_shipcust_id
FROM op_cust_mst_v a, op_cust_mst_opm b
WHERE a.cust_no = b.cust_no
AND a.of_cust_id = b.of_cust_id --Bug 5651374 Performance issue.
AND a.co_code = b.co_code
AND b.cust_id = p_opm_cust_id
AND b.ship_ind = 1
AND rownum < 2;
SELECT a.cust_id INTO l_anycust_id
FROM op_cust_mst_v a, op_cust_mst_opm b
WHERE a.cust_no = b.cust_no
AND a.of_cust_id = b.of_cust_id --Bug 5651374 Performance issue.
AND a.co_code = b.co_code
AND b.cust_id = p_opm_cust_id
AND rownum < 2;
PROCEDURE UPDATE_CUST_ID
IS
l_bill_cust_id NUMBER;
SELECT b.cust_id FROM op_cust_mst a, op_cust_mst_opm b
WHERE a.cust_no = b.cust_no
AND a.co_code = b.co_code;
UPDATE gl_acct_map
SET cust_id = l_ship_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_alot_prm
SET cust_id = l_ship_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_cust_asc
SET assoccust_id = l_ship_cust_id
WHERE opm_assoccust_id = r.cust_id;
UPDATE op_gnrc_itm
SET cust_id = l_ship_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_txcu_asc
SET cust_id = l_ship_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_ordr_hdr
SET shipcust_id = l_ship_cust_id
WHERE opm_shipcust_id = r.cust_id;
UPDATE op_ordr_hdr
SET ultimate_shipcust_id = l_ship_cust_id
WHERE opm_ultimate_shipcust_id = r.cust_id;
UPDATE op_ordr_dtl
SET shipcust_id = l_ship_cust_id
WHERE opm_shipcust_id = r.cust_id;
UPDATE op_prsl_hdr
SET shipcust_id = l_ship_cust_id
WHERE opm_shipcust_id = r.cust_id;
UPDATE op_prsl_hdr
SET ultimate_shipcust_id = l_ship_cust_id
WHERE opm_ultimate_shipcust_id = r.cust_id;
UPDATE op_prsl_dtl
SET shipcust_id = l_ship_cust_id
WHERE opm_shipcust_id = r.cust_id;
UPDATE op_prsl_dtl
SET ultimate_shipcust_id = l_ship_cust_id
WHERE opm_ultimate_shipcust_id = r.cust_id;
UPDATE op_cust_asc
SET cust_id = l_bill_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_ordr_hdr
SET billcust_id = l_bill_cust_id
WHERE opm_billcust_id = r.cust_id;
UPDATE op_prsl_hdr
SET billcust_id = l_bill_cust_id
WHERE opm_billcust_id = r.cust_id;
UPDATE op_prsl_dtl
SET billcust_id = l_bill_cust_id
WHERE opm_billcust_id = r.cust_id;
UPDATE op_chrg_itm
SET cust_id = l_any_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_cust_con
SET cust_id = l_any_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_cust_itm
SET cust_id = l_any_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_prce_eff
SET cust_id = l_any_cust_id
WHERE opm_cust_id = r.cust_id;
UPDATE op_ordr_hdr
SET soldtocust_id = l_any_cust_id
WHERE opm_soldtocust_id = r.cust_id;
UPDATE op_ordr_dtl
SET soldtocust_id = l_any_cust_id
WHERE opm_soldtocust_id = r.cust_id;
UPDATE op_ordr_dtl
SET ultimate_shipcust_id = l_any_cust_id
WHERE opm_ultimate_shipcust_id = r.cust_id;
UPDATE op_prsl_hdr
SET soldtocust_id= l_any_cust_id
WHERE opm_soldtocust_id = r.cust_id;
UPDATE op_prsl_dtl
SET soldtocust_id= l_any_cust_id
WHERE opm_soldtocust_id = r.cust_id;
UPDATE op_cust_shp
SET cust_id = l_any_cust_id
WHERE opm_cust_id = r.cust_id;
END UPDATE_CUST_ID;