Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL%ROWCOUNT in an implicit cursor.
First of all, you really don't have and implicit cursor. C is your explicit cursor. C%rowcount is what you would use. But this technique will most likely lead to the dreaded ORA-01555 error, so I really suggest that you don't do this. Committing every 20 records is extreme. Use the sqlplus copy command instead if you can.
-- Robert Fazio, Oracle DBA rfazio_at_home.com remove nospam from reply address http://24.8.218.197/ "Em Pradhan" <empradhan_at_dplus.net> wrote in message news:393A5D98.81C8AF57_at_dplus.net...Received on Sun Jun 04 2000 - 00:00:00 CDT
> Hi
>
> Use a temporary variable
>
> temp_num := 0;
>
> for C in (
> select * from Y)
> loop (
> insert into Z
>
> if mod(temp_num,20) = 0 then
> commit;
> end if;
>
> temp_num := temp_num + 1;
> )
>
>
> Hope this help
>
> Good luck
>
> pradhan
>
> ken wrote:
>
> > hi there,
> >
> > I need to make a commit every 20 records, the cursor i have which is an
> > implicit one, looks like this:
> >
> > for C in (
> > select * from Y)
> > loop (
> > insert into Z
> > )
> > IF record_inserted = 20
> > commit;
> > End If;
> >
> > How do I code the record_inserted section??? SQL%ROWCOUNT only returns
> > the total number of records in the implicit cursor right?
> >
> > Thanks !!!
> > Gojo.
>
![]() |
![]() |