Sqlite系統命令

2021-08-30 20:31:50 字數 1979 閱讀 1092

[size=medium][color=orange].bail on|off stop after hitting an error. default off

.databases list names and files of attached databases(檢視目前掛的資料庫)

.dump ?table? ... dump the database in an sql text format(以sql格式輸出表結構)

.echo on|off turn command echo on or off

.exit exit this program(退出程式)

.explain on|off turn output mode suitable for explain on or off.

.header(s) on|off turn display of headers on or off

.help show this message(顯示幫助資訊)

.import file table import data from file into table(把檔案中的資料匯入到表中,各字段用separator的值為分隔符)

.indices table show names of all indices on table

.load file ?entry? load an extension library

.mode mode ?table? set output mode where mode is one of:(輸出格式)

csv comma-separated values(各字段以逗號為分隔符輸出)

column left-aligned columns. (see .width)(以.width設定的寬度顯示各欄位)

html html code(html**格式輸出)

insert sql insert statements for table(以insert sql語句形式輸出)

line one value per line(field = value的形式逐行輸出)

list values delimited by .separator string(各字段以separator的值為分隔符輸出)

tabs tab-separated values

tcl tcl list elements

.nullvalue string print string in place of null values

.output filename send output to filename(設定把查詢輸出到檔案,後面的輸出結果都儲存到檔案中)

.output stdout send output to the screen(設定把查詢結果輸出到螢幕,預設)

.prompt main continue replace the standard prompts(修改提示符)

.quit exit this program(退出)

.read filename execute sql in filename(執行檔案中的sql語句)

.schema ?table? show the create statements(以sql格式輸出表結構)

.separator string change separator used by output mode and .import(修改分隔符)

.show show the current values for various settings(顯示配置資訊)

.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(設定列寬)[/color][/size]

SQLITE入門 逐步講解SQLITE命令列 一

首先做點鋪墊說明 sqlite程式通過查詢分號 來決定乙個sql語句的結束,所以要執行sql語句請確保在sql語句後有分號 如果你省略分號,sqlite3將給你乙個連續的命令提示符 並等你給當前的sql命令新增更多的文字。這個特點讓你輸入多行的多個sql語句.但點號 命令不要分號 ctrl c可以結...

SQLITE入門 逐步講解SQLITE命令列 二

可以接著上一步操作,直接向dos視窗輸入.help命令來檢視sqlite的所有命令列及解釋如下 f sqlite3 sqlite version 3.6.16 enter help for instructions enter sql statements terminated with a sql...

SQLITE入門 逐步講解SQLITE命令列 二

可以接著上一步操作,直接向dos視窗輸入.help命令來檢視sqlite的所有命令列及解釋如下 f sqlite3 sqlite version 3.6.16 enter help for instructions enter sql statements terminated with a sql...