The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Update_Journal_Entries;
(p_msg => 'Calling the function XLA_BALANCES_PKG.MASSIVE_UPDATE'
,p_level => C_LEVEL_EVENT
,p_module => l_log_module);
XLA_BALANCES_PKG.Massive_Update
(p_application_id => g_application_id
,p_ledger_id => NULL
,p_entity_id => NULL
,p_event_id => NULL
,p_request_id => NULL
,p_accounting_batch_id => g_accounting_batch_id
,p_update_mode => 'A'
,p_execution_mode => 'O');
(p_msg => 'Error encountered in the function XLA_BALANCES_PKG.Massive_Update '
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
print_logfile('Technical problem : Problem in the routine XLA_BALANCES_PKG.Massive_Update');
,p_value_2 => 'Technical problem : Problem in the routine XLA_BALANCES_PKG.Massive_Update');
(p_msg => 'Call to function XLA_BALANCES_PKG.Massive_Update completed.'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
print_logfile('- call to XLA_BALANCES_PKG.Massive_Update completed');
Update_journal_Entries;
xla_accounting_err_pkg.insert_errors;
xla_accounting_err_pkg.insert_errors;
xla_accounting_err_pkg.insert_errors;
Select xla_accounting_batches_s.nextval
into g_accounting_batch_id
from dual;
Select accounting_entry_status_code
from xla_ae_headers
where ae_header_id in (Select /*+ cardinality(XLA_AE_HEADERS_GT,1) */ --bug9174950
ae_header_id from xla_ae_headers_gt)
and application_id = g_application_id
for update nowait;
SELECT DECODE(g_valuation_method_code,NULL,NULL,'and valuation_method = '''||g_valuation_method_code||''' ')||
DECODE(g_security_id_int_1,NULL,NULL,'and security_id_int_1 = '||g_security_id_int_1||' ')||
DECODE(g_security_id_int_2,NULL,NULL,'and security_id_int_2 = '||g_security_id_int_2||' ')||
DECODE(g_security_id_int_3,NULL,NULL,'and security_id_int_3 = '||g_security_id_int_3||' ')||
DECODE(g_security_id_char_1,NULL,NULL,'and security_id_char_1 = '''||g_security_id_char_1||''' ')||
DECODE(g_security_id_char_2,NULL,NULL,'and security_id_char_2 = '''||g_security_id_char_2||''' ')||
DECODE(g_security_id_char_3,NULL,NULL,'and security_id_char_3 = '''||g_security_id_char_3||''' ')
INTO g_security_condition
FROM DUAL;
SELECT DECODE(g_process_category_code,NULL,NULL,'and event_class_group_code = '''||g_process_category_code||'''')
INTO g_process_category_condition
FROM DUAL;
l_stmt := 'INSERT INTO xla_ae_headers_gt
(ae_header_id
,ledger_id
,entity_id
,event_id
,accounting_date
,balance_type_code
,je_category_name
,product_rule_type_code
,product_rule_code
,period_name
,doc_sequence_id
,doc_category_code
,gl_transfer_status_code
,accrual_reversal_flag
,accounting_entry_status_code)
SELECT /*+ INDEX(xah xla_ae_headers_n7) */ xah.ae_header_id
,xah.ledger_id
,xah.entity_id
,xah.event_id
,xah.accounting_date
,xah.balance_type_code
,xah.je_category_name
,xah.product_rule_type_code
,xah.product_rule_code
,xah.period_name
,xah.doc_sequence_id
,xah.doc_category_code
,xah.gl_transfer_status_code
,xah.accrual_reversal_flag
,''F''
FROM xla_ae_headers xah
, xla_ae_headers xah2
, xla_subledgers xs
, xla_event_types_b xet
, xla_event_class_attrs xec
, xla_transaction_entities xte
WHERE xah.application_id = :1
and xah.accounting_date <= :2
and xah.accounting_entry_status_code IN (''I'', DECODE(:3, ''Y'', ''I'', ''N''))
AND xah.application_id = xah2.application_id
AND xah.parent_ae_header_id = xah2.ae_header_id
AND xah2.accounting_entry_status_code = ''F''
AND xs.application_id = xah.application_id
AND xah.ledger_id IN (SELECT xlr.ledger_id -- bug9587265
FROM xla_ledger_options xlo,
xla_ledger_relationships_v xlr
WHERE xlo.application_id = :4
AND xlr.primary_ledger_id = :5
AND xlr.relationship_enabled_flag = ''Y''
AND xlr.ledger_category_code IN ( ''ALC'', ''PRIMARY'', ''SECONDARY'' )
AND DECODE(xlr.ledger_category_code, ''ALC'', xlr.ledger_id, xlo.ledger_id) = xlr.ledger_id
AND DECODE(xlr.ledger_category_code, ''SECONDARY'', xlo.capture_event_flag, ''N'') = ''N''
AND DECODE(xlr.ledger_category_code, ''ALC'', ''Y'', xlo.enabled_flag) = ''Y'')
AND xte.application_id = xah.application_id
AND xte.entity_id = xah.entity_id
AND xte.entity_code <> ''MANUAL''
AND xet.application_id = xah.application_id
AND xet.event_type_code = xah.event_type_code
AND xec.application_id = xet.application_id
AND xec.entity_code = xet.entity_code
AND xec.event_class_code = xet.event_class_code' ||
g_security_condition || ' ' ||
g_process_category_condition;
trace(p_msg => '# lines inserted = '||SQL%ROWCOUNT,
p_module => l_log_module,
p_level => C_LEVEL_STATEMENT);
Update xla_ae_headers
Set accounting_entry_status_code = 'N'
, request_id = g_request_id
, accounting_batch_id = g_accounting_batch_id
, last_update_date = sysdate
, last_updated_by = xla_environment_pkg.g_usr_id
, last_update_login = xla_environment_pkg.g_login_id
Where application_id = g_application_id
and ae_header_id in (Select ae_header_id from xla_ae_headers_gt)
RETURNING ae_header_id BULK COLLECT INTO g_array_ae_header_id; -- 5115223
trace(p_msg => '# lines updated = '||SQL%ROWCOUNT,
p_module => l_log_module,
p_level => C_LEVEL_STATEMENT);
PROCEDURE Update_Journal_Entries
IS
l_log_module VARCHAR2(240);
l_log_module := C_DEFAULT_MODULE||'.Update_Journal_Entries';
(p_msg => 'BEGIN of procedure UPDATE_JOURNAL_ENTRIES'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
UPDATE xla_ae_headers xah
SET accounting_entry_status_code = 'F'
,completed_date = sysdate
WHERE xah.request_id = g_request_id
AND xah.accounting_batch_id = g_accounting_batch_id
AND xah.application_id = g_application_id
AND xah.ae_header_id = g_array_ae_header_id(i)
AND accounting_entry_status_code NOT IN ('I', 'R');
(p_msg => 'Number of headers updated = '||SQL%ROWCOUNT
,p_level => C_LEVEL_PROCEDURE
,p_module => l_log_module);
(p_msg => 'END of procedure UPDATE_JOURNAL_ENTRIES '
,p_level => C_LEVEL_PROCEDURE
,p_module => l_log_module);
,p_token_1 => 'XLA_MULTIPERIOD_ACCOUNTING_PKG.Update_Journal_Entries'
,p_value_1 => 'SLA'
,p_entity_id => NULL
,p_event_id => NULL);
(p_location => 'xla_multiperiod_accounting_pkg.Update_Journal_Entries');
END Update_Journal_Entries;
INSERT INTO xla_events_gt
(application_id
,ledger_id
,entity_id
,entity_code
,event_id)
SELECT /*+ cardinality(H,1) INDEX(t xla_transaction_entities_u1) */ DISTINCT --bug9174950
g_application_id
,g_ledger_id
,h.entity_id
,t.entity_code
,h.event_id
FROM xla_ae_headers_gt h,
xla_transaction_entities t
WHERE h.entity_id = t.entity_id
AND h.ledger_id = t.ledger_id
AND t.application_id = g_application_id
AND t.ledger_id = g_ledger_id;
SELECT xlr.ledger_id BULK COLLECT
INTO l_seq_context_value
FROM xla_ledger_relationships_v xlr
,xla_subledger_options_v xso
WHERE xlr.relationship_enabled_flag = 'Y'
AND xlr.ledger_category_code IN ('ALC','PRIMARY','SECONDARY')
AND DECODE(xso.valuation_method_flag
,'N',xlr.primary_ledger_id
,DECODE(xlr.ledger_category_code
,'ALC',xlr.primary_ledger_id
,xlr.ledger_id)
) = g_ledger_id
AND xso.application_id = g_application_id
AND xso.ledger_id = DECODE(xlr.ledger_category_code
,'ALC',xlr.primary_ledger_id
,xlr.ledger_id)
AND xso.enabled_flag = 'Y';