The following lines contain the word 'select', 'insert', 'update' or 'delete':
g_function_rows_deleted VARCHAR2(30) := 'NULL';
g_form_rows_deleted VARCHAR2(30) := 'NULL';
g_industry_rows_deleted VARCHAR2(30) := 'NULL';
PROCEDURE DELETE_ROWS(
X_FUNCTION_NAME IN VARCHAR2) IS
BEGIN
if g_function_rows_deleted = X_FUNCTION_NAME then
RETURN;
delete from fnd_form_custom_params
where action_id in (select action_id
from fnd_form_custom_actions a , fnd_form_custom_rules r
where a.rule_id = r.id
and r.created_by <> 1
and r.function_name = X_FUNCTION_NAME
and (r.rule_type = 'A'or r.rule_type is null));
delete from fnd_form_custom_actions
where rule_id in (select id
from fnd_form_custom_rules r
where r.created_by <> 1
and r.function_name = X_FUNCTION_NAME
and (r.rule_type = 'A'or r.rule_type is null));
delete from fnd_form_custom_scopes
where rule_id in (select id
from fnd_form_custom_rules r
where r.created_by <> 1
and r.function_name = X_FUNCTION_NAME
and (r.rule_type = 'A'or r.rule_type is null));
delete from fnd_form_custom_rules
where created_by <> 1
and function_name = X_FUNCTION_NAME
and (rule_type = 'A'or rule_type is null);
g_function_rows_deleted := X_FUNCTION_NAME;
END DELETE_ROWS;
PROCEDURE DELETE_FORM_ROWS(
X_FORM_NAME IN VARCHAR2) IS
BEGIN
if g_form_rows_deleted = X_FORM_NAME then
RETURN;
delete from fnd_form_custom_params
where action_id in (select action_id
from fnd_form_custom_actions a , fnd_form_custom_rules r
where a.rule_id = r.id
and r.created_by <> 1
and r.form_name = X_FORM_NAME
and r.rule_type = 'F');
delete from fnd_form_custom_actions
where rule_id in (select id
from fnd_form_custom_rules r
where r.created_by <> 1
and r.form_name = X_FORM_NAME
and r.rule_type = 'F');
delete from fnd_form_custom_scopes
where rule_id in (select id
from fnd_form_custom_rules r
where r.created_by <> 1
and r.form_name = X_FORM_NAME
and r.rule_type = 'F');
delete from fnd_form_custom_rules
where created_by <> 1
and form_name = X_FORM_NAME
and rule_type = 'F';
g_form_rows_deleted := X_FORM_NAME;
END DELETE_FORM_ROWS;
PROCEDURE DELETE_INDUSTRY_ROWS(
X_RULE_KEY IN VARCHAR2,
X_FORM_NAME IN VARCHAR2 DEFAULT NULL) IS
BEGIN
if (g_form_rows_deleted = X_FORM_NAME OR X_FORM_NAME IS NULL)
AND g_industry_rows_deleted = X_RULE_KEY then
RETURN;
delete from fnd_form_custom_params
where action_id in (select action_id
from fnd_form_custom_actions a , fnd_form_custom_rules r
where a.rule_id = r.id
and r.created_by = 8
and r.rule_key = X_RULE_KEY
and X_FORM_NAME IS NULL or (X_FORM_NAME IS NOT NULL and
r.form_name = X_FORM_NAME));
delete from fnd_form_custom_actions
where rule_id in (select id
from fnd_form_custom_rules r
where r.created_by = 8
and r.rule_key = X_RULE_KEY
and X_FORM_NAME IS NULL or (X_FORM_NAME IS NOT NULL and
r.form_name = X_FORM_NAME));
delete from fnd_form_custom_scopes
where rule_id in (select id
from fnd_form_custom_rules r
where r.created_by = 8
and r.rule_key = X_RULE_KEY
and X_FORM_NAME IS NULL or (X_FORM_NAME IS NOT NULL and
r.form_name = X_FORM_NAME));
delete from fnd_form_custom_rules
where created_by = 8
and rule_key = X_RULE_KEY
and X_FORM_NAME IS NULL or (X_FORM_NAME IS NOT NULL and
form_name = X_FORM_NAME);
g_form_rows_deleted := X_FORM_NAME;
g_industry_rows_deleted := X_RULE_KEY;
END DELETE_INDUSTRY_ROWS;