/ Published in: PL/SQL
Reads rows from a source table using BULK COLLECT and LIMIT, then puts them in another collection (presumably with a different layout structure), then loads them to your destination table.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
local_coll source_coll_t; bulk_errors EXCEPTION; OPEN source_cur; loop_count := 0; /* ****** Your extra processing here ****** */ loop_count := loop_count + 1; source_coll(rec_count + idx) := local_coll(idx); /* ****** Your extra processing here ****** */ /* ****** Column definitions must match exactly! ****** */ rec_count := rec_count + loop_count; CLOSE source_cur; WHEN bulk_errors /* The index value in the binding array that caused the error. */ /* The error code that was raised. Warning! Oracle stores this as a positive, not negative value. */ /* ADD A BETTER ERROR-HANDLER HERE SO THEY ACTUALLY GET SEEN! */ rec_count); DBMS_OUTPUT.put_line('OTHER EXCEPTION IN load_my_recs. loop count: ' || loop_count || '. Total count: ' || rec_count); END load_my_recs;