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

From: Clara <claramag_at_yahoo.com>
Date: Mon, 1 Apr 2002 16:32:47 +0100
Message-ID: <a89uls$tqv$1_at_venus.telepac.pt>


You can also use the ASCII char (chr(38))

SQL> select to_char(chr(38)) from dual;

T
-
&

Clara

Tony <tony_at_mebius-kb.kiev.ua> wrote in message news:a89381$47f$1_at_mail.mebius.kiev.ua...
>
> "kwatch" <kwatch_at_lycos.jp> wrote in message
> news:cf674456.0203312034.460031c9_at_posting.google.com...
> > 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
>
> Try this:
>
> SQL> set escape ^
> SQL> select sysdate "foo &^ bar" from dual;
>
> foo & bar
> ---------
> 01-APR-02
>
>
>
>
Received on Mon Apr 01 2002 - 17:32:47 CEST

Original text of this message