Is there a direct equivalent in SQLite to MySQL's Binary?
I have a MySQL DB which stores data into a column of type 'binary' in this way:
INSERT INTO t VALUES(0x00000000000000000000000000000001)开发者_Python百科
I want to do the same in SQLite, so I need to figure out two things:
What is the 'binary' type equivalent in sqlite? There is a blob, but that might behave differently.
How can bin data be represented while inputting using INSERT statements. In MySQL for example, the above format of 0xbin works. But what about SQLite?
Found the answers, here they are for posterity.
There is a 'binary' type in sqlite3 but it doesn't seem to behave any differently from the 'blob' type, which is unusual.
Binary is inserted as such
create table t (b blob);
insert into t values (X'00000000000000000000000000000002');
精彩评论