mod function
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.