Re: Need Help!

From: Christopher Beck <christopher.beck_at_oracle.com>
Date: Wed, 26 Jun 2002 11:39:46 -0400
Message-ID: <I6lS8.5$6h7.106_at_news.oracle.com>


how about just looping from start to finish???

declare
  start1 number := 200;
  start2 number := 450;
  end1 number := 300;
  end2 number := 650;
begin

for i in start1 .. end1 loop
  insert into table T values ( i );
end loop;

for i in start2 .. end2 loop
  insert into table T values ( i );
end loop;

end;
/

hope this helps.

chris.

--
Christopher Beck, Principal Technologist, Oracle Corporation
christopher.beck_at_oracle.com
Beginning Oracle Programming,
http://www.amazon.com/exec/obidos/ASIN/186100690X


"Amy" <qdsun2001_at_yahoo.com> wrote in message
news:c95702b.0206260519.147bfd54_at_posting.google.com...

> Hi Everybody,
> I need help in writing a PL/SQL program.
>
> There are two sets of number : 200 - 300, 450 - 650. I want to
> insert each number to each row of a table that has 300 rows. Let's
> say, the 1st row get 200, the 2nd row get 201, the 3rd row get 202
> etc.
>
> Do you think I can create two sequences so that once one sequence is
> used up I can drop the first sequence and start use the second
> sequence? Is there any procedure or function that makes a sequence
> adaptable if the number series changes?
>
> Thank you for your help
>
> Amy
Received on Wed Jun 26 2002 - 17:39:46 CEST

Original text of this message