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
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-12-2007, 01: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
Sponsored Links
  #2 (permalink)  
Old 07-12-2007, 04:16 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
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 (permalink)  
Old 07-12-2007, 07: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 (permalink)  
Old 07-12-2007, 07: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 (permalink)  
Old 07-12-2007, 10:53 PM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
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 (permalink)  
Old 07-12-2007, 11: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 (permalink)  
Old 07-13-2007, 05:27 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 386
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 On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/database-support/1607-escape-character-mysql.html
Posted By For Type Date
에서 문자를 이스케이프하는 방법 oracle 1 / sql 쿼리»내 디지털 라이프 This thread Refback 03-20-2008 10:56 PM
Как избежать символов в Oracle PL / SQL запросов »Моя Цифровая жизнь This thread Refback 02-08-2008 03:54 AM
Cómo escapar caracteres en Oracle PL/SQL pregunta” mi vida de Digital This thread Refback 09-20-2007 10:33 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
openSTA and end of file character cindrella Software Testing 0 02-29-2008 11:12 AM
Substring of a string from a particular character $enthil PHP Programming 4 01-02-2008 02:39 AM
MySQL supports indian language character sets priyan Database Support 16 12-12-2007 04:40 AM
Character Embedding geoblow Flash Actionscript Programming 0 09-18-2007 01:11 AM
NULL character within a string vigneshgets C# Programming 1 08-01-2007 05:07 AM


All times are GMT -7. The time now is 01:19 PM.


Copyright 2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0