Re: passing PL/SQL variables to SQL PLUS

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Thu, 4 Apr 2002 15:56:45 +0400
Message-ID: <a8hev7$ll3$1_at_babylon.agtel.net>


insert into names
[Quoted]  select max(id) + 1, '&firstName', '&lastName' from names

will work.

--
Vladimir Zakharychev (bob_at_dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


[Quoted] "Eva Haiden" <eva.haiden_at_engnetworld.com> wrote in message
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 Thu Apr 04 2002 - 13:56:45 CEST

Original text of this message