Home » SQL & PL/SQL » SQL & PL/SQL » How to escape '
How to escape ' [message #623179] Fri, 05 September 2014 10:11 Go to next message
maitequita
Messages: 1
Registered: September 2014
Location: Uurguay
Junior Member
Hello There everyone:

I am new in this forum, please take good care of me.
I have to execute this query to obtain certain information in a database at work, but I canĀ“t do the query right. The thing is I have problem escaping de ' (single quote) if a use the like command.

Would you please help me out? I need to get this right... Smile

Thank you for your time in advance.

Greetings
Re: How to escape ' [message #623181 is a reply to message #623179] Fri, 05 September 2014 10:23 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Welcome to the forum!

Please read and follow the OraFAQ Forum Guide and How to use [code] tags, to enable us to help you.

Please understand that we don't have your tables and data to replicate and address your issue. So post a working test case.
Re: How to escape ' [message #623182 is a reply to message #623179] Fri, 05 September 2014 10:25 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and read http://www.orafaq.com/forum/t/174502/

http://kerryosborne.oracle-guy.com/2009/08/quotes-in-strings-oracle-q-quote/
Re: How to escape ' [message #623184 is a reply to message #623179] Fri, 05 September 2014 10:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
I have to execute this query to obtain certain information in a database at work


What "this query" refers to?
Please read OraFAQ Forum Guide and have a special look at "What's the best way to ask a technology question? T. Kyte's answer" section.

Re: How to escape ' [message #623187 is a reply to message #623184] Fri, 05 September 2014 10:43 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
@OP, I have a wild guess, why not use the string literal quoting technique to get rid off all the quotes inside a string literal. But,as I already said, you need to post the required details.
Re: How to escape ' [message #623198 is a reply to message #623187] Fri, 05 September 2014 13:02 Go to previous message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
another way is to use 2 single quotes. for example say i want to look for the string X'Q in table column I can use the following command

where my_column like '%X''Q'%;

[Updated on: Fri, 05 September 2014 13:02]

Report message to a moderator

Previous Topic: Insertion logic
Next Topic: Problem in Insersion
Goto Forum:
  


Current Time: Fri Apr 19 06:14:09 CDT 2024