Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Special characters in SQLPlus

Re: Special characters in SQLPlus

From: QuestionExchange <USENET_at_questionexchange.com>
Date: 23 Oct 1999 14:19:53 GMT
Message-ID: <2007qx@questionexchange.com>


> I'm using SQLPlus to submit values to a LONG that contain
symbols
> like &, @, ; and I'm finding that SQLPlus is interpreting
them as
> special characters.
>
> Is there an escape sequence I can use (like \ or ') to get
them
> accepting in my string?
>
> Thanks,
>
> Chris
>
> --
> Chris Forlano
> Automation Development
> Nortel Networks, Maidenhead
> 590 4342 (01628 434 342)
> cforlano_at_nortelnetworks.com
>

Chris,
There should not be too much trouble with '@', '%', ';' That is, the following statements work fine:  insert into test values ('@bla');
 select * from test where name like '@bla'; SQL> insert into test values ('bla%lala'); 1 row created.
SQL> select * from test where name like 'bla\%lala'; no rows selected
SQL> select * from test where name like 'bla\%lala' escape '\'; NAME



bla%lala
Here, the escape proved necessary.
Using the '&' is a little different, howerver. Here sqlplus will require input from the user, and so the work aroud is to turn input off for the time you need it.
SQL> insert into test values ('yadda&yadda'); Enter value for yadda: hun
old 1: insert into test values ('yadda&yadda') new 1: insert into test values ('yaddahun') 1 row created.
SQL> set scan off
SQL> insert into test values ('yadda&yadda'); 1 row created.
SQL> select * from test where name like 'yadda&yadda'; NAME

yadda&yadda
SQL> set scan on
It's the 'set scan [on|off]' that you will need to invoke.
Hope this helps,
Sasha Romanosky

--
  This answer is courtesy of QuestionExchange.com   http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=6106&cus_id=USENET&qtn_id=3995 Received on Sat Oct 23 1999 - 09:19:53 CDT

Original text of this message

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