The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
X_Report_Id NUMBER default null,
X_Application_Id NUMBER default null,
X_Responsibility_Id NUMBER default null,
X_Concurrent_Program_Id NUMBER default null,
X_Concurrent_Program_Name VARCHAR2 default null,
X_Interface_Table VARCHAR2 default null,
X_Concurrent_Program_Flag VARCHAR2 default null,
X_Select_Program_Name VARCHAR2 default null,
X_Last_Update_Date DATE default null,
X_Last_Updated_By NUMBER default null,
X_Created_By NUMBER default null,
X_Creation_Date DATE default null,
X_Last_Update_Login NUMBER default null,
X_Where_Clause_API VARCHAR2 default null,
X_Purge_API VARCHAR2 default null,
X_Calling_Fn VARCHAR2
) IS
temp_var varchar2(1);
CURSOR C IS SELECT rowid FROM fa_rx_reports
WHERE report_id = X_Report_Id;
INSERT INTO fa_rx_reports(
report_id,
application_id,
responsibility_id,
concurrent_program_id,
concurrent_program_name,
concurrent_program_flag,
interface_table,
select_program_name,
last_update_date,
last_updated_by,
created_by,
creation_date,
last_update_login,
where_clause_api,
purge_api,
version_number
) VALUES (
X_report_id,
X_application_id,
X_responsibility_id,
X_concurrent_program_id,
X_concurrent_program_name,
X_concurrent_program_flag,
X_interface_table,
decode(X_concurrent_program_flag,'N',X_select_program_name,null),
X_Last_Update_Date,
X_Last_Updated_By,
X_Created_By,
X_Creation_Date,
X_Last_Update_Login,
X_Where_Clause_API,
X_Purge_API,
ver_num
);
select max(report_id) into x_max_report_id from fa_rx_reports;
select fa_rx_reports_s.currval into x_curr_report_id_s from dual;
select fa_rx_reports_s.nextval into x_curr_report_id_s from dual;
select fa_rx_reports_s.nextval into dummy from dual;
END Insert_Row;
X_Select_Program_Name VARCHAR2 default null,
X_Interface_Table VARCHAR2 default null,
X_Where_Clause_API VARCHAR2 default null,
X_Purge_API VARCHAR2 default null,
X_Calling_Fn VARCHAR2
) IS
cursor c_reports is
SELECT *
FROM FA_RX_REPORTS
WHERE ROWID = X_ROWID
FOR UPDATE OF REPORT_ID NOWAIT;
fnd_message.set_name('FND','FORM_RECORD_DELETED');
AND (nvl(recinfo.select_program_name,
nvl(X_select_program_name,'-9999'))
= nvl(X_select_program_name,'-9999'))
AND (nvl(recinfo.responsibility_id,nvl(X_responsibility_id,-9999))
= nvl(X_responsibility_id,-9999))
AND (nvl(recinfo.where_clause_api,
nvl(X_Where_Clause_API,'-9999'))
= nvl(X_Where_Clause_API,'-9999'))
AND (nvl(recinfo.purge_api,
nvl(X_Purge_API,'-9999'))
= nvl(X_Purge_API,'-9999'))
) then
return;
PROCEDURE Update_Row(X_Rowid VARCHAR2,
X_Report_Id NUMBER default null,
X_Application_Id NUMBER default null,
X_Responsibility_Id NUMBER default null,
X_Concurrent_Program_Id NUMBER default null,
X_Concurrent_Program_Name VARCHAR2 default null,
X_Interface_Table VARCHAR2 default null,
X_Concurrent_Program_Flag VARCHAR2 default null,
X_Select_Program_Name VARCHAR2 default null,
X_Last_Update_Date DATE default null,
X_Last_Updated_By NUMBER default null,
X_Last_Update_Login NUMBER default null,
X_Where_Clause_API VARCHAR2 default null,
X_Purge_API VARCHAR2 default null,
X_Calling_Fn VARCHAR2
) IS
h_sel_program_name varchar2(240);
h_sel_program_name := X_select_program_name;
UPDATE fa_rx_reports
SET
Application_Id = X_Application_Id,
Responsibility_Id = X_Responsibility_Id,
Concurrent_Program_Id = X_Concurrent_Program_Id,
Concurrent_Program_Name = X_Concurrent_Program_Name,
Interface_Table = X_Interface_Table ,
Concurrent_Program_Flag = X_Concurrent_Program_Flag,
Select_Program_Name = h_sel_program_name,
Last_Update_Date = X_Last_Update_Date ,
Last_Updated_By = X_Last_Updated_By,
Last_Update_Login = X_Last_Update_Login,
Where_Clause_API = X_Where_Clause_API,
Purge_API = X_Purge_API
WHERE rowid = X_Rowid;
UPDATE fa_rx_reports
SET
Application_Id = X_Application_Id,
Responsibility_Id = X_Responsibility_Id,
Concurrent_Program_Id = X_Concurrent_Program_Id,
Concurrent_Program_Name = X_Concurrent_Program_Name,
Interface_Table = X_Interface_Table ,
Concurrent_Program_Flag = X_Concurrent_Program_Flag,
Select_Program_Name = h_sel_program_name,
Last_Update_Date = X_Last_Update_Date ,
Last_Updated_By = X_Last_Updated_By,
Last_Update_Login = X_Last_Update_Login,
Where_Clause_API = X_Where_Clause_API,
Purge_API = X_Purge_API
WHERE report_id = x_report_id;
END Update_Row;
PROCEDURE Delete_Row(X_Rowid VARCHAR2 default null,
X_Report_id NUMBER,
X_Calling_Fn VARCHAR2) IS
BEGIN
if X_Rowid is not null then
DELETE FROM fa_rx_reports
WHERE rowid = X_Rowid;
DELETE FROM fa_rx_reports
WHERE report_id = X_report_id;
(Called_Fn => 'FA_RX_REPORTS_PKG.Delete_Row',
Calling_Fn => X_Calling_Fn);
END Delete_Row;
X_Select_Program_Name VARCHAR2 default null,
X_Interface_Table VARCHAR2 default null,
X_Where_Clause_API VARCHAR2 default null,
X_Purge_API VARCHAR2 default null,
X_Owner VARCHAR2 default 'SEED')
is
Begin
Load_Row(X_Report_Id ,
X_Application_Name ,
X_Responsibility_Id ,
X_Concurrent_Program_Name ,
X_Concurrent_Program_Flag,
X_Select_Program_Name ,
X_Interface_Table ,
X_Where_Clause_API ,
X_Purge_API ,
X_Owner ,
Null,
Null);
X_Select_Program_Name VARCHAR2 default null,
X_Interface_Table VARCHAR2 default null,
X_Where_Clause_API VARCHAR2 default null,
X_Purge_API VARCHAR2 default null,
X_Owner VARCHAR2 default 'SEED',
X_Last_Update_Date VARCHAR2,
X_CUSTOM_MODE in VARCHAR2
)
Is
x_userid number;
f_ludate date; -- entity update date in file
db_ludate date; -- entity update date in db
select application_id into x_application_id
from fnd_application
where application_short_name = X_Application_Name;
select concurrent_program_id
into x_concurrent_program_id
from fnd_concurrent_programs
where application_id = x_application_id
and concurrent_program_name = x_concurrent_program_name;
-- Translate char last_update_date to date
f_ludate := nvl(to_date(X_Last_Update_Date, 'YYYY/MM/DD HH24:MI:SS'), sysdate);
select LAST_UPDATED_BY, LAST_UPDATE_DATE
into db_luby, db_ludate
from fa_rx_reports
where report_id = X_Report_Id;
update_row(
X_Rowid => null,
X_Report_Id => X_Report_Id,
X_Application_Id => X_Application_Id,
X_Responsibility_Id => X_Responsibility_Id,
X_Concurrent_Program_Id => X_Concurrent_Program_Id,
X_Concurrent_Program_Name => X_Concurrent_Program_Name,
X_Interface_Table => X_Interface_Table,
X_Concurrent_Program_Flag => X_Concurrent_Program_Flag,
X_Select_Program_Name => X_Select_Program_Name,
X_Last_Update_Date => f_ludate,
X_Last_Updated_By => f_luby,
X_Last_Update_Login => 0,
X_Where_Clause_API => X_Where_Clause_API,
X_Purge_API => X_Purge_API,
X_Calling_Fn => 'Load_Row');
insert_row(
X_Rowid => X_Rowid,
X_Report_Id => X_Report_Id,
X_Application_Id => X_Application_Id,
X_Responsibility_Id => X_Responsibility_Id,
X_Concurrent_Program_Id => X_Concurrent_Program_Id,
X_Concurrent_Program_Name => X_Concurrent_Program_Name,
X_Interface_Table => X_Interface_Table,
X_Concurrent_Program_Flag => X_Concurrent_Program_Flag,
X_Select_Program_Name => X_Select_Program_Name,
X_Last_Update_Date => f_ludate,
X_Last_Updated_By => f_luby,
X_Created_By => f_luby,
X_Creation_Date => f_ludate,
X_Last_Update_Login => 0,
X_Where_Clause_API => X_Where_Clause_API,
X_Purge_API => X_Purge_API,
X_Calling_Fn => 'Load_Row');