一般数据采用的固定的静态数据类型,而sqlite采用的是动态数据类型,会根据存入值自动判断。sqlite具有以下五种数据类型:
1.NULL
:空值。
2.INTEGER
:带符号的整型,具体取决有存入数字的范围大小。
3.REAL
:浮点数字,存储为8-byte IEEE
浮点数。
4.TEXT
:字符串文本。
5.BLOB
:二进制对象
smallint 16
位元的整数。
interger 32
位元的整数。
decimal(p,s) p
精确值和s
大小的十进位整数,精确值p
是指全部有几个数(digits)
大小值,s
是指小数点後有几位数。如果没有特别指定,则系统会设为p=5; s=0
。
float
32
位元的实数。
double64
位元的实数。
char(n)n
长度的字串,n
不能超过254
。
varchar(n)
长度不固定且其最大长度为n
的字串,n
不能超过4000
。
vargraphic(n)
可变长度且其最大长度为n
的双字元字串,n
不能超过2000
date
包含了
年份、月份、日期。
time
包含了
小时、分钟、秒。
imestamp
包含了
年、月、日、时、分、秒、千分之一秒。
@H_404_138@
datetime
包含日期时间格式,必须写成'2010-08-05'
不能写为'2010-8-5'
,否则在读取时会产生错误!