Jump to content

Text and bool column type


kurt.santo

Recommended Posts

Creating a new table I came across two questions:I know that you can use the text column type for storing images, but what is the difference to blob? I never really see that it is used. As you cannot limit the max characters (or so at least I think) I use varchar (300) for example. Then, in what context do you use a bool column? I have an active column, but just use char with a default of "n", which could be changed to "y"...It would be great if I understood the specifics:-)Kurt

Link to comment
Share on other sites

The main difference between text and blob columns are that text columns store ASCII data and blob columns store binary data. You can't limit how much data goes into a text or blob column, but they do have maximums. TINYBLOB, TINYTEXT <= 255 bytesBLOB, TEXT <= 65,535 bytes MEDIUMBLOB, MEDIUMTEXT <= 16,777,215 bytesLONGBLOB, LONGTEXT <= 4,294,967,295 bytes

Then, in what context do you use a bool column?
Any time you need a column with only 2 choices (yes/no, true/false, on/off, etc).
Link to comment
Share on other sites

The main difference between text and blob columns are that text columns store ASCII data and blob columns store binary data. You can't limit how much data goes into a text or blob column, but they do have maximums. TINYBLOB, TINYTEXT <= 255 bytesBLOB, TEXT <= 65,535 bytes MEDIUMBLOB, MEDIUMTEXT <= 16,777,215 bytesLONGBLOB, LONGTEXT <= 4,294,967,295 bytesAny time you need a column with only 2 choices (yes/no, true/false, on/off, etc).
Thanks for your reply...Kurt
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...