Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

Re: plsql prompt for input

Mladen Gogala

2004-02-18

Replies:

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@(protected)
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
-----------------------------------------------------------------


©2008 dba.5341.com - Jax Systems, LLC, U.S.A.