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
,ent.entity_id NUMBER_OF_DOC
,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_events xae
,xla_event_classes_tl xec
,xla_event_types_b xet
,xla_transaction_entities ent
,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 ent.entity_id = xae.entity_id
AND xet.application_id = xae.application_id
AND xet.event_type_code = xae.event_type_code
AND xae.event_id = xah.event_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 ACTUAL
,lk2.meaning BUDGET
,lk3.meaning ENCUMBRANCE
,sum(decode(xah.balance_type_code,''A'',1,0))
ACTUAL_B
,sum(decode(xah.balance_type_code,''B'',1,0))
BUDGET_B
,sum(decode(xah.balance_type_code,''E'',1,0))
ENCUMBRANCE_B
FROM xla_ae_headers xah
,xla_gl_ledgers_v xgl
,xla_lookups lk1
,xla_lookups lk2
,xla_lookups lk3
WHERE xgl.ledger_id = xah.ledger_id
AND xah.gl_transfer_status_code = ''Y''
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 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
WHERE err.ae_header_id = xah.ae_header_id
AND err.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 ';