The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE INSERT_ROW (X_ROWID in out nocopy VARCHAR2,
X_MIME_TYPE in VARCHAR2,
X_CP_FORMAT_CODE in VARCHAR2 DEFAULT NULL,
X_CTX_FORMAT_CODE in VARCHAR2 default 'IGNORE',
X_CREATION_DATE in DATE DEFAULT SYSDATE,
X_CREATED_BY in NUMBER,
X_LAST_UPDATE_DATE in DATE DEFAULT SYSDATE,
X_LAST_UPDATED_BY in NUMBER,
X_LAST_UPDATE_LOGIN in NUMBER DEFAULT NULL,
X_FILE_EXT in VARCHAR2,
X_ALLOW_FILE_UPLOAD in VARCHAR2) IS
cursor C is select rowid from fnd_mime_types
where lower(mime_type) = lower(x_mime_type)
and nvl(lower(file_ext),'NULL') = nvl(lower(x_file_ext),'NULL');
cursor cnt is select count(*) from fnd_mime_types
where lower(mime_type) = lower(x_mime_type)
and nvl(lower(file_ext),'NULL') = nvl(lower(x_file_ext),'NULL');
/* Checking if a record exists before attempting to insert a record.
* Using 2 cursors so that whether a record exists or not the rowid
* can be retrieved and returned to the caller
*/
if (chk_exists = 0) then
select fnd_mime_types_s.NEXTVAL into x_mime_type_id from dual;
INSERT INTO fnd_mime_types (mime_type_id,
mime_type,
cp_format_code,
ctx_format_code,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login,
file_ext,
allow_file_upload)
VALUES
(x_mime_type_id,
x_mime_type,
x_cp_format_code,
x_ctx_format_code,
x_creation_date,
x_created_by,
x_last_update_date,
x_last_updated_by,
x_last_update_login,
x_file_ext,
x_allow_file_upload);
END INSERT_ROW;
PROCEDURE UPDATE_ROW (X_MIME_TYPE in VARCHAR2,
X_CP_FORMAT_CODE in VARCHAR2,
X_CTX_FORMAT_CODE in VARCHAR2,
X_LAST_UPDATE_DATE in DATE,
X_LAST_UPDATED_BY in NUMBER,
X_LAST_UPDATE_LOGIN in NUMBER DEFAULT NULL,
X_FILE_EXT in VARCHAR2,
X_ALLOW_FILE_UPLOAD in VARCHAR2) IS
l_cp_format_code varchar2(4);
select decode(x_cp_format_code,fnd_file_mime_types_pkg.null_char,null,null,m.cp_format_code,x_cp_format_code),
decode(x_ctx_format_code,fnd_file_mime_types_pkg.null_char,null,null,m.ctx_format_code,x_ctx_format_code),
decode(x_file_ext,fnd_file_mime_types_pkg.null_char,null,null,m.file_ext,x_file_ext),
decode(x_allow_file_upload,fnd_file_mime_types_pkg.null_char,null,null,m.allow_file_upload,x_allow_file_upload)
into l_cp_format_code, l_ctx_format_code, l_file_ext, l_allow_file_upload
from fnd_mime_types m
where lower(mime_type) = lower(x_mime_type)
and lower(file_ext) = lower(x_file_ext);
select decode(x_cp_format_code,fnd_file_mime_types_pkg.null_char,null,null,m.cp_format_code,x_cp_format_code),
decode(x_ctx_format_code,fnd_file_mime_types_pkg.null_char,null,null,m.ctx_format_code,x_ctx_format_code),
decode(x_file_ext,fnd_file_mime_types_pkg.null_char,null,null,m.file_ext,x_file_ext),
decode(x_allow_file_upload,fnd_file_mime_types_pkg.null_char,null,null,m.allow_file_upload,x_allow_file_upload)
into l_cp_format_code, l_ctx_format_code, l_file_ext, l_allow_file_upload
from fnd_mime_types m
where lower(mime_type) = lower(x_mime_type);
update fnd_mime_types
set cp_format_code = l_cp_format_code,
ctx_format_code = l_ctx_format_code,
file_ext = l_file_ext,
allow_file_upload = l_allow_file_upload
where mime_type = x_mime_type;
END UPDATE_ROW;
PROCEDURE DELETE_ROW (X_MIME_TYPE in VARCHAR2,
X_FILE_EXT in VARCHAR2) IS
BEGIN
delete from fnd_mime_types
where lower(mime_type) like lower(x_mime_type)
and lower(file_ext) like lower(x_file_ext);
END DELETE_ROW;
UPDATE FND_MIME_TYPES
SET FILE_EXT = X_FILE_EXT
WHERE lower(MIME_TYPE) like lower(X_MIME_TYPE);
UPDATE FND_MIME_TYPES
SET ALLOW_FILE_UPLOAD = X_ALLOW_FILE_UPLOAD
WHERE lower(FILE_EXT) = lower(X_FILE_EXT);