[Home] [Help]
The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE insert_row(
p_entity_code IN VARCHAR2,
p_entity_name IN VARCHAR2,
p_description IN VARCHAR2,
p_table_name IN VARCHAR2,
p_creation_date IN DATE,
p_created_by IN NUMBER,
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER,
x_rowid IN OUT NOCOPY VARCHAR2)IS
CURSOR C IS
SELECT ROWID
FROM inl_entities_b
WHERE entity_code = p_entity_code ;
l_last_update_date DATE;
l_last_update_date := nvl(to_date(p_last_update_date, 'YYYY/MM/DD'),sysdate);
INSERT INTO inl_entities_b (
entity_code,
table_name,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login)
VALUES (
p_entity_code,
p_table_name,
sysdate,
p_created_by,
sysdate,
p_last_updated_by,
p_last_update_login
);
INSERT INTO inl_entities_tl(
entity_code,
language,
source_lang,
entity_name,
description,
creation_date,
created_by,
last_update_date,
last_updated_by,
last_update_login
) SELECT
p_entity_code,
l.language_code,
userenv('LANG'),
p_entity_name,
p_description,
sysdate,
p_created_by,
sysdate,
p_last_updated_by,
p_last_update_login
FROM FND_LANGUAGES L
WHERE L.INSTALLED_FLAG IN ('I', 'B')
AND NOT EXISTS
(SELECT NULL
FROM inl_entities_tl e
WHERE e.entity_code = p_entity_code
AND e.LANGUAGE = L.LANGUAGE_CODE);
END insert_row;
PROCEDURE update_row (
p_entity_code IN VARCHAR2,
p_entity_name IN VARCHAR2,
p_description IN VARCHAR2,
p_table_name IN VARCHAR2,
p_last_update_date IN DATE,
p_last_updated_by IN NUMBER,
p_last_update_login IN NUMBER) IS
l_last_update_date DATE;
l_last_update_date := nvl(to_date(p_last_update_date, 'YYYY/MM/DD'),sysdate);
UPDATE inl_entities_b SET
table_name = p_table_name,
last_update_date = sysdate,
last_updated_by = p_last_updated_by,
last_update_login = p_last_update_login
WHERE entity_code = p_entity_code;
UPDATE inl_entities_tl SET
entity_name = p_entity_name,
description = p_description,
last_update_date = sysdate,
last_updated_by = p_last_updated_by,
last_update_login = p_last_update_login,
source_lang = userenv('lang')
WHERE entity_code = p_entity_code
AND userenv('LANG') IN (LANGUAGE, SOURCE_LANG);
END update_row;
p_last_update_date IN VARCHAR2) IS
l_owner VARCHAR2(50);
l_last_update_date DATE;
l_last_update_date := nvl(to_date(p_last_update_date, 'YYYY/MM/DD'),sysdate);
UPDATE inl_entities_tl SET
entity_name = p_entity_name,
description = p_description,
last_update_date = sysdate,
last_updated_by = l_owner, --Decode(p_owner,'SEED',1,0),
last_update_login = 0,
source_lang = userenv('LANG')
WHERE entity_code = p_entity_code
AND userenv('LANG') IN (language,source_lang);
p_last_update_date IN VARCHAR2) IS
BEGIN
DECLARE
l_owner VARCHAR2(100);
inl_entities_pkg.update_row(
p_entity_code => p_entity_code,
p_entity_name => p_entity_name,
p_description => p_description,
p_table_name => p_table_name,
p_last_update_date => SYSDATE ,
p_last_updated_by => l_owner,
p_last_update_login => 0);
inl_entities_pkg.insert_row(
p_entity_code => p_entity_code,
p_entity_name => p_entity_name,
p_description => p_description,
p_table_name => p_table_name,
p_creation_date => SYSDATE,
p_created_by => l_owner ,
p_last_update_date => SYSDATE,
p_last_updated_by => l_owner,
p_last_update_login => 0,
x_rowid => l_rowid
);