VARCHAR: Working to design, but why?
Posted in 1998
Fred Prose — — source: Informix-list mailing list archive (1991-1998)
According to the SQL Reference manual: "When you store a VARCHAR calue in the database, only its defined characters are stored. The database does not strip a VARCHAR object of any user-entered trailing blanks, nor does the database server pad the VARCHAR to the full length of the column." The question is, why would the design be that way -- ie. the trailing blanks not stipped if the equivalent of "ABC " is entered. I've never worked with a product that made that decision. A test case also showed that if you alter a table and change a column from CHAR(20) to VARCHAR(20) you get the entire VARCHAR(20) padded.