The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT ams_discoverer_sql_s.NEXTVAL
FROM DUAL;
SELECT MIN (discoverer_sql_id), MAX (sequence_order), MAX (source_type_code)
FROM ams_discoverer_sql
WHERE workbook_name = p_workbook_name
AND worksheet_name = p_worksheet_name
;
select max(sequence_order)
into l_max_sequence_number
from ams_discoverer_sql
where workbook_name = P_WorkBookName
and WORKSHEET_NAME = P_WorkSheetName;
select min(discoverer_sql_id)
into l_start_id
from ams_discoverer_sql
where workbook_name = P_WorkBookName
and worksheet_name = P_WorkSheetName;
DELETE FROM ams_discoverer_sql
WHERE workbook_name = p_workbookname
AND WORKSHEET_NAME = p_worksheetname;
INSERT INTO ams_discoverer_sql (
discoverer_sql_id,
workbook_owner_name,
workbook_name,
worksheet_name,
sequence_order,
last_update_date,
last_updated_by,
creation_date,
created_by,
sql_string,
source_type_code
)
VALUES (
l_discoverer_sql_id,
p_workbookowner,
p_workbookname,
p_worksheetname,
p_sequence,
SYSDATE,
FND_GLOBAL.user_id,
SYSDATE,
FND_GLOBAL.user_id,
p_sqlsegment,
l_source_type_code
);
UPDATE ams_discoverer_sql
SET source_type_code = l_source_type_code
WHERE workbook_name = p_workbookname
AND worksheet_name = p_worksheetname
AND (source_type_code <> l_source_type_code OR source_type_code IS NULL)
;
Cursor C_SQL_string IS Select Sql_String
From Ams_Discoverer_SQL
Where Workbook_name = p_workbook_name
And Worksheet_name = p_worksheet_name
Order by Sequence_Order;
Select Count(*)
into l_str_count
From ams_discoverer_sql
Where Workbook_name = p_workbook_name
And Worksheet_name = p_worksheet_name;
--no match found, update string search position.
else
x_found := FND_API.G_FALSE;
SELECT source_type_code
FROM ams_list_src_types
WHERE master_source_type_flag = 'Y'
AND enabled_flag = 'Y'
;