The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT DISTINCT aeh.application_id APPLICATION_ID
,xcl.entity_code ENTITY_CODE
,xcl.event_class_code EVENT_CLASS_CODE
,xatr.reporting_view_name REPORTING_VIEW_NAME
FROM xla_ae_headers aeh
,xla_event_types_b xcl
,xla_event_class_attrs xatr
WHERE xcl.application_id = aeh.application_id
AND xcl.event_type_code = aeh.event_type_code
AND xatr.application_id = aeh.application_id
AND xatr.entity_code = xcl.entity_code
AND xatr.event_class_code = xcl.event_class_code
AND aeh.ledger_id = p_ledger_id
AND aeh.application_id = p_application_id
AND aeh.accounting_date < p_end_date
AND xatr.event_class_group_code =
nvl(p_process_category_code, xatr.event_class_group_code);
(SELECT xid.transaction_id_col_name_1 trx_col_1
,xid.transaction_id_col_name_2 trx_col_2
,xid.transaction_id_col_name_3 trx_col_3
,xid.transaction_id_col_name_4 trx_col_4
,xid.source_id_col_name_1 src_col_1
,xid.source_id_col_name_2 src_col_2
,xid.source_id_col_name_3 src_col_3
,xid.source_id_col_name_4 src_col_4
,xem.column_name column_name
,xem.column_title PROMPT
,utc.data_type data_type
FROM xla_entity_id_mappings xid
,xla_event_mappings_vl xem
,user_tab_columns utc
WHERE xid.application_id = cur_trx.application_id
AND xid.entity_code = cur_trx.entity_code
AND xem.application_id = cur_trx.application_id
AND xem.entity_code = cur_trx.entity_code
AND xem.event_class_code = cur_trx.event_class_code
AND utc.table_name = cur_trx.reporting_view_name
AND utc.column_name = xem.column_name
ORDER BY xem.user_sequence)
LOOP
l_index := l_index + 1;
||cur_trx.event_class_code||''' THEN ( SELECT '||l_col_string
||' FROM '||l_view_name ||' WHERE '|| l_join_string ||' )' ;
' SELECT xec.event_class_code EVENT_CLASS_CODE
,xec.name EVENT_CLASS
,xgl.ledger_id LEDGER_ID
,xgl.name LEDGER
,lk1.meaning ACTUAL
,lk2.meaning BUDGET
,lk3.meaning ENCUMBRANCE
,DECODE(xah.balance_type_code,''A''
,xah.accounting_entry_status_code) ACTUAL_B
,DECODE(xah.balance_type_code,''B''
,xah.accounting_entry_status_code) BUDGET_B
,DECODE(xah.balance_type_code,''E''
,xah.accounting_entry_status_code) ENCUMBRANCE_B
FROM xla_ae_headers xah
,xla_gl_ledgers_v xgl
,xla_event_classes_tl xec
,xla_event_types_b xet
,xla_subledgers xls
,xla_lookups lk1
,xla_lookups lk2
,xla_lookups lk3
WHERE xgl.ledger_id = xah.ledger_id
AND xec.application_id = xet.application_id
AND xec.event_class_code = xet.event_class_code
AND xec.language = USERENV(''LANG'')
AND xet.application_id = xah.application_id
AND xet.event_type_code = xah.event_type_code
AND xls.application_id = xah.application_id
AND lk1.lookup_type = ''XLA_BALANCE_TYPE''
AND lk1.lookup_code = ''A''
AND lk2.lookup_type = ''XLA_BALANCE_TYPE''
AND lk2.lookup_code = ''B''
AND lk3.lookup_type = ''XLA_BALANCE_TYPE''
AND lk3.lookup_code = ''E'' ';
' SELECT xgl.name LEDGER
,xgl.ledger_id LEDGER_ID
,lk1.meaning ACCRUAL_ENTRY
,lk2.meaning MPA_ACCRUAL_ENTRY
,lk3.meaning MPA_RECOGNITION_ENTRY
,lk4.meaning ACCRUAL_REVERSAL_ENTRY
,SUM(CASE WHEN xal.mpa_accrual_entry_flag = ''Y'' THEN 1
ELSE 0
END) MPA_ACCRUAL
,SUM(CASE WHEN xah.parent_ae_header_id IS NOT NULL
AND xah.parent_ae_line_num IS NOT NULL THEN 1
ELSE 0
END) MPA_RECOGNITION
,SUM(CASE WHEN xah.accrual_reversal_flag = ''Y'' THEN 1
ELSE 0
END) ACCRUAL
,SUM(CASE WHEN xah.parent_ae_header_id IS NOT NULL
AND xah.parent_ae_line_num IS NULL THEN 1
ELSE 0
END) ACCRUAL_REVERSAL
FROM xla_ae_headers xah
,xla_ae_lines xal
,xla_gl_ledgers_v xgl
,xla_subledgers xls
,xla_lookups lk1
,xla_lookups lk2
,xla_lookups lk3
,xla_lookups lk4
WHERE xgl.ledger_id = xah.ledger_id
AND xah.gl_transfer_status_code = ''Y''
AND xal.application_id = xah.application_id
AND xal.ae_header_id = xah.ae_header_id
AND lk1.lookup_type = ''XLA_MPA_TYPE''
AND lk1.lookup_code = ''A''
AND lk2.lookup_type = ''XLA_MPA_TYPE''
AND lk2.lookup_code = ''M''
AND lk3.lookup_type = ''XLA_MPA_TYPE''
AND lk3.lookup_code = ''R''
AND lk4.lookup_type = ''XLA_MPA_TYPE''
AND lk4.lookup_code = ''V''
AND xls.application_id = xah.application_id ';
' SELECT ERR.MESSAGE_NUMBER ERROR_NO
,ERR.ENCODED_MSG ERROR_MSG
,ERR.AE_LINE_NUM LINE_NUM
FROM XLA_ACCOUNTING_ERRORS ERR
,XLA_AE_HEADERS XAH
,xla_subledgers XLS
WHERE err.ae_header_id = xah.ae_header_id
AND err.application_id = xah.application_id
AND xls.application_id = xah.application_id ';
' SELECT xah.event_id event_id
,xec.name event_class
,xet.name event_type
,xae.event_number event_number
,to_char(xae.event_date,''YYYY-MM-DD'')
event_date
,xah.ae_header_id ae_header_id
,gld.name ledger
,to_char(xah.accounting_date,''YYYY-MM-DD'')
gl_date
,gld.currency_code ledger_currency
,xpr.name aad_name
,xah.product_rule_version aad_version
,xah.description description
,lk1.meaning journal_entry_status
,lk3.meaning mpa_type
,seqv2.header_name acounting_sequence_name
,seqv2.version_name acounting_sequence_version
,xah.completion_acct_seq_value accounting_sequence_number
,seqv3.header_name reporting_sequence_name
,seqv3.version_name reporting_sequence_version
,xah.close_acct_seq_value reporting_sequence_number
,seq.name document_sequence_name
,xah.doc_sequence_value document_sequence_value
,xal.ae_line_num ae_line_num
,lk2.meaning accounting_class
,xal.displayed_line_number line_number
,fnd_flex_ext.get_segs(''SQLGL'', ''GL#'',
gld.chart_of_accounts_id, xal.code_combination_id) account
,xal.currency_code currency
,xal.entered_dr entered_debit
,xal.entered_cr entered_credit
,xal.accounted_dr accounted_debit
,xal.accounted_cr accounted_credit
,sum(xal.accounted_dr) over (partition by xal.ae_header_id)
total_accted_debits
,sum(xal.accounted_cr) over (partition by xal.ae_header_id)
total_accted_credits ';
' SELECT xah.event_id event_id
,xec.name event_class
,xet.name event_type
,xae.event_number event_number
,to_char(xae.event_date,''YYYY-MM-DD'')
event_date
,xah.ae_header_id ae_header_id
,gld.name ledger
,TO_CHAR(xah.accounting_date,''YYYY-MM-DD'')
gl_date
,gld.currency_code ledger_currency
,xpr.name aad_name
,xah.product_rule_version aad_version
,xah.description description
,lk1.meaning journal_entry_status
,lk3.meaning mpa_type
,seqv2.header_name acounting_sequence_name
,seqv2.version_name acounting_sequence_version
,xah.completion_acct_seq_value accounting_sequence_number
,seqv3.header_name reporting_sequence_name
,seqv3.version_name reporting_sequence_version
,xah.close_acct_seq_value reporting_sequence_number
,seq.name document_sequence_name
,xah.doc_sequence_value document_sequence_value
,xal.ae_line_num ae_line_num
,lk2.meaning accounting_class
,xal.displayed_line_number line_number
,fnd_flex_ext.get_segs(''SQLGL'', ''GL#'',
gld.chart_of_accounts_id, xal.code_combination_id) account
,xal.currency_code currency
,xal.entered_dr entered_debit
,xal.entered_cr entered_credit
,xal.accounted_dr accounted_debit
,xal.accounted_cr accounted_credit
,sum(xal.accounted_dr) over (partition by xal.ae_header_id)
total_accted_debits
,sum(xal.accounted_cr) over (partition by xal.ae_header_id)
total_accted_credits ';
' SELECT xah.event_id event_id
,xec.name event_class
,xet.name event_type
,xae.event_number event_number
,to_char(xae.event_date,''YYYY-MM-DD'')
event_date
,xah.ae_header_id ae_header_id
,gld.name ledger
,to_char(xah.accounting_date,''YYYY-MM-DD'')
gl_date
,gld.currency_code ledger_currency
,xpr.name aad_name
,xah.product_rule_version aad_version
,xah.description description
,lk1.meaning journal_entry_status
,lk3.meaning mpa_type
,seqv2.header_name acounting_sequence_name
,seqv2.version_name acounting_sequence_version
,xah.completion_acct_seq_value accounting_sequence_number
,seqv3.header_name reporting_sequence_name
,seqv3.version_name reporting_sequence_version
,xah.close_acct_seq_value reporting_sequence_number
,seq.name document_sequence_name
,xah.doc_sequence_value document_sequence_value
,xal.ae_line_num ae_line_num
,lk2.meaning accounting_class
,xal.displayed_line_number line_number
,fnd_flex_ext.get_segs(''SQLGL'', ''GL#'',
gld.chart_of_accounts_id, xal.code_combination_id) account
,xal.currency_code currency
,xal.entered_dr entered_debit
,xal.entered_cr entered_credit
,xal.accounted_dr accounted_debit
,xal.accounted_cr accounted_credit
,sum(xal.accounted_dr) over (partition by xal.ae_header_id)
total_accted_debits
,sum(xal.accounted_cr) over (partition by xal.ae_header_id)
total_accted_credits
,err.message_number error_number
,err.encoded_msg error_message ';
SELECT name
INTO l_ledger
FROM gl_ledgers
WHERE ledger_id = p_ledger_id;
SELECT meaning
INTO l_create_accounting_flag
FROM xla_lookups
WHERE lookup_type = 'XLA_YES_NO'
AND lookup_code = p_accounting_flag;
SELECT gjst.user_je_source_name
INTO l_source_application
FROM xla_subledgers xls, gl_je_sources_tl gjst
WHERE xls.application_id = p_source_application_id
AND xls.je_source_name = gjst.je_source_name
AND gjst.language = USERENV('LANG');
SELECT gjst.user_je_source_name
INTO l_je_source
FROM xla_subledgers xls, gl_je_sources_tl gjst
WHERE xls.application_id = p_application_id
AND xls.je_source_name = gjst.je_source_name
AND gjst.language = USERENV('LANG');
select name
into l_process_category_name
from XLA_EVENT_CLASS_GRPS_VL
where application_id = p_application_id
and event_class_group_code = p_process_category;
SELECT meaning
INTO l_report_style
FROM xla_lookups
WHERE lookup_code = 'D'
AND lookup_type = 'XLA_ACCT_TRANSFER_MODE';
SELECT meaning
INTO l_errors_only_flag
FROM xla_lookups
WHERE lookup_code = p_errors_only_flag
AND lookup_type = 'XLA_YES_NO';
SELECT meaning
INTO l_transfer_to_gl_flag
FROM xla_lookups
WHERE lookup_type = 'XLA_YES_NO'
AND lookup_code = p_transfer_flag;
SELECT MEANING
INTO l_post_in_gl_flag
FROM xla_lookups
WHERE lookup_type = 'XLA_YES_NO'
AND lookup_code = p_gl_posting_flag;