- 论坛徽章:
- 0
|
看这里 http://www.sqlite.org/datatypes.html 在前面我给出的FAQ中也有VARCHAR的说明。不过在3版中,仍然可以使用VARCHAR,不过会自动转为TEXT.
2.1 Determination Of Column Affinity
The type affinity of a column is determined by the declared type of the column, according to the following rules:
1.
If the datatype contains the string "INT" then it is assigned INTEGER affinity.
2.
If the datatype of the column contains any of the strings "CHAR", "CLOB", or "TEXT" then that column has TEXT affinity. Notice that the type VARCHAR contains the string "CHAR" and is thus assigned TEXT affinity.
3.
If the datatype for a column contains the string "BLOB" or if no datatype is specified then the column has affinity NONE.
4.
If the datatype for a column contains any of the strings "REAL", "FLOA", or "DOUB" then the column has REAL affinity
5.
Otherwise, the affinity is NUMERIC.
If a table is created using a "CREATE TABLE <table> AS SELECT..." statement, then all columns have no datatype specified and they are given no affinity. |
|