The following lines contain the word 'select', 'insert', 'update' or 'delete':
LAST_UPDATED_BY CONSTANT pls_integer := 0;
LAST_UPDATE_LOGIN CONSTANT pls_integer := 0;
select id, creation_date, version
into i_id, i_creation_date, i_new_version
from ecx_files
where application_code = i_application_code
and version = (select max(version)
from ecx_files
where application_code = i_application_code
and name = i_filename
and type = FILE_TYPE)
and name = i_filename
and type = FILE_TYPE;
select id, creation_date
into i_id, i_creation_date
from ecx_files
where application_code = i_application_code
and version = i_version
and name = i_filename
and type = FILE_TYPE;
update ecx_files
set last_update_date = sysdate,
payload = i_payload
where id = i_id;
insert into ecx_files
(
id,
type,
name,
version,
application_code,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
payload
)
values
(
ecx_files_s.nextval,
FILE_TYPE,
i_filename,
i_new_version,
i_application_code,
sysdate,
LAST_UPDATED_BY,
sysdate,
CREATED_BY,
LAST_UPDATE_LOGIN,
i_payload
);
delete from ecx_files
where application_code = i_application_code
and version = (select max(version)
from ecx_files
where application_code = i_application_code
and name = i_filename
and type = FILE_TYPE)
and name = i_filename
and type = FILE_TYPE;
delete from ecx_files
where application_code = i_application_code
and (i_version is null or version = i_version)
and name = i_filename
and type = FILE_TYPE;
i_retmsg := ' XSLT Successfully Deleted';
i_retmsg := SQLERRM || ' XSLT cannot be deleted';