Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    20

    Unanswered: Escape character "\"

    Hi All,
    Have a look at the following

    SQL> create table aa (name varchar2(10));

    Table created.

    SQL> insert into aa values('ABC');

    1 row created.

    SQL> insert into aa values('%ABCD');

    1 row created.

    SQL> commit;

    Commit complete.

    SQL> show escape
    escape "\" (hex 5c)

    SQL> select * from aa where name like '\%%';

    NAME
    ----------
    ABC
    %ABCD


    Ideally this query should have returned only "%ABCD".Why the first row "ABC" being returned ? Why is the escape character "\" not working in this case.
    Regards
    Satya

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Escape character "\"

    The SQL Plus ESCAPE character is not used by SQL. You need to do this:

    SQL> select * from aa where name like '\%%' escape '\';

  3. #3
    Join Date
    Jan 2004
    Posts
    20

    Re: Escape character "\"

    Originally posted by andrewst
    The SQL Plus ESCAPE character is not used by SQL. You need to do this:

    SQL> select * from aa where name like '\%%' escape '\';
    Thanks again Tony...
    Regards
    Satya

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •