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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Loop to fill db with dummy data

Re: Loop to fill db with dummy data

From: Bricklen Anderson <bricklen_at_shaw.ca>
Date: Mon, 08 Apr 2002 18:16:14 GMT
Message-ID: <3CB1DD9B.75AF7C5D@shaw.ca>


inserted 1000 when I ran it.

How do you figure it would only do 500?

SQL>create table performance (id number, other_col varchar2(20));

Table created.

Elapsed: 00:00:00.01

SQL>DECLARE
  2 x NUMBER := 0;
  3 BEGIN
  4 FOR i IN 1..1000 LOOP
  5 INSERT INTO performance values(x,'x');   6 x := x+1;
  7 END LOOP;
  8 END;
  9 /

PL/SQL procedure successfully completed.

Elapsed: 00:00:01.52
SQL>select count(*) from performance;

  COUNT(*)


      1000

1 row selected.

Knut Talman wrote:
>
> > DECLARE
> > x NUMBER := 0;
> > BEGIN
> > FOR i IN 1..1000 LOOP
> > INSERT INTO performance values(x,'x');
> > x := x+1;
>
> That'll only insert 500 records.
>
> > END LOOP;
> > END;
> > /
>
> Regards,
>
> Knut
Received on Mon Apr 08 2002 - 13:16:14 CDT

Original text of this message

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