Re: [Q] sqlplus: How to print '&'

From: Jonathan Gennick <listmail_at_gennick.com>
Date: Mon, 01 Apr 2002 09:09:36 -0500
Message-ID: <qdqgauscmr2dg2vd6t5rds4oovo88g47bb_at_4ax.com>


[Quoted] One solution is to use SET ESCAPE ON to enable escape characters, and then to escape the & character:

SQL> set escape on
SQL> show escape
escape "\" (hex 5c)
SQL> select 'foo \& bar' from dual;

'FOO&BAR'



foo & bar

Another solution is to simply turn off the feature that causes the & to result in a prompt for a value:

SQL> SET DEFINE OFF
SQL> SELECT 'FOO & BAR' FROM DUAL; 'FOO&BAR'



FOO & BAR Jonathan Gennick --- Brighten the corner where you are mailto:jonathan_at_gennick.com
http://Gennick.com * http://MichiganWaterfalls.com * http://ValleySpur.com

On 31 Mar 2002 20:34:46 -0800, kwatch_at_lycos.jp (kwatch) wrote:

>Hi,
>
>I have a question.
>How do I print character '&' in sqlplus?
>
> SQL> select sysdate 'foo & bar' from dual;
> Enter value for bar:
> old 1: select sysdate 'foo & bar' from dual
> new 1: select sysdate 'foo ' from dual
> select sysdate 'foo ' from dual
> *
> ERROR at line 1:
> ORA-00923: FROM keyword not found where expected
>
>
>I tried "&", '\&', '&&', etc... but I didn't succeed.
>Please teach me the way if you know.
>
>Regards,
>Makoto
Received on Mon Apr 01 2002 - 16:09:36 CEST

Original text of this message