Re: field varchar and char truncate the ended blank characters

2005-03-01 Thread Gleb Paharenko
Hello.



Use TEXT or BLOB columns.







AESYS S.p.A. [Enzo Arlati] [EMAIL PROTECTED] 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

 2middle8  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

 

 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   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/[EMAIL PROTECTED]



R: field varchar and char truncate the ended blank characters

2005-03-01 Thread AESYS S.p.A. [Enzo Arlati]
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:[EMAIL PROTECTED]
Inviato: lunedì 28 febbraio 2005 14.41
A: mysql@lists.mysql.com
Oggetto: Re: field varchar and char truncate the ended blank characters


Hello.  Use TEXT or BLOB columns.AESYS S.p.A. [Enzo Arlati]
[EMAIL PROTECTED] 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 fieldfor 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  2middle8
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   

--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   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/[EMAIL PROTECTED]



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



Re: field varchar and char truncate the ended blank characters

2005-03-01 Thread Martijn Tonies
Hello,


 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 ?

Is this using Delphi? If so - you might want to create an OnGetText
event for the field and pass (part of the) TEXT as a simple string.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server
Upscene Productions
http://www.upscene.com


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



field varchar and char truncate the ended blank characters

2005-02-28 Thread AESYS S.p.A. [Enzo Arlati]

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
2middle8  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]