13 messages in com.mysql.lists.mysqlchar() function
FromSent OnAttachments
Don Vu08 Apr 2002 08:07 
Don Vu08 Apr 2002 08:24 
Benjamin Pflugmann08 Apr 2002 08:40 
Chuck "PUP" Payne08 Apr 2002 08:48 
Peter Romianowski08 Apr 2002 08:57 
Christopher Thompson08 Apr 2002 09:01 
Rick Emery08 Apr 2002 09:03 
Egor Egorov08 Apr 2002 09:07 
mike08 Apr 2002 09:14 
Neil Freeman08 Apr 2002 09:25 
Chuck "PUP" Payne08 Apr 2002 09:34 
Roger Baklund08 Apr 2002 10:52 
Benjamin Pflugmann08 Apr 2002 12:08 
Subject:char() function
From:Don Vu (dv@Madstonefilms.com)
Date:04/08/2002 08:07:53 AM
List:com.mysql.lists.mysql

Hi guys,

Our java code blows up when we try to insert a string with a ';' inside of it.
So we tried to do a work-around by replacing ';' with '||CHAR(59)||' to insert
it, using the char function and the character's respecitve ascii value. So
instead of:

insert into table (key, field) values (1, 'test;string');

we had:

insert into table (key, field) values (1, 'test'||CHAR(59)||' string');

it seems to work initially...(Query OK, 1 row affected (0.00 sec)) but when I
try to select the value of the field I get just the value '0' (string of zero).

Anyone know what gives? If not, any ideas on another way to handle the problem?
It seemed like the CHAR() function was made for situations like this....

thanks, Don