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: Maryann Atkinson <maryann_30_at_yahoo.com>
Date: Wed, 18 Feb 2004 12:30:52 -0500
Message-Id: <5.2.1.1.2.20040218122714.01a465f0@pop.netaddress.com>


Jared, if I enter two numeric values on script below, everything works ok, but if I answer y for the response, then it tells me identified y must be declared. See anything wrong?

COL MYPARM NEW_VALUE MYPARM NOPRINT
COL RESPONSE NEW_VALUE RESPONSE NOPRINT PROMPT PLEASE ENTER MYPARM: SET TERM OFF FEED OFF
     SELECT '&1' MYPARM FROM DUAL;
SET TERM ON FEED ON PROMPT Is the value correct?(Y/N):

SET TERM OFF FEED OFF
     SELECT '&1' RESPONSE FROM DUAL;
SET TERM ON FEED ON DECLARE

      MyParm       VARCHAR2(20);
      Response     VARCHAR2(1);
BEGIN
       DBMS_Output.Put_Line('MyParm   is ' || &MyParm);
       DBMS_Output.Put_Line('Response is ' || &Response);
END;
/

At 10:18 AM 2/18/2004, you wrote:
>Oh well, guess I could've looked at the manual. :)
>Or the original poster could have. ;)
>I personally prefer:
>col myparm new_value myparm noprint
>prompt Please enter MYPARM:
>set term off feed off
>select '&1' myparm from dual;
>set term on feed on
>...
>undef 1
>
> > > SET VERIFY OFF
> > > ACCEPT Emp_ID Prompt 'Please Enter the Employee ID > '
> > >
> > > DECLARE
> > > Response VARCHAR2(1);
> > >
> > > BEGIN
> > >
> > > DBMS_Output.Put_Line('Employee ID entered is ' || &Emp_ID
> > > || '. Is this correct?(Y/N)');
> > >
> > > Response := &&Response;
> > > DBMS_Output.Put_Line('Response is ' || Response);
> > > END;
> > > /
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > ----------------------------------------------------------------
> > > 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
> > > -----------------------------------------------------------------
> > >
> > >
> > >
> > >
> > > ----------------------------------------------------------------
> > > 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
> > > -----------------------------------------------------------------
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail SpamGuard - Read only the mail you want.
> > http://antispam.yahoo.com/tools
> > ----------------------------------------------------------------
> > 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
> > -----------------------------------------------------------------
>
>----------------------------------------------------------------
>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
>-----------------------------------------------------------------



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 - 11:30:52 CST

Original text of this message

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