易截截图软件、单文件、免安装、纯绿色、仅160KB

SQLITE入门 逐步讲解SQLITE命令行(六)


.nullvalue STRING 用STRING代替null值显示,不难理解,就不再累述了。
.output FILENAME 设置把查询输出到文件,后面的输出结果都保存到文件中,如:
sqlite> .mode list
sqlite> .output websites.txt
sqlite> select * from websites;
sqlite>
可以在F盘下发现建立了websites.txt文件,其内容如下:
1|CTOChina.net
2|搜狐
3|雅虎
4|开源
5|技术
.output stdout 设置把查询结果输出到屏幕,这是默认输出方式。如:
sqlite> .output stdout
sqlite> select * from websites;
1|CTOChina.net
2|搜狐
3|雅虎
4|开源
5|技术
sqlite>
.prompt MAIN CONTINUE Replace the standard prompts(修改提示符)请补充?
.quit 退出SQLite程序,同.exit命令
.read FILENAME Execute SQL in FILENAME 执行文件中的SQL语句,文件中的语句一定要带上分号(;).
我们在F盘下建sqldata.txt文件,其内容为:
insert into websites(WebName) values('测试插入数据0');
insert into websites(WebName) values('测试插入数据1');
select * from websites;
我们执行.read命令如下:
sqlite> .read sqldata.txt
1|CTOChina.net
2|搜狐
3|雅虎
4|开源
5|技术
6|测试插入数据0
7|测试插入数据1
sqlite>
.schema ?TABLE? Show the Create statements 以SQL格式输出表结构,如:
sqlite> .schema websites
CREATE TABLE [websites] (
[WebID] INTEGER NOT NULL PRIMARY KEY,
[WebName] VARCHAR(20) NULL
);
CREATE INDEX mytestindex on websites([webID]);
sqlite>
.separator STRING Change separator used by output mode and .import 修改分隔符,如:
sqlite> select * from websites limit 4;
1|CTOChina.net
2|搜狐
3|雅虎
4|开源
sqlite> .separator /
sqlite> select * from websites limit 4;
1/CTOChina.net
2/搜狐
3/雅虎
4/开源
sqlite>
.show Show the current values for various settings 显示配置信息,如:
sqlite> .show
echo: off
explain: off
headers: off
mode: list
nullvalue: ""
output: stdout
separator: "/"
width:
sqlite>
.tables ?PATTERN? List names of tables matching a LIKE pattern 显示库中表的列表。
.timeout MS Try opening locked tables for MS milliseconds 超时时间,单位:毫秒
.width NUM NUM ... Set c


相关文档:

在sqlite数据库中,int类型不等于integer数据类型

这些天一直在忙销售管理软件易卖通客户端的程序编写,由于需要采用本地数据缓存机制来提高程序的数据访问效率,所以需要在客户端使用一个小巧的本地数据库。这个数据库当然要小而精悍的。我也不想做强盗,于是就选择Sqlite吧——文件数据库,只要一个Sqlite.dll就可以操作数据库。
不得不趁人本人是有点偷懒,Ad ......

SQLite Tutorial in PHP

 
SQLite Tutorial in PHP
SQLite is an SQL database manager used locally or on a website, and compatible
in particularly with PHP.
Summary
Installing SQLite and creating a database
.
Installing SQLite. Verifying the installation by creating a base.
Creating and using a SQLite tabl ......

rails使用sqlite3和mysql的问题

1、如果使用sqlite3时出现如下错误:
/!\ FAILSAFE /!\  Thu Jul 30 22:16:15 +0800 2009
  Status: 500 Internal Server Error
  unknown error
    c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize'
    c:/ruby/lib/ruby/1.8/dl/import.rb:29:in `dlopen'
&nb ......

Sqlite DB使用例子

前一阵字做项目(嵌入式linux),由于要保存大量的数据,而且最长要保存30天的时间。本来打算保存到文件中,每次启动应用程序的时候重新解析一遍,可是当数据量很大的时候,就出现效率的问题了。所以最后还是放弃了使用文件的打算,决定使用数据库存取数据。
linux下的数据库也很多,有开源的,也有收费的。对于我们来说,肯 ......

SQLITE入门 逐步讲解SQLITE命令行(二)

可以接着上一步操作,直接向DOS窗口输入.help命令来查看SQLite的所有命令行及解释如下:
F:\>sqlite3
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .help
也可以ctrl+c结束命令,想DOS窗口 输入sqlite3执行后再输入.help命令如下:
F:\>sqli ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号