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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: plsql prompt for input

RE: plsql prompt for input

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Wed, 18 Feb 2004 17:38:07 -0800
Message-ID: <B5C5F99D765BB744B54FFDF35F602621033DAEEB@irvmbxw02>


Or
accept response "yes or no (y/n)> "
declare

   x varchar2 (1) ;
begin

   x :=3D ltrim (rtrim (lower ('&response'))) ;    if x =3D 'y'
   then

      execute immediate 'create table ...' ;    end if ;
end ;
/

> -----Original Message-----
> Jonathan Gennick
> ...
> ACCEPT Emp_ID Prompt 'Please Enter the Employee ID > '
> ACCEPT Response Prompt 'Is &Emp_ID correct (y/n)?> '
> @somefile_&Response

>=20

> Ok. The key here is to be sure you have two script files,
> one named somefile_y.sql, and the other named
> somefile_n.sql. The user's y/n response then determines
> which of those files is executed. I don't show it, but there
> are some things you can do to validate that y/n response,
> and make it case-insensitive, if those things are important
> to you.

=20

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Wed Feb 18 2004 - 19:38:07 CST

Original text of this message

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