Re: passing PL/SQL variables to SQL PLUS

From: mariusz <on_at_wp.pl>
Date: Wed, 3 Apr 2002 14:53:59 +0100
Message-ID: <a8eu4a$hdv$1_at_news.tpi.pl>


You can't write--> values <-- before (Select.....!!!

Uzytkownik "Eva Haiden" <eva.haiden_at_engnetworld.com> napisal w wiadomosci news:52046b21.0204021330.5011bd38_at_posting.google.com...
> Dear Oracle users,
>
> I am trying to receive information from the user via accept and
> prompt. Then I would like to insert this information into a table, but
> before I do that I have to find out the max value of the id field. How
> can I do this?
>
> verify off
> feedback off
> echo off
>
> accept firstName prompt 'Enter the first name: '
> accept lastName prompt 'Enter last name: '
>
> insert into names
> (id,
> first_name,
> last_name)
> values
> (select max(id) + 1 from names, -- does not work, how can I do this?
> &firstName,
> &lastName);
>
> We don't have and do not want to install a sequence on the id column.
>
> Please help!
>
> Thank you,
> Eva
Received on Wed Apr 03 2002 - 15:53:59 CEST

Original text of this message