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: Mladen Gogala <mladen_at_wangtrading.com>
Date: Wed, 18 Feb 2004 13:01:32 -0500
Message-ID: <20040218180132.GA11300@mladen.wangtrading.com>


You can use so called Elsinore Castle version:

begin

dbms_output.put_line('To respond, or not to respond, '||
                     'this is the qeuestion now.');
dbms_output.put_line('Your response:'||'&response');
end;
/

Moral of the story:
There is something rotten in the land of Oracle.

On 02/18/2004 12:48:40 PM, Jose Luis Delgado wrote:
> Change:
> > DBMS_Output.Put_Line('Response is ' || &Response);
>
> to:
>
> DBMS_Output.Put_Line('Response is &Response');
>
> HTH
>
>
> --- Maryann Atkinson <maryann_30_at_yahoo.com> wrote:
> > 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
> >
> -----------------------------------------------------------------
>
>
> __________________________________
> 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
-----------------------------------------------------------------
Received on Wed Feb 18 2004 - 12:01:32 CST

Original text of this message

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