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

From: kwatch <kwatch_at_lycos.jp>
Date: 1 Apr 2002 18:45:45 -0800
Message-ID: <cf674456.0204011845.3bfd3737_at_posting.google.com>


Thank you guys!

I can print '&' with each solution.
And I can escape from suffering :-)

Regards,
kwatch

Jonathan Gennick <listmail_at_gennick.com> wrote in message news:<qdqgauscmr2dg2vd6t5rds4oovo88g47bb_at_4ax.com>...
> 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 Tue Apr 02 2002 - 04:45:45 CEST

Original text of this message