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: PL/SQL sequence Help Please !

Re: PL/SQL sequence Help Please !

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 25 Jun 1998 01:23:36 GMT
Message-ID: <3591a64e.1874265@192.86.155.100>


A copy of this was sent to "Mujahid Hamid" <mujahid_at_pharmco.demon.co.uk> (if that email address didn't require changing) On Wed, 24 Jun 1998 20:31:34 +0100, you wrote:

>Hi All,
>
>How can insert values of 1 to 100 into a empty table from a sequence without
>using a cursor.
>
>Is there a way I can insert these vales by simply one or two commands.
>
>Thanks in advance
>
>Muji
>
>
>

assuming all_objects has more then 100 objects in it (safe assumption) then:

insert into some_table ( some_column )
select some_seq.nextval from all_objects where rownum <= 100;

>
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Jun 24 1998 - 20:23:36 CDT

Original text of this message

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