The following lines contain the word 'select', 'insert', 'update' or 'delete':
/* This procedure will insert exceptions into the sy_excp_tbl.
The interface_id and co_code will always be -99 and ' ' respectively.*/
PROCEDURE Write_Exception(
pi_table_code in varchar2,
pi_key_name in varchar2,
pi_message_code in varchar2,
pi_col1 in varchar2,
pi_col2 in varchar2,
pi_col3 in varchar2,
pi_col4 in varchar2,
pi_col5 in varchar2,
pi_key_value in varchar2) IS
message_args GMF_MSG_PKG.SubstituteTabTyp;
INSERT into sy_excp_tbl(
software_code,
table_code ,
message_code ,
exception_date ,
col1,
col2,
col3,
col4,
col5,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATED_BY,
CREATION_DATE,
interface_id ,
co_code,
key_value)
VALUES(
'ORAFIN',
substrb(pi_table_code, 1, 16),
substrb(pi_message_code, 1, 32),
sysdate,
substrb(pi_key_name || ' `' || pi_key_value || '`', 1, 64),
substrb(pi_col2, 1, 64),
substrb(pi_col3, 1, 64),
substrb(pi_col4, 1, 64),
substrb(pi_col5, 1, 64),
sysdate,
Gmf_session_vars.last_updated_by,
Gmf_session_vars.last_updated_by,
sysdate,
-99,
decode(pi_table_code, 'Customers', Gmf_Session_Vars.GL_EXCP_CO_CODE, NULL),
substrb(pi_key_value, 1, 256));
gmf_session_vars.last_updated_by,
message_args,
error_status);
/* This procedure will delete exceptions from the sy_excp_tbl. */
PROCEDURE Delete_Exception(
pi_table_code in varchar2,
pi_key_value in varchar2) IS
BEGIN
DELETE FROM sy_excp_tbl
WHERE key_value = pi_key_value
AND table_code = pi_table_code;
END; /* Delete_Exception */
SELECT 1
FROM gl_curr_mst
WHERE currency_code = v_apps_currency_code;
SELECT 1
FROM gl_rate_typ
WHERE rate_type_code = v_apps_rate_type_code;
SELECT terms_code
FROM op_term_mst
WHERE of_terms_code = v_of_terms_code;
SELECT shipper_code
FROM op_ship_mst
WHERE of_shipper_code = v_of_shipper_code;
SELECT fob_code
FROM op_fobc_mst
WHERE of_fob_code = v_of_fob_code;
SELECT Frtbill_Mthd
FROM op_frgt_mth
WHERE of_Frtbill_Mthd = v_of_Frtbill_Mthd;
SELECT 1
FROM po_vgld_cls
WHERE Vendgl_Class = v_apps_Vendgl_Class;
SELECT 1
FROM op_slsr_mst
WHERE Slsrep_Code = v_apps_Slsrep_Code;
SELECT 1
FROM op_cust_cls
WHERE Cust_Class = v_apps_Cust_Class;
SELECT 1
FROM op_cgld_cls
WHERE Custgl_Class = v_apps_Custgl_Class;
SELECT 1
FROM op_cprc_cls
WHERE Custprice_Class = v_apps_Custprice_Class;
SELECT 1
FROM tx_tloc_cds
WHERE Taxloc_Code = v_apps_Taxloc_Code;
SELECT 1
FROM tx_calc_mst
WHERE Taxcalc_Code = v_apps_Taxcalc_Code;
SELECT 1
FROM ic_whse_mst
WHERE Whse_Code = v_apps_Whse_Code;
UPDATE sy_addr_mst
SET
addr1 = nvl(pi_addr1,' '),
addr2 = nvl(pi_addr2,' '),
addr3 = nvl(pi_addr3,' '),
addr4 = nvl(pi_addr4,' '),
ora_addr4 = nvl(pi_ora_addr4,' '),
province = nvl(pi_province,' '),
county = nvl(pi_county,' '),
state_code = nvl(pi_state_code,' '),
country_code = nvl(pi_country_code,' '),
postal_code = nvl(pi_postal_code,' '),
pseudo_key = pi_pseudo_key,
last_update_date = nvl(pi_date_modified, to_date(2440588,'J')),
last_updated_by = nvl(pi_modified_by,0),
creation_date = nvl(pi_date_added, to_date(2440588,'J')),
created_by = nvl(pi_added_by,0)
WHERE
addr_id = pi_addr_id;
SELECT GEM5_address_id_s.nextval INTO pi_addr_id FROM dual;
INSERT into sy_addr_mst(
addr_id,
addr1,
addr2,
addr3,
addr4,
ora_addr4,
province,
county,
state_code,
country_code,
postal_code,
pseudo_key,
last_update_date,
last_updated_by,
creation_date,
created_by,
comments,
delete_mark,
trans_cnt)
values(
pi_addr_id,
nvl(pi_addr1, ' '),
nvl(pi_addr2, ' '),
nvl(pi_addr3, ' '),
nvl(pi_addr4, ' '),
nvl(pi_ora_addr4, ' '),
nvl(pi_province, ' '),
nvl(pi_county, ' '),
nvl(pi_state_code, ' '),
nvl(pi_country_code, ' '),
nvl(pi_postal_code, ' '),
pi_pseudo_key,
nvl(pi_date_modified, to_date(2440588,'J')),
nvl(pi_modified_by,0),
nvl(pi_date_added, to_date(2440588,'J')),
nvl(pi_added_by,0),
' ',
0,
0);
/* Insert the state_code if it is not already there in sy_geog_mst */
IF pi_state_code is not NULL THEN
INSERT into SY_GEOG_MST(
geog_type,
geog_code,
geog_desc,
delete_mark,
trans_cnt,
creation_date,
created_by,
last_update_date,
last_updated_by)
SELECT
2,
pi_state_code,
pi_state_code,
0,
0,
nvl(pi_date_added, to_date(2440588,'J')),
nvl(pi_added_by,0),
nvl(pi_date_modified, to_date(2440588,'J')),
nvl(pi_modified_by,0)
FROM SYS.DUAL
WHERE not exists(
SELECT 1 FROM SY_GEOG_MST
WHERE geog_type = 2 and geog_code = pi_state_code);
/* Insert the Country Code if it is not already there in sy_geog_mst */
IF pi_country_code is not NULL THEN
INSERT into SY_GEOG_MST(
geog_type,
geog_code,
geog_desc,
delete_mark,
trans_cnt,
creation_date,
created_by,
last_update_date,
last_updated_by)
SELECT
1,
pi_country_code,
territory_short_name,
0,
0,
nvl(pi_date_added, to_date(2440588,'J')),
nvl(pi_added_by,0),
nvl(pi_date_modified, to_date(2440588,'J')),
nvl(pi_modified_by,0)
FROM fnd_territories_vl
WHERE territory_code = pi_country_code and
not exists(
SELECT 1 FROM SY_GEOG_MST
WHERE geog_type = 1 and geog_code = pi_country_code);
SELECT 1
FROM op_term_mst
WHERE of_terms_code = v_of_terms_code;
SELECT 1
FROM op_ship_mst
WHERE of_shipper_code = v_of_shipper_code;
SELECT 1
FROM op_fobc_mst
WHERE of_fob_code = v_of_fob_code;
SELECT 1
FROM op_slsr_mst
WHERE Slsrep_Code = v_apps_Slsrep_Code;