Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: plsql problem
Himansu wrote:
>
> Hi Everybody !
>
> I've a problem in Pl/sql...I don't know if it is possible too.
>
> I want to enter suppose 10 records into a table from sql*Plus in
> interactive mode...I want it to ask me each time the fields of the new
> record and enter it into the table.
> I tried it with loops(both for and while)in pl/sql blocks and also in
> Procedures.
> What happens is that after I entered the first record, it enters that
> record 10 times(if there is not a primary key in the table)in stead of
> asking me for giving the field values of another record.
> Pls help me soon...
>
> Thanks in advance...
you dont need pl/sql
make it with pure sql, if I got you right, what you are trying to do.
SQL>insert into tablename
select &field1, &field2, sequence.nextval, &whatever_you_want from dual;
its then asks you for the &-variables.
if you use && it asks just one time and reuses the values.
you can set verify off, if you dont want to see the verification
SQL>set verify off Received on Fri Oct 19 2001 - 08:12:50 CDT