Home » SQL & PL/SQL » SQL & PL/SQL » Commit
Commit [message #36512] Sun, 02 December 2001 07:12 Go to next message
kanchan
Messages: 2
Registered: December 2001
Junior Member
I am inserting 10 lac records using a cusrsor.Now i want to commit the record after every 1000 records r inserted......

Please help me.....

----------------------------------------------------------------------
Re: Commit [message #36513 is a reply to message #36512] Sun, 02 December 2001 10:54 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
declare
cursor c1 is ...
n number;
begin
for i in c1 loop -- here i am using cursor
n := n+1;
IF mod(n,1000)=1 THEN
commit;
end if
end loop;
commit;
end;

of you can use following if condition

if mod(c1%rowcount,1000)=1 then
commit;
end if;

SURESH

----------------------------------------------------------------------
Previous Topic: Re: MS SQL
Next Topic: How can send e-mail using a Trigger?
Goto Forum:
  


Current Time: Mon Apr 06 04:31:57 CDT 2020