DECLARE
l_table_owner varchar2(30) := 'APPS';
l_batch_size varchar2(30) := 10;
l_worker_id number := 1;
l_num_workers number := 10;
l_any_rows_to_process boolean;
l_table_name varchar2(30) := 'SHSEO' ;
l_script_name varchar2(30) := 'shseo3.sql';
l_start_rowid rowid;
l_end_rowid rowid;
l_rows_processed number;
l_total_processed number := 0;
BEGIN
ad_parallel_updates_pkg.initialize_rowid_range(
ad_parallel_updates_pkg.ROWID_RANGE,
l_table_owner,
l_table_name,
l_script_name,
l_worker_id,
l_num_workers,
l_batch_size, 0);
ad_parallel_updates_pkg.get_rowid_range(
l_start_rowid,
l_end_rowid,
l_any_rows_to_process,
l_batch_size,
TRUE);
WHILE (l_any_rows_to_process = TRUE)
LOOP
UPDATE shseo
SET b = b + 200
WHERE rowid BETWEEN l_start_rowid AND l_end_rowid;
l_rows_processed := SQL%rowcount;
l_total_processed := l_total_processed + l_rows_processed ;
ad_parallel_updates_pkg.processed_rowid_range(
l_rows_processed,
l_end_rowid);
--COMMIT;
ad_parallel_updates_pkg.get_rowid_range(
l_start_rowid,
l_end_rowid,
l_any_rows_to_process,
l_batch_size,
FALSE);
END LOOP;
dbms_output.put_line('Successfully updated invoice_flag for '|| to_char(l_total_processed) || ' records in mtl_material_transactions');
EXCEPTION
when others then
rollback;
dbms_output.put_line(to_CHAR(sqlcode)||':'||SQLERRM);
END;
댓글 없음:
댓글 쓰기