List:General Discussion« Previous MessageNext Message »
From:AESYS S.p.A. [Enzo Arlati] Date:March 1 2005 1:57pm
Subject:R: field varchar and char truncate the ended blank characters
View as plain text  
Using TEXT or BLOB prevent me to display the string in a dbgrid, the real
data is replaced by a text like "(MEMO)".
I can use somethinh like "select substring( msg, 1,100 ) from mytable " to
bypass the problem but is no the clean solution I looking for.
I thank for your hints but I'm looking, if possible, for a different
solution.
Other ideas ?

-----Messaggio originale-----
Da: Gleb Paharenko [mailto:gleb.paharenko@stripped]
Inviato: lunedì 28 febbraio 2005 14.41
A: mysql@stripped
Oggetto: Re: field varchar and char truncate the ended blank characters


Hello.  Use TEXT or BLOB columns.    "AESYS S.p.A. [Enzo Arlati]"
<enzo.arlati@stripped> wrote: >  > 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
enzo.arlati@stripped > AESYS Via Artigiani, 41  24060 Brusaporto (BG) -
Italy > Tel. +39 (0)35.2924.182   Fax +39 (0)35 680030 >  >

--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   Gleb.Paharenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1


Thread
field varchar and char truncate the ended blank charactersAESYS S.p.A. [Enzo Arlati]28 Feb
  • Re: field varchar and char truncate the ended blank charactersGleb Paharenko1 Mar
    • R: field varchar and char truncate the ended blank charactersAESYS S.p.A. [Enzo Arlati]1 Mar
      • Re: field varchar and char truncate the ended blank charactersMartijn Tonies1 Mar