List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:February 20 2004 8:55pm
Subject:Re: White Space
View as plain text  
In the last episode (Feb 20), Chris Fossenier said:
> What is the best way to deal with white space in a mysql database?
> What I'm talking about is trailing spaces in larger fields. We
> receive data in fixed width format, so when you import it, you get a
> bunch of trailing white spaces that take up space. Multiply these
> white spaces by 120million records and it adds up.

If you use VARCHAR fields, mysql will automatically strip trailing
whitespace.  If you use CHAR fields, stripping space won't help you
since it's a fixed-width field :)

If you need leading and trailing space stripped, you can postprocess
the field with the TRIM() function.

	Dan Nelson
White SpaceChris Fossenier20 Feb
  • Re: White SpaceDan Nelson20 Feb
    • RE: White SpaceDonny Simonton20 Feb
    • Re: White SpaceKeith C. Ivey20 Feb
  • Re: White SpaceBrent Baisley20 Feb
RE: White SpaceChris Fossenier20 Feb