Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: plsql prompt for input
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
>-----------------------------------------------------------------
-- 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
![]() |
![]() |