Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Interaction in sql*plus

Re: Interaction in sql*plus

From: John P. Higgins <jh33378nospam_at_deere.com>
Date: 1997/12/03
Message-ID: <3486383F.1A5E@deere.com>#1/1

You could also do something like:

spool next_step.sql

accept ans prompt "Please enter S for sales or C for cost: "

select decode('&ans','S','@sales','C','@cost','@error') from dual;

spool off

@next_step

This uses the spool file as a temporary area to store the conditional next step.

Robert Prendin wrote:
>
> I hope this is what you're lookinG for...
>
> select * from sales where closed ='&YES_OR_NO:';
> this will automatically prompt you to enter a value..
>
> You could also use
>
> accept par1 prompt "Please enter value(Y or N'):"
> set verify off
> select * from sales where closed='&par1';
>
> Cheers, Robert Prendin
> Casper Thrane <ct_at_benau.dk> wrote:
>
> >Hi!
> >
> >I have seen in other that, there is yes/no questions. If you answer yes
> >then one thing happens and if you answer no another thing happens.
> >How can I accomplish this, in my sql scripts?
> >--
> >Casper Thrane
> >System developer
> >Benau A/S
  Received on Wed Dec 03 1997 - 00:00:00 CST

Original text of this message

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