File: dbsql.html

package info (click to toggle)
db 5.1.29-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 150,348 kB
  • sloc: ansic: 400,169; java: 94,399; tcl: 70,967; sh: 37,399; cs: 30,758; cpp: 21,132; perl: 14,227; xml: 9,854; makefile: 3,777; yacc: 1,003; awk: 942; sql: 801; erlang: 461; python: 216; php: 24; asm: 14
file content (213 lines) | stat: -rw-r--r-- 7,852 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>dbsql</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
    <link rel="up" href="utilities.html" title="Appendix A.  Berkeley DB Command Line Utilities" />
    <link rel="prev" href="db_sql_codegen.html" title="db_sql_codegen" />
    <link rel="next" href="db_stat.html" title="db_stat" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">dbsql</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="db_sql_codegen.html">Prev</a> </td>
          <th width="60%" align="center">Appendix A. 
                Berkeley DB Command Line Utilities
        </th>
          <td width="20%" align="right"> <a accesskey="n" href="db_stat.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="dbsql"></a>dbsql</h2>
          </div>
        </div>
      </div>
      <pre class="programlisting">dbsql [OPTIONS] FILENAME SQL </pre>
      <p>
	dbsql is a command line tool that provides access to the Berkeley DB SQL interface. To build this tool, run the configure script with the <code class="literal">--enable-sql </code>option when you are building the Berkeley DB SQL interface. 
	For more information on building this tool, see <a href="../../installation/build_unix.html#build_unix_intro" class="olink">"Building for UNIX/POSIX"</a>.
 
 </p>
      <p>FILENAME is the name of a Berkeley DB database file created with the SQL interface. A new database is created
if the file does not exist.
 The options are as follows:
 </p>
      <div class="itemizedlist">
        <ul type="disc">
          <li>
            <p>
              <span class="bold"><strong>-init filename</strong></span>
            </p>
            <p>
                 Reads/processes named file.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-echo</strong></span>
            </p>
            <p>
                 Prints commands before execution.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-[no]header</strong></span>
            </p>
            <p>
                 Turns headers on or off.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-bail</strong></span>
            </p>
            <p>
                 Stops after hitting an error.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-interactive</strong></span>
            </p>
            <p>
                 Forces interactive I/O.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-batch</strong></span>
            </p>
            <p>
                 Forces batch I/O.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-column</strong></span>
            </p>
            <p>
                 Sets output mode to column.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-csv</strong></span>
            </p>
            <p>
                 Sets output mode to csv.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-html</strong></span>
            </p>
            <p>
                 Sets output mode to HTML.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-line</strong></span>
            </p>
            <p>
                 Sets output mode to line.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-list</strong></span>
            </p>
            <p>
                 Sets output mode to list.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-separator 'x'</strong></span>
            </p>
            <p>
                 Sets output field separator (|).
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-nullvalue 'text'</strong></span>
            </p>
            <p>
                 Sets text string for NULL values.
            </p>
          </li>
          <li>
            <p>
              <span class="bold"><strong>-version</strong></span>
            </p>
            <p>
                 Shows SQLite version.
            </p>
          </li>
        </ul>
      </div>
      <p> The dbsql executable provides the same interface as the sqlite3 executable that is part of SQLite. For more information on how to use dbsql see the <a class="ulink" href="http://www.sqlite.org/sqlite.html" target="_top">SQLite Documentation page.</a> </p>
      <div class="sect2" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="dbsql_command_feature"></a>Command Line Features Unique to dbsql
 </h3>
            </div>
          </div>
        </div>
        <p>This section describes pre-defined query statements that can be executed from the dbsql command line.
 </p>
        <table class="simplelist" border="0" summary="Simple list">
          <tr>
            <td><span class="bold"><strong>.stat ?ITEM?</strong></span>  
 
    <p>Prints statistics</p>
    <p>If <span class="bold"><strong>ITEM</strong></span> is <span class="emphasis"><em>:env:</em></span>, then this command prints statistics for the Berkeley DB environment using the <a class="xref" href="envstat.html" title="DB_ENV-&gt;stat_print()">DB_ENV-&gt;stat_print()</a>. </p>
    <pre class="programlisting">dbsql&gt; .stat :env:</pre>
    <p>If <span class="bold"><strong>ITEM</strong></span> is the name of a table or index, then this command prints statistics for the table or index using the <a class="xref" href="dbstat_print.html" title="DB-&gt;stat_print()">DB-&gt;stat_print()</a>. </p>
    <pre class="programlisting">dbsql&gt; .stat example</pre>
    <p>If <span class="bold"><strong>ITEM</strong></span> is not specified, then this command prints statistics for the Berkeley DB environment followed by statistics for all tables and indexes within the database. 
</p>
<pre class="programlisting">dbsql&gt; .stat </pre>
    </td>
          </tr>
        </table>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="db_sql_codegen.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="utilities.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="db_stat.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">db_sql_codegen </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> db_stat</td>
        </tr>
      </table>
    </div>
  </body>
</html>