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: plsql problem

Re: plsql problem

From: <kurti_at_kurti.cc>
Date: Fri, 19 Oct 2001 15:12:50 +0200
Message-ID: <3BD026D2.674F70BD@kurti.cc>


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

Original text of this message

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