MySQL Forums
Forum List  »  Newbie

Re: column type question
Posted by: Lori Johnson
Date: July 14, 2005 08:45AM

I think I figured it out--this is from 13.1.5.1. Silent Column Specification Changes
in the manual:

If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than three characters are changed to VARCHAR columns. This doesn't affect how you use the columns in any way; in MySQL, VARCHAR is just a different way to store characters. MySQL performs this conversion because it saves space and makes table operations faster.

I have other VARCHAR columns in my table, and the columns I want to designate as CHAR have a length larger than 3. I think that's why it won't retain the CHAR as column type. Anyway, when it changes back to VARCHAR after I designate it as CHAR, the zip codes retain the zero if it is the first character.

Thanks for the suggestions,
Lori

Options: ReplyQuote


Subject
Written By
Posted
July 13, 2005 01:42PM
July 13, 2005 03:14PM
July 14, 2005 05:01AM
Re: column type question
July 14, 2005 08:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.