SQLite注意以下几点

使用SQLite需要注意以下几点:
(1)建表时为避免重复操作,应加上IF NOT EXISTS关键词。
(2)删表时为避免重复操作,应加上IF EXISTS关键词。
(3)添加新列时使用ALTER TABLE table_name ADD COLUMN …。
(4)在SQLite中,ALTER语句每次只能添加一列。
(5)SQLite不支持布尔类型。可通过整型数用0表示false,1表示true。
(6)SQLite建表时需要一个唯一标识字段,字段名为_id。
(7)条件语句等号后面的字符串值要用单引号括起来。

目录 sqlite_array_query —— 发送一条 SQL 查询,并返回一个数组。 sqlite_busy_timeout —— 设置超时时间(busy timeout duration),或者频繁的用户失去权限(disable busy handlers)。 sqlite_changes —— 返回被最新的SQL 查询(changed by the most recent SQL statement)改变的行数。 sqlite_close —— 关闭一个打开的SQLite数据库sqlite_column —— 在当前的行中取得一列(a column from the current row of a result set)。 sqlite_create_aggregate —— Register an aggregating UDF for use in SQL statements。 sqlite_create_function —— Registers a "regular" User Defined Function for use in SQL statements。 sqlite_current —— 在返回的数组中取得当前的行(the current row from a result set as an array)。 sqlite_error_string —— 返回错误代码的原始描述(the textual description of an error code)。 sqlite_escape_string —— 释放一个用于查询的字符串(Escapes a string for use as a query parameter)。 sqlite_fetch_array —— 取得下一行并设置成一个数组(the next row from a result set as an array)。 sqlite_fetch_single —— 取得第一列并设置成一个字符串(Fetches the first column of a result set as a string)。 sqlite_fetch_string —— sqlite_fetch_single()的别名。 sqlite_field_name —— 取得结果中指定字段的字段名。 sqlite_has_more —— 返回是否有更多可用的行(whether or not more rows are available)。 sqlite_last_error —— 返回数据库的最新的错误代码(the error code of the last error for a database)。 sqlite_last_insert_rowid —— 返回最新插入的行的行号(the most recently inserted row)。 sqlite_libencoding —— 返回SQLite库(SQLite library)的编码(encoding)。 sqlite_libversion —— 返回SQLite库(SQLite library)的版本。 sqlite_next —— 返回下一行的行号。 sqlite_num_fields —— 取得结果集中字段的数目。 sqlite_num_rows —— 取得结果集中行的数目。 sqlite_open —— 打开一个SQLite数据库。如果文件不存在则尝试创建之。 sqlite_popen —— 用永久连接的方式打开一个SQLite数据库。如果文件不存在则尝试创建之。 sqlite_query —— 发送一条 SQL 查询,并返回一个结果句柄(a result handle)。 sqlite_rewind —— 倒回第一行(Seek to the first row number)。 sqlite_seek —— 在缓存结果中查找特定的行号(Seek to a particular row number of a buffered result set)。 sqlite_udf_decode_binary —— Decode binary data passed as parameters to an UDF。 sqlite_udf_encode_binary —— Encode binary data before returning it from an UDF。 sqlite_unbuffered_query —— 发送一条 SQL 查询,并不获取和缓存结果的行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值