Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Problems with PL/SQL

Re: Problems with PL/SQL

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Tue, 15 Aug 2000 15:53:40 -0400
Message-ID: <39999FC4.E5BF6B79@Unforgetable.com>

Klaus Zeuch wrote:
>
> Sorry,
>
> I forgot: cursor-attributes like %rowcount are not available in FOR <record>
> IN <SELECT-Statement> loops;
> use a counter inside the loop and use the mod-function against this counter:
>
> either
>
> declare
> v_count number := 0;
> begin
> for v_c1 in (select * from table_source) loop
> insert into table_dest values (v_c1.column_name1,
> v_c1.column_name2,.....);
> v_count := v_count + 1;
> if mod(v_count,1000) = 0 then
> commit;
> end if;
> end loop;
> commit;
> end;
>
> Klaus

Logically this will work, but it will probably also generate a "snapshot too old" error if the number of rows is sufficiently large. Received on Tue Aug 15 2000 - 14:53:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US