Home » SQL & PL/SQL » SQL & PL/SQL » Search through Wild Card character
Search through Wild Card character [message #323007] Tue, 27 May 2008 01:05 Go to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hello,
How i search for 'xy_cv' type data through a sql querry.
I write the search criteria inside DECODE statement.

select * from test1 where name like DECODE('&x','_','%\_%' escape '\','%scott%')


I get following error message.

Error Meassage:
ORA-00907: missing right parenthesis

Thanks.


[Mod-edit: Frank corrected code-tag. (wrong slash in closing tag)]

[Updated on: Tue, 27 May 2008 01:09] by Moderator

Report message to a moderator

Re: Search through Wild Card character [message #323009 is a reply to message #323007] Tue, 27 May 2008 01:12 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Move the escape to outside the decode like this:

select * from test1 where name like DECODE('&x', '_', '%\_%', '%scott%') escape '\'

[Updated on: Tue, 27 May 2008 01:12]

Report message to a moderator

Re: Search through Wild Card character [message #323010 is a reply to message #323007] Tue, 27 May 2008 01:26 Go to previous message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Thanks Frank
Actually such a problem ,i faced first time.

Again Thanks
Previous Topic: Extract in csv format in Oracle SQL
Next Topic: Search with special character ('%')
Goto Forum:
  


Current Time: Sat Dec 03 13:50:22 CST 2016

Total time taken to generate the page: 0.14707 seconds