IT Community - Software Programming, Web Development and Technical Support

Escape Character in MySql

This is a discussion on Escape Character in MySql within the Database Support forums, part of the Web Development category; hi... Can anyone give details about "escape character" in MySql ?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-12-2007, 12:18 AM
raj raj is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
raj is on a distinguished road
Default Escape Character in MySql

hi...

Can anyone give details about "escape character" in MySql ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 07-12-2007, 03:16 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 385
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: Escape Character in MySql

Hi,

Escape Character,Yes available in MYSQL as same as Oracle.

Here are some examples.

1. SELECT "Its \n really \n working";

This will list the values as every character in new line

Output:

Its
really
working


2. SELECT "P.R & Sons";
Will List the Value with the Ambersent

3. SELECT "This is Mayor's Book";
Will List the Value with the single quote.
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 07-12-2007, 06:11 AM
raj raj is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
raj is on a distinguished road
Default Escape Character in MySql

Hi murali,

thanks for your reply....


i want to search a string from a table:

search string: hell\%test

how do u make query for this?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 07-12-2007, 06:24 AM
priyan priyan is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 133
priyan is on a distinguished road
Default Re: Escape Character in MySql

Hi buddy,

-- For mysql
SELECT * FROM test WHERE name LIKE '%hell\\\%test%';

-- For oracle
SELECT * FROM TEST WHERE NAME LIKE '%hell\\%test%' ESCAPE '\';
__________________
Keep smiling...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 07-12-2007, 09:53 PM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 385
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: Escape Character in MySql

Hi Raj,

Hope Got answer for your question.
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 07-12-2007, 10:07 PM
raj raj is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
raj is on a distinguished road
Default Escape Character in MySql

Hi,

thanks its working...

Can you give, other escape characters?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 07-13-2007, 04:27 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 385
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: Escape Character in MySql

May be these links help u to know about Escape Characters.

Escape Characters

Oracle Wildcards Wildcard Characters Escape Character

How to Escape Characters in Oracle PL/SQL Queries » My Digital Life
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL supports indian language character sets priyan Database Support 17 01-11-2010 12:25 AM
Guide to Character Encoding in HTML / PHP / MySQL ??? bordeauxkevin PHP Programming 0 12-29-2008 08:50 AM
What is the wildcard character in SQL? S.Vinothkumar Database Support 3 04-10-2008 10:50 PM
How to get ASCII Value of a first character in a string in php? $enthil PHP Programming 1 01-06-2008 10:48 PM
Character Embedding geoblow Flash Actionscript Programming 0 09-18-2007 12:11 AM


All times are GMT -7. The time now is 04:02 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0