Can one anyone provide any information on whether can we store normal text data(varchar) in mysql or sqlite Blob data type

Was it helpful?


You can store any binary data in a blob. This would include both ascii and unicode text. However, you would need to explicitly interpret this as text in your code since an SQL interface would have no idea what type of data was stored inside its binary field.

Why would you want to use this rather than a normal varchar or text field?


A BLOB is just a bunch of bytes -- no hindrance no help dealing with them in any way; a VARCHAR is known to be text so such things as character encoding and collation come into play. So, store bunches of bytes (e.g. images) as BLOBs, bunches of text as TEXT or VARCHAR!

in mysql you can insert text/varchar in a blob data type.

blob can support binary data. meaning that non binary or binary data are also supported in mysql.

text/varchar can be indexed but not for blob.

further readings here

SQLite uses manifest typing, so you can put any type of data in any type of column, actually. Then you'll have to interpret the returned data yourself, just like everyone pointed out for MySQL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow