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

Home -> Community -> Usenet -> c.d.o.server -> Re: Prompting multiples times in PL/SQL??

Re: Prompting multiples times in PL/SQL??

From: sybrandb <sybrandb_at_yahoo.com>
Date: 22 Jun 2006 06:28:33 -0700
Message-ID: <1150982912.376602.85780@m73g2000cwd.googlegroups.com>

qazmlp1209_at_rediffmail.com wrote:
> The Table format is as follows:
>
> SQL> desc MyTEST;
> Name Null? Type
> ----------------------------------------- --------
> ----------------------------
> NAME VARCHAR2(10 CHAR)
>
> I want to add 10 rows into this Table, with each row containing the
> 'name' that I want to enter.
> The following PL/SQL script does not work:
>
> ----------
> declare
> i number;
> begin
> for i in 1..10 loop
> insert into tst (name) values ('&name');
> end loop;
> end;
> ----------
>
> It prompts for the 'name' only once and the same name figures in all
> the rows. But, I want to be prompted 10 times and each time I want to
> enter different 'name'. How exactly I should adapt the PL/SQL script
> for this?

insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');
insert into tst(name) values('&name');


-- 
Sybrand Bakker
Senior Oracle DBA
Received on Thu Jun 22 2006 - 08:28:33 CDT

Original text of this message

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