DECLARE -- Non-scalar parameters require additional processing p_errors arp_trx_validate.message_tbl_type; CURSOR cur_t IS SELECT l.customer_trx_id, l.trx_number FROM ra_customer_trx_all l WHERE l.org_id = 122; l_return_status VARCHAR2(3000); l_msg_count NUMBER; l_msg_data VARCHAR2(3000); BEGIN mo_global.init('AR'); mo_global.set_policy_context('S', 122); fnd_global.apps_initialize(user_id => 0, resp_id => 50757, resp_appl_id => 222); FOR rec_t IN cur_t LOOP -- Call the procedure ar_invoice_api_pub.delete_transaction(p_api_name => 'cux_delete_txn', p_api_version => 1, p_customer_trx_id => rec_t.customer_trx_id, p_return_status => l_return_status, p_msg_count => l_msg_count, p_msg_data => l_msg_data, p_errors => p_errors); IF l_return_status <> 'S' THEN dbms_output.put_line('trx:' || rec_t.trx_number); dbms_output.put_line('trx1:' || rec_t.customer_trx_id); dbms_output.put_line('E:' || cux_util.dump_error_stack); END IF; END LOOP; --FOR rec_t IN cur_t LOOP END; /*SELECT COUNT(1) FROM ra_customer_trx_all l WHERE l.org_id = 122; */