Re: Passing parameters to sql*plus ??

From: Dara Fong <dara_fong_at_internet.uscs.com>
Date: 1996/08/21
Message-ID: <321B2F30.44B7_at_internet.uscs.com>#1/1


Alexander Moan wrote:
>
> Howdy (or something) !
>
> How do I pass parameters to sqlplus on startup of a script ?
> I have been able to do a workaround to this by using an
> append of define *something* into login.sql from a unix shell-scipt,
> but i don't like this approach.
> Just put an "&" in front of the variable name that you are prompting for
in your script and SQL*PLUS will automatically prompt the user for a value. If you want to word your own prompt, then do the following AT THE BEGINNING of your script (before your declare statement):

accept x prompt "Please enter a value for x: "

declare
y varchar2(50):= &X

.
.
.

begin
end;

Hope this helps...

Dara Fong Received on Wed Aug 21 1996 - 00:00:00 CEST

Original text of this message