The following lines contain the word 'select', 'insert', 'update' or 'delete':
| Procedure insert_row |
| |
+======================================================================*/
PROCEDURE insert_row
(x_rowid IN OUT NOCOPY VARCHAR2
,x_accounting_method_type_code IN VARCHAR2
,x_accounting_method_code IN VARCHAR2
,x_transaction_coa_id IN NUMBER
,x_accounting_coa_id IN NUMBER
,x_enabled_flag IN VARCHAR2
,x_name IN VARCHAR2
,x_description IN VARCHAR2
,x_creation_date IN DATE
,x_created_by IN NUMBER
,x_last_update_date IN DATE
,x_last_updated_by IN NUMBER
,x_last_update_login IN NUMBER)
IS
CURSOR c IS
SELECT rowid
FROM xla_acctg_methods_b
WHERE accounting_method_type_code = x_accounting_method_type_code
AND accounting_method_code = x_accounting_method_code
;
l_log_module := C_DEFAULT_MODULE||'.insert_row';
trace(p_msg => 'BEGIN of procedure insert_row',
p_module => l_log_module,
p_level => C_LEVEL_PROCEDURE);
INSERT INTO xla_acctg_methods_b
(creation_date
,created_by
,accounting_method_type_code
,accounting_method_code
,transaction_coa_id
,accounting_coa_id
,enabled_flag
,last_update_date
,last_updated_by
,last_update_login)
VALUES
(x_creation_date
,x_created_by
,x_accounting_method_type_code
,x_accounting_method_code
,x_transaction_coa_id
,x_accounting_coa_id
,x_enabled_flag
,x_last_update_date
,x_last_updated_by
,x_last_update_login)
;
INSERT INTO xla_acctg_methods_tl
(accounting_method_type_code
,accounting_method_code
,name
,description
,creation_date
,created_by
,last_update_date
,last_updated_by
,last_update_login
,language
,source_lang)
SELECT
x_accounting_method_type_code
,x_accounting_method_code
,x_name
,x_description
,x_creation_date
,x_created_by
,x_last_update_date
,x_last_updated_by
,x_last_update_login
,l.language_code
,USERENV('LANG')
FROM fnd_languages l
WHERE l.installed_flag IN ('I', 'B')
AND NOT EXISTS
(SELECT NULL
FROM xla_acctg_methods_tl t
WHERE t.accounting_method_type_code = x_accounting_method_type_code
AND t.accounting_method_code = x_accounting_method_code
AND t.language = l.language_code);
trace(p_msg => 'END of procedure insert_row',
p_module => l_log_module,
p_level => C_LEVEL_PROCEDURE);
END insert_row;
SELECT last_update_login
,transaction_coa_id
,accounting_coa_id
,enabled_flag
FROM xla_acctg_methods_b
WHERE accounting_method_type_code = x_accounting_method_type_code
AND accounting_method_code = x_accounting_method_code
FOR UPDATE OF accounting_method_type_code NOWAIT;
SELECT accounting_method_type_code
,name
,description
,DECODE(language , USERENV('LANG'), 'Y', 'N') baselang
FROM xla_acctg_methods_tl
WHERE accounting_method_type_code = X_accounting_method_type_code
AND accounting_method_code = X_accounting_method_code
AND USERENV('LANG') IN (language ,source_lang)
FOR UPDATE OF accounting_method_type_code NOWAIT;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
| Procedure update_row |
| |
+======================================================================*/
PROCEDURE update_row
(x_accounting_method_type_code IN VARCHAR2
,x_accounting_method_code IN VARCHAR2
,x_transaction_coa_id IN NUMBER
,x_accounting_coa_id IN NUMBER
,x_enabled_flag IN VARCHAR2
,x_name IN VARCHAR2
,x_description IN VARCHAR2
,x_last_update_date IN DATE
,x_last_updated_by IN NUMBER
,x_last_update_login IN NUMBER)
IS
l_log_module VARCHAR2(240);
l_log_module := C_DEFAULT_MODULE||'.update_row';
trace(p_msg => 'BEGIN of procedure update_row',
p_module => l_log_module,
p_level => C_LEVEL_PROCEDURE);
UPDATE xla_acctg_methods_b
SET
last_update_date = x_last_update_date
,transaction_coa_id = x_transaction_coa_id
,accounting_coa_id = x_accounting_coa_id
,enabled_flag = x_enabled_flag
,last_updated_by = x_last_updated_by
,last_update_login = x_last_update_login
WHERE accounting_method_type_code = X_accounting_method_type_code
AND accounting_method_code = X_accounting_method_code;
UPDATE xla_acctg_methods_tl
SET
last_update_date = x_last_update_date
,name = X_name
,description = X_description
,last_updated_by = x_last_updated_by
,last_update_login = x_last_update_login
,source_lang = USERENV('LANG')
WHERE accounting_method_type_code = X_accounting_method_type_code
AND accounting_method_code = X_accounting_method_code
AND USERENV('LANG') IN (language, source_lang);
trace(p_msg => 'END of procedure update_row',
p_module => l_log_module,
p_level => C_LEVEL_PROCEDURE);
END update_row;
| Procedure delete_row |
| |
+======================================================================*/
PROCEDURE delete_row
(x_accounting_method_type_code IN VARCHAR2
,x_accounting_method_code IN VARCHAR2)
IS
l_log_module VARCHAR2(240);
l_log_module := C_DEFAULT_MODULE||'.delete_row';
trace(p_msg => 'BEGIN of procedure delete_row',
p_module => l_log_module,
p_level => C_LEVEL_PROCEDURE);
DELETE FROM xla_acctg_methods_tl
WHERE accounting_method_type_code = x_accounting_method_type_code
AND accounting_method_code = x_accounting_method_code;
DELETE FROM xla_acctg_methods_b
WHERE accounting_method_type_code = x_accounting_method_type_code
AND accounting_method_code = x_accounting_method_code;
trace(p_msg => 'END of procedure delete_row',
p_module => l_log_module,
p_level => C_LEVEL_PROCEDURE);
END delete_row;
DELETE FROM xla_acctg_methods_tl T
WHERE NOT EXISTS
(SELECT NULL
FROM xla_acctg_methods_b b
WHERE b.accounting_method_type_code = t.accounting_method_type_code
AND b.accounting_method_code = t.accounting_method_code);
UPDATE xla_acctg_methods_tl t
SET (name
,description)
= (SELECT b.name
,b.description
FROM xla_acctg_methods_tl b
WHERE b.accounting_method_type_code = t.accounting_method_type_code
AND b.accounting_method_code = t.accounting_method_code
AND b.language = t.source_lang)
WHERE (t.accounting_method_type_code
,t.accounting_method_code
,t.language)
IN (SELECT subt.accounting_method_type_code
,subt.accounting_method_code
,subt.language
FROM xla_acctg_methods_tl subb
,xla_acctg_methods_tl subt
WHERE subb.accounting_method_type_code = subt.accounting_method_type_code
AND subb.accounting_method_code = subt.accounting_method_code
AND subb.language = subt.source_lang
AND (SUBB.name <> SUBT.name
OR SUBB.description <> SUBT.description
OR (subb.description IS NULL
AND subt.description IS NOT NULL)
OR (subb.description IS NOT NULL
AND subt.description IS NULL)
))
;
INSERT INTO xla_acctg_methods_tl
(accounting_method_type_code
,accounting_method_code
,name
,description
,creation_date
,created_by
,last_update_date
,last_updated_by
,last_update_login
,language
,source_lang)
SELECT /*+ ORDERED */
b.accounting_method_type_code
,b.accounting_method_code
,b.name
,b.description
,b.creation_date
,b.created_by
,b.last_update_date
,b.last_updated_by
,b.last_update_login
,l.language_code
,b.source_lang
FROM xla_acctg_methods_tl b
,fnd_languages l
WHERE l.installed_flag IN ('I', 'B')
AND b.language = userenv('LANG')
AND NOT EXISTS
(SELECT NULL
FROM xla_acctg_methods_tl t
WHERE t.accounting_method_type_code = b.accounting_method_type_code
AND t.accounting_method_code = b.accounting_method_code
AND t.language = l.language_code);
,p_last_update_date IN VARCHAR2
,p_custom_mode IN VARCHAR2)
IS
l_rowid ROWID;
f_ludate DATE; -- entity update date in file
db_ludate DATE; -- entity update date in db
f_ludate := nvl(to_date(p_last_update_date, 'YYYY/MM/DD'), sysdate);
SELECT last_updated_by, last_update_date
INTO db_luby, db_ludate
FROM xla_acctg_methods_tl
WHERE accounting_method_type_code = p_accounting_method_type_code
AND accounting_method_code = p_accounting_method_code
AND language = userenv('LANG');
UPDATE xla_acctg_methods_tl
SET name = p_name
,description = p_description
,last_update_date = f_ludate
,last_updated_by = f_luby
,last_update_login = 0
,source_lang = userenv('LANG')
WHERE userenv('LANG') IN (language, source_lang)
AND accounting_method_type_code = p_accounting_method_type_code
AND accounting_method_code = p_accounting_method_code;
,p_last_update_date IN VARCHAR2)
IS
l_rowid ROWID;
f_ludate DATE; -- entity update date in file
db_ludate DATE; -- entity update date in db
f_ludate := nvl(to_date(p_last_update_date, 'YYYY/MM/DD'), sysdate);
SELECT last_updated_by, last_update_date
INTO db_luby, db_ludate
FROM xla_acctg_methods_vl
WHERE accounting_method_code = p_accounting_method_code
AND accounting_method_type_code = p_accounting_method_type_code;
xla_acctg_methods_f_pkg.update_row
(x_accounting_method_code => p_accounting_method_code
,x_accounting_method_type_code => p_accounting_method_type_code
,x_transaction_coa_id => null
,x_accounting_coa_id => null
,x_enabled_flag => p_enabled_flag
,x_name => p_name
,x_description => p_description
,x_last_update_date => f_ludate
,x_last_updated_by => f_luby
,x_last_update_login => 0);
xla_acctg_methods_f_pkg.insert_row
(x_rowid => l_rowid
,x_accounting_method_code => p_accounting_method_code
,x_accounting_method_type_code => p_accounting_method_type_code
,x_transaction_coa_id => null
,x_accounting_coa_id => null
,x_enabled_flag => p_enabled_flag
,x_name => p_name
,x_description => p_description
,x_creation_date => f_ludate
,x_created_by => f_luby
,x_last_update_date => f_ludate
,x_last_updated_by => f_luby
,x_last_update_login => 0);