- .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 column widths for "column" mode 设置列宽,举例见上文.explain命令。
转自:http://www.ctochina.net/topic/ShowArticle/351.html (编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|