I got this problem:
I need to save in a varchar field a string wich can have the ended part
filled with blank character, and I need to restore the string in the same
way it was saved, ie. with the right number of ended blank characters.
Mysql truncate tha last blank characaters of a field

for example if I have a table like the one belowe and insert some field with
blank characters at the end , like "abc " or "  middle  ", when I read thei
field I get "abc" and "  middle".

create table pippo ( codice int, messaggio varchar(20), a char(20));

insert into pippo values( 1, "abc ", "123 " );
insert into pippo values( 2, "  middle  ", " MIDDLE " );
select codice, messaggio, length(messaggio), a, length(a) from pippo;
1          abc                 3         123                 3
2            middle            8          MIDDLE             7


There are some way to avoid the automatic deletion of the last blank
characters ?

Regards,
Enzo Arlati   [EMAIL PROTECTED]
AESYS Via Artigiani, 41  24060 Brusaporto (BG) - Italy
Tel. +39 (0)35.2924.182   Fax +39 (0)35 680030


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

Reply via email to