The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT event_num, event_type, organization_id
FROM pa_billing_orig_events_v oe
-- Add a WHERE clause if needed. Example:
-- ,pa_billing_assignments ba
-- WHERE ba.billing_assignment_id = oe.billing_assignment_id
-- AND ba.billing_extension_id = X_extn_id
;
SELECT sum(nvl(revenue_amount,0))
INTO revenue
FROM pa_billing_rev_transactions_v;
SELECT sum(nvl(bill_amount,0))
INTO invoice
FROM pa_billing_inv_transactions_v;
pa_billing_pub.Insert_Event (X_rev_amt => L_amount_to_accrue,
X_bill_amt => L_amount_to_bill,
X_project_id => X_project_id,
X_event_type => L_event_type,
X_top_task_id => X_top_task_id,
X_organization_id => L_organization_id,
X_completion_date => SYSDATE,
X_event_num_reversed => L_event_num_reversed,
X_status => l_status,
X_error_message => l_error_message);
pa_billing_PUB.Insert_Event (
X_rev_amt => L_amount_to_accrue,
X_bill_amt => L_amount_to_bill,
X_event_description => '',
X_event_num_reversed => L_event_num_reversed,
X_status => l_status,
X_error_message => l_error_message);
pa_billing_pub.Insert_Message(X_inserting_procedure_name =>'MyProcName',
X_message => 'Error Message',
X_status => l_status,
X_error_message => l_error_message);