Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

mod function

238039Dec 11 2002
hi,

i am trying to commit for every 1000 records.

how to use mod function in following script?



DECLARE
v NUMBER;
counter NUMBER;

CURSOR r1 IS SELECT * FROM TAB1;

BEGIN

FOR c1 IN r1 LOOP

v:=c1.ssn_id;
counter := counter + 1;

IF MOD(counter,1000 ) = 0 THEN
dbms_output.put_line(v);
commit;
dbms_output.put_line(counter);
counter := 0;
END IF;
END LOOP;
END;


could anyone help me for commiting every 1000th record.

thanks in Advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2003
Added on Dec 11 2002
4 comments
517 views