脚本示例:
create or replace procedure pro_batch_insert
(
OUT_Return_Code OUT VARCHAR)
IS
BEGIN
for sts in 1 .. 1000
loop
insert into inv(ID, CUSTOMERID)
values(seq_inv_task.nextval,'AA');
end loop;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(SUBSTR(DBMS_UTILITY.format_error_backtrace, 1, 10000));
rollback;
OUT_Return_Code:='999'||SQLerrm || DBMS_UTILITY.format_error_backtrace;
END;