MySQL doesn't space pad varchar fields.

The mysql client displays the data with a column width sufficient for 
whichever is greater of the column heading, or the longest item of data 
in the result set.

If you ned to trim spaces you can do it in the select with TRIM() :-
 SELECT TRIM(beelzebub) FROM ...
If "TRIM(beelzebub)" is too long for your aesthetic beliefs, you can :-
 SELECT TRIM(beelzebub) AS dev FROM ...
Which would change the column heading to "dev" from "TRIM(beelzebub)".

If that's not your problem, you're going to have to post code.

Jon

> Hello,
> 
> I am facing a peculiar problem with dbi (1.14) / mysql (3.23.22-beta). 
> whenever i enter data
> to a varchar column in a mysql table using dbi, there is a lot of spaces 
> suffixed to the data.
> I think it fills up the column to its total width with spaces. As a 
> result the display of the data
> using the mysql client is quite terrible, with data getting blanked out. 
> I have no idea what is
> happening, and this is my first attempt with dbi.
> 
> Please tell me where could I be going wrong here.
> 
> Thanks
> 
> Jatin
> 
> 


Reply via email to