I am trying to setup a table in a MySql DB. What is the equivalent of a varchar(4000) in MySql? I need a data type that will handle longer strings than 255 bits.
Almost NO database can handle varchar greater than 255.(M/S SQL SERVER, SYBASE, ORACLE(as I recall), MYSQL, and many others can't do this.
On the otherhand, MOST(including MYSQL, M/S SQL SERVER, SYBASE, and ORACLE) can handle TEXT fields that are much larger. Use TEXT! BTW, you can probably go to close to 2GB before any would complain.
The 4000 on the varchar(4000) is the Oracle 4000 character limit not 4000 bytes. Do I have to treat the text datatype like a blob or can I just insert and select like a varchar?
BLOBS and TEXT in MySQL work the same way any other column works: you can easily SELECT and INSERT. You just can't set a size on them. Each type has a size according to its limit. As I recall, the TEXT column types are sorted and searched in case-insensitive fashion, while BLOBs are case-sensitive.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.