Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Searching for string which has a dollar in it

Y.RamletMar 27 2012 — edited Mar 28 2012
DB version:11.2.0.2

How can I search for strings with dollar character in it?
create table test123 (empname varchar2(25));

insert into test123 values ('JOCE$LN');

insert into test123 values ('KAT$LN');

insert into test123 values ('MANA$BVG');

SQL> select * from test123;

EMPNAME
-------------------------
JOCE$LN
KAT$LN
MANA$BVG

SQL> select * from test123 where empname like 'JOCE\$E';

no rows selected





SQL> select * from test123 where empname like 'JOCE\$L%' escape '\';
select * from test123 where empname like 'JOCE\$L%' escape '\'
                                         *
ERROR at line 1:
ORA-01424: missing or illegal character following the escape character


SQL> select * from test123 where empname like 'JOCE\$%' escape '\';
select * from test123 where empname like 'JOCE\$%' escape '\'
                                         *
ERROR at line 1:
ORA-01424: missing or illegal character following the escape character
This post has been answered by Paul Horth on Mar 27 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2012
Added on Mar 27 2012
4 comments
785 views