The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT 'Duplicate'
FROM GL_STORAGE_PARAMETERS s
WHERE s.object_name = X_object_name
AND ( X_row_id is null
OR s.rowid <> chartorowid(X_row_id));
PROCEDURE Insert_Row( X_Rowid IN OUT NOCOPY VARCHAR2,
X_object_name VARCHAR2,
X_last_update_date DATE,
X_last_updated_by NUMBER,
X_creation_date DATE,
X_created_by NUMBER,
X_last_update_login NUMBER,
X_object_type VARCHAR2,
X_tablespace_name VARCHAR2,
X_initial_extent_size_kb NUMBER,
X_next_extent_size_kb NUMBER,
X_max_extents NUMBER,
X_pct_increase NUMBER,
X_pct_free NUMBER,
X_description VARCHAR2) IS
CURSOR C IS SELECT rowid FROM GL_STORAGE_PARAMETERS
WHERE object_name = X_object_name;
INSERT INTO GL_STORAGE_PARAMETERS( OBJECT_NAME,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
CREATION_DATE,
CREATED_BY,
LAST_UPDATE_LOGIN,
OBJECT_TYPE,
TABLESPACE_NAME,
INITIAL_EXTENT_SIZE_KB,
NEXT_EXTENT_SIZE_KB,
MAX_EXTENTS,
PCT_INCREASE,
PCT_FREE,
DESCRIPTION)
VALUES (X_object_name,
X_last_update_date,
X_last_updated_by,
X_creation_date,
X_created_by,
X_last_update_login,
X_object_type,
X_tablespace_name,
X_initial_extent_size_kb,
X_next_extent_size_kb,
X_max_extents,
X_pct_increase,
X_pct_free,
X_description);
END Insert_Row;
SELECT * FROM GL_STORAGE_PARAMETERS
WHERE rowid = X_rowid
FOR UPDATE OF object_name NOWAIT;
FND_MESSAGE.SET_NAME('FND', 'FORM_RECORD_DELETED');
PROCEDURE Update_Row( X_Rowid IN OUT NOCOPY VARCHAR2,
X_object_name VARCHAR2,
X_last_update_date DATE,
X_last_updated_by NUMBER,
X_creation_date DATE,
X_created_by NUMBER,
X_last_update_login NUMBER,
X_object_type VARCHAR2,
X_tablespace_name VARCHAR2,
X_initial_extent_size_kb NUMBER,
X_next_extent_size_kb NUMBER,
X_max_extents NUMBER,
X_pct_increase NUMBER,
X_pct_free NUMBER,
X_description VARCHAR2) IS
BEGIN
UPDATE GL_STORAGE_PARAMETERS
SET
object_name = x_object_name,
last_update_date = x_last_update_date,
last_updated_by = x_last_updated_by,
creation_date = x_creation_date,
created_by = x_created_by,
last_update_login = x_last_update_login,
object_type = x_object_type,
tablespace_name = x_tablespace_name,
initial_extent_size_kb = x_initial_extent_size_kb,
next_extent_size_kb = x_next_extent_size_kb,
max_extents = x_max_extents,
pct_increase = x_pct_increase,
pct_free = x_pct_free,
description = x_description
WHERE
rowid = x_rowid;
END Update_Row;
PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
BEGIN
DELETE FROM GL_STORAGE_PARAMETERS
WHERE rowid = X_Rowid;
END Delete_Row;
/* Update/Insert only if force_edits is 'Y' or user_id is 1 or 2 */
if ( user_id IN (1,2) OR x_force_edits = 'Y' ) then
begin
/* Check if the row exists in the database. If it does, retrieves
the creation date for update_row. */
select creation_date,rowid
into v_creation_date, v_rowid
from gl_storage_parameters
where object_name = x_object_name;
gl_storage_parameters_pkg.update_row (
x_rowid => v_rowid,
x_object_name => x_object_name,
x_last_update_date => sysdate,
x_last_updated_by => user_id,
x_creation_date => v_creation_date,
x_created_by => user_id,
x_last_update_login => 0,
x_object_type => x_object_type,
x_tablespace_name => x_tablespace_name ,
x_initial_extent_size_kb => x_initial_extent_size_kb,
x_next_extent_size_kb => x_next_extent_size_kb,
x_max_extents => x_max_extents,
x_pct_increase => x_pct_increase,
x_pct_free => x_pct_free,
x_description => x_description
);
gl_storage_parameters_pkg.insert_row (
x_rowid => v_rowid ,
x_object_name => x_object_name,
x_last_update_date => sysdate,
x_last_updated_by => user_id,
x_creation_date => sysdate,
x_created_by => user_id,
x_last_update_login => 0,
x_object_type => x_object_type,
x_tablespace_name => x_tablespace_name ,
x_initial_extent_size_kb => x_initial_extent_size_kb,
x_next_extent_size_kb => x_next_extent_size_kb,
x_max_extents => x_max_extents,
x_pct_increase => x_pct_increase,
x_pct_free => x_pct_free,
x_description => x_description
);
/* Update only if force_edits is 'Y' or if user id is 1 or 2 */
if ( user_id IN (1,2) OR x_force_edits = 'Y' ) then
UPDATE gl_storage_parameters
SET
description = x_description,
last_update_date = sysdate,
last_updated_by = user_id,
last_update_login = 0
WHERE object_name = x_object_name
AND USERENV('LANG') =
( SELECT language_code
FROM FND_LANGUAGES
WHERE installed_flag = 'B' );