- declare
- cursor curr_cur is select * from emp;
- type emp_tab is table of curr_cur%rowtype;
- emp_array emp_tab;
- errors number;
- dml_errors exception;
- pragma exception_init(dml_errors,-24381);
- begin
- open curr_cur;
- loop
- fetch curr_cur bulk collect into emp_array limit 35;
- forall i in emp_array.first..emp_array.last save exceptions
- insert into emp_temp3 values emp_array(i);
- exit when curr_cur%notfound;
- end loop;
- close curr_cur;
- exception
- when dml_errors then
- errors:=sql%bulk_exceptions.count;
- dbms_output.put_line('number of statements failed are '||errors);
- for i in 1..errors loop
- dbms_output.put_line('error #'||i|| ' is occured during '|| 'iterations #' ||sql%bulk_exceptions(i).error_index);
- dbms_output.put_line('error message is ' || SQLERRM(-sql%bulk_exceptions(i).error_code));
- end loop;
- end;
- /
Friday, 11 March 2016
Bulk binds with error handling
Subscribe to:
Post Comments (Atom)
Query to find request set and its responsibility
SELECT FA.application_name, fr.responsibility_name program_attached_to, frg.request_group_name, fcp.request_set_name,...
-
--Open PO query. SELECT pha.segment1 ponumber, hou.name organization_code, pha.type_lookup_code potype, trunc(pha.cre...
-
--Query used to display the Order details and its invoice details select ooh.ORDER_NUMBER "Order Number" , ra.C...
-
-- Open PO Receipts. SELECT h.receipt_num ,h.shipment_header_id ,l.SHIPMENT_LINE_STATUS_CODE ,pha.segment1 PO_N...
No comments:
Post a Comment