The following lines contain the word 'select', 'insert', 'update' or 'delete':
CURSOR batch_size IS SELECT system_batch_size FROM cn_repositories WHERE org_id = x_org_id;
cn_process_audits_pkg.insert_row(x_rowid, x_proc_audit_id, NULL, 'NOT', 'Notification run', NULL, NULL, NULL, NULL, NULL, SYSDATE, NULL, x_org_id);
INSERT INTO cn_not_trx (
not_trx_id,
batch_id,
notified_date,
processed_date,
notification_run_id,
collected_flag,
row_id,
source_trx_id,
source_doc_type,
event_id,
org_id)
SELECT
cn_not_trx_s.NEXTVAL,
FLOOR(cn_not_trx_s.CURRVAL/l_sys_batch_size),
SYSDATE,
rctlgd.gl_date, --AE 02-22-96
x_proc_audit_id,
'N',
rct.rowid,
rct.customer_trx_id,
'AR',
cn_global.inv_event_id,
x_org_id
FROM ra_customer_trx rct,
ra_cust_trx_types rctt,
ra_cust_trx_line_gl_dist rctlgd,
cn_repositories cr
WHERE rct.customer_trx_id = rctlgd.customer_trx_id
AND rct.cust_trx_type_id = rctt.cust_trx_type_id
AND rct.complete_flag = 'Y'
AND rctt.type in ('INV', 'CM','DM')
AND rctlgd.account_class = 'REC'
AND rctlgd.latest_rec_flag = 'Y'
AND rctlgd.gl_date BETWEEN x_start_date AND x_end_date
AND rctlgd.posting_control_id <> -3 --AE 02-22-96
AND rct.set_of_books_id = cr.set_of_books_id --AE 02-21-96
AND cr.repository_id = 100 --AE 02-21-96
AND rct.org_id = x_org_id
AND rctt.org_id = rct.org_id
AND rctlgd.org_id = rctt.org_id
AND cr.org_id = rctlgd.org_id
AND NOT EXISTS (
SELECT 1
FROM cn_not_trx
WHERE source_trx_id = rct.customer_trx_id
AND event_id= cn_global.inv_event_id
AND org_id = x_org_id) ;
INSERT INTO cn_not_trx (
not_trx_id,
batch_id,
notified_date,
processed_date,
notification_run_id,
collected_flag,
row_id,
source_trx_id,
source_doc_type,
event_id,
org_id)
SELECT
cn_not_trx_s.NEXTVAL,
FLOOR(cn_not_trx_s.CURRVAL/l_sys_batch_size),
SYSDATE,
rctlgd.gl_date, --AE 02-22-96
x_proc_audit_id,
'N',
rct.rowid,
rct.customer_trx_id,
'AR',
cn_global.inv_event_id,
x_org_id
FROM ra_customer_trx rct,
ra_cust_trx_types rctt,
ra_cust_trx_line_gl_dist rctlgd,
cn_repositories cr
WHERE rct.customer_trx_id = rctlgd.customer_trx_id
AND rct.cust_trx_type_id = rctt.cust_trx_type_id
AND rct.complete_flag = 'Y'
--AE AND rctt.type in ('INV', 'CM','DM')
AND ((rctt.type IN ('INV','DM')) OR --AE 07-29-96
(rctt.type = 'CM' AND --AE
rct.previous_customer_trx_id IS NOT NULL)) --AE
AND rctlgd.account_class = 'REC'
AND rctlgd.latest_rec_flag = 'Y'
AND rctlgd.gl_date BETWEEN x_start_date AND x_end_date
AND rctlgd.posting_control_id <> -3 --AE 02-22-96
AND rct.set_of_books_id = cr.set_of_books_id --AE 02-21-96
AND cr.repository_id = 100 --AE 02-21-96
AND rct.org_id = x_org_id
AND rctt.org_id = rct.org_id
AND rctlgd.org_id = rctt.org_id
AND cr.org_id = rctlgd.org_id
AND NOT EXISTS (
SELECT 1
FROM cn_not_trx
WHERE source_trx_id = rct.customer_trx_id
AND event_id= cn_global.inv_event_id
AND org_id = x_org_id) ;
cn_process_audits_pkg.update_row(x_proc_audit_id, NULL, SYSDATE, 0,
'Finished notification run: Notified ' || x_trx_count || ' invoices.');
cn_message_pkg.debug('notify_invoices: No rows inserted into CN_NOT_TRX. Possible reason: Transactions have not been posted to GL or they have already been collected.');
fnd_file.put_line(fnd_file.Log, 'notify_invoices: No rows inserted into CN_NOT_TRX. Possible reason: Transactions have not been posted to GL or they have already been collected.');
cn_process_audits_pkg.update_row(X_proc_audit_id, NULL, SYSDATE, SQLCODE,
SQLERRM);