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 12:50:08 -0500
Message-ID: <20040218175008.GA11232@mladen.wangtrading.com>


Comments inline.

On 02/18/2004 12:30:52 PM, Maryann Atkinson 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?

Yes.

>
> COL MYPARM NEW_VALUE MYPARM NOPRINT
> COL RESPONSE NEW_VALUE RESPONSE NOPRINT
>
> BEGIN
> DBMS_Output.Put_Line('MyParm is ' || '&MyParm');
> DBMS_Output.Put_Line('Response is ' || '&Response');
> END;
> /

Actually, it is much simpler then that. You can put "&" variables in the single quotes and everything is peachy. Here is your example, re- worked:
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production

SQL>
SQL> begin
  2 DBMS_Output.Put_Line('MyParm is ' || '&MyParm');   3 DBMS_Output.Put_Line('Response is ' || '&Response');   4 end;
  5 /
Enter value for myparm: Can you hear me now? old 2: DBMS_Output.Put_Line('MyParm is ' || '&MyParm'); new 2: DBMS_Output.Put_Line('MyParm is ' || 'Can you hear me now?');
Enter value for response: Verizon, always working for you. old 3: DBMS_Output.Put_Line('Response is ' || '&Response'); new 3: DBMS_Output.Put_Line('Response is ' || 'Verizon, always working for you.');
MyParm is Can you hear me now?
Response is Verizon, always working for you.

PL/SQL procedure successfully completed.



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:50:08 CST

Original text of this message

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