首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

SQLite中设置PRAGMA page_size;该怎么处理

2012-02-12 
SQLite中设置PRAGMA page_size官方文档对page_size这个参数有这样的描述:The page size may only be set

SQLite中设置PRAGMA page_size;
官方文档对page_size这个参数有这样的描述:
The page size may only be set if the database has not yet been created.

但是PRAGMA page_size = bytes;作为一句SQL语句,如果没有数据库,如何指定数据库并执行该语句?

对这个变量的设置是不需要使用sqlite3_exec函数的吗?

谢谢。

[解决办法]
需要这个函数执行,但要在所有建表语句 之前执行:
参考帮助原文:
The page_size pragma will only cause an immediate change in the page size if it is issued while the database is still empty, prior to the first CREATE TABLE statement.
http://www.sqlite.org/pragma.html

热点排行