At 11:52 PM -0800 3/7/08, J. Todd Slack wrote:
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


I've never had to escape commas; only special characters, eg: '_%. MySQL seems to ignore escaping if the following character is not special, though:



[EMAIL PROTECTED]> create table test (t1 varchar(255));
Query OK, 0 rows affected (0.03 sec)

[EMAIL PROTECTED]> insert into test values ('qwert'), ('qwe,rt'),('qwe\,rt');
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

[EMAIL PROTECTED]> select * from test;
+--------+
| t1     |
+--------+
| qwert  |
| qwe,rt |
| qwe,rt |
+--------+
3 rows in set (0.00 sec)



Are you getting an error when you insert a row? If so, what is the error? Perhaps you are having a character set issue. This is what mine looks like:



[EMAIL PROTECTED]> show variables like 'character\_set\_%';
+--------------------------+--------+
| Variable_name            | Value  |
+--------------------------+--------+
| character_set_client     | latin1 |
| character_set_connection | latin1 |
| character_set_database   | latin1 |
| character_set_results    | latin1 |
| character_set_server     | latin1 |
| character_set_system     | utf8   |
+--------------------------+--------+
6 rows in set (0.00 sec)


        steve


--
+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg                                http://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center                            [EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin             (530)754-9127 |
+---------------- said t e lawrence, picking up his fork ----------------+

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

Reply via email to