Hi Jason,
Commas are not special characters inside a varchar type of a mysql
table.
What you have to watch is not to break strings. That usually happens
when you use the same type of quotes ,as a value of the string, of the
ones used to enclose the string itself.

For instance:  

insert into Employees (FirstName,LastName) values ('John','O'Connor');

Gives you an error, you broke the string!

You should modify your statement in:

insert into Employees (FirstName,LastName) values ('John','O\'Connor');

Backslash(\) is a special instruction to the mysql command interpreter
that
suggests to treat the following character as a value of the string and
not as a closing quote(in this case).

As for Mysql 5, special characters to be escaped inside a string are:

\0      An ASCII 0 (NUL) character.
\'      A single quote ("'") character.
\"      A double quote (""") character.
\b      A backspace character.
\n      A newline (linefeed) character.
\r      A carriage return character.
\t      A tab character.
\Z      ASCII 26 (Control-Z). See note following the table.
\\      A backslash ("\") character.
\%      A "%" character. See note following the table.
\_      A "_" character. See note following the table.


As you see you don't have the Comma character.


Aloha!

Claudio Nanni




-----Messaggio originale-----
Da: J. Todd Slack [mailto:[EMAIL PROTECTED] 
Inviato: sabato 8 marzo 2008 8.53
A: mysql@lists.mysql.com
Oggetto: Comma's in data?

Hi All,

I have a client that wants to insert data into a VarChar field that
contains
commas. These are property addresses.

Example:
2966 Moorpark Ave, San Jose, CA, 95128

1 Infinite Loop, Cupertino, CA, 955555

How can I allow this?

Thanks!
-Jason


"Questo messaggio ed ogni suo allegato sono confidenziali e possono essere 
riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non é il 
destinatario diretto del presente messaggio, é pregato di contattare 
l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal 
sistema di posta. Se il ricevente non é il destinatario diretto del presente 
messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio 
e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi 
altro soggetto"
*****
"This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. If you are not the intended recipient, 
please contact the sender and delete this message and any attachment from your 
system. If you are not the intended recipient you must not use, copy or print 
this message or attachment or disclose the contents to any other person."

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to