| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>dbsql</title> |
| 7 | <link rel="stylesheet" href="apiReference.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> |
| 10 | <link rel="up" href="utilities.html" title="Appendix A. Berkeley DB Command Line Utilities" /> |
| 11 | <link rel="prev" href="db_sql_codegen.html" title="db_sql_codegen" /> |
| 12 | <link rel="next" href="db_stat.html" title="db_stat" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">dbsql</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="db_sql_codegen.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Appendix A. |
| 26 | Berkeley DB Command Line Utilities |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="db_stat.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="dbsql"></a>dbsql</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">dbsql [OPTIONS] FILENAME SQL </pre> |
| 42 | <p> |
| 43 | <code class="literal">dbsql</code> is a command line tool that provides access to the Berkeley DB |
| 44 | SQL interface. |
| 45 | </p> |
| 46 | <p> |
| 47 | To build this tool, run the configure script with the |
| 48 | <code class="literal">--enable-sql </code>option when you are building the |
| 49 | Berkeley DB SQL interface. For more information on building this tool, |
| 50 | see |
| 51 | <a href="../../installation/build_unix.html#build_unix_intro" class="olink">"Building for UNIX/POSIX"</a>. |
| 52 | </p> |
| 53 | <p>FILENAME is the name of a Berkeley DB database file created with the SQL interface. A new database is created |
| 54 | if the file does not exist. |
| 55 | The options are as follows: |
| 56 | </p> |
| 57 | <div class="itemizedlist"> |
| 58 | <ul type="disc"> |
| 59 | <li> |
| 60 | <p> |
| 61 | <span class="bold"><strong>-init filename</strong></span> |
| 62 | </p> |
| 63 | <p> |
| 64 | Reads/processes named file. |
| 65 | </p> |
| 66 | </li> |
| 67 | <li> |
| 68 | <p> |
| 69 | <span class="bold"><strong>-echo</strong></span> |
| 70 | </p> |
| 71 | <p> |
| 72 | Prints commands before execution. |
| 73 | </p> |
| 74 | </li> |
| 75 | <li> |
| 76 | <p> |
| 77 | <span class="bold"><strong>-[no]header</strong></span> |
| 78 | </p> |
| 79 | <p> |
| 80 | Turns headers on or off. |
| 81 | </p> |
| 82 | </li> |
| 83 | <li> |
| 84 | <p> |
| 85 | <span class="bold"><strong>-bail</strong></span> |
| 86 | </p> |
| 87 | <p> |
| 88 | Stops after hitting an error. |
| 89 | </p> |
| 90 | </li> |
| 91 | <li> |
| 92 | <p> |
| 93 | <span class="bold"><strong>-interactive</strong></span> |
| 94 | </p> |
| 95 | <p> |
| 96 | Forces interactive I/O. |
| 97 | </p> |
| 98 | </li> |
| 99 | <li> |
| 100 | <p> |
| 101 | <span class="bold"><strong>-batch</strong></span> |
| 102 | </p> |
| 103 | <p> |
| 104 | Forces batch I/O. |
| 105 | </p> |
| 106 | </li> |
| 107 | <li> |
| 108 | <p> |
| 109 | <span class="bold"><strong>-column</strong></span> |
| 110 | </p> |
| 111 | <p> |
| 112 | Sets output mode to column. |
| 113 | </p> |
| 114 | </li> |
| 115 | <li> |
| 116 | <p> |
| 117 | <span class="bold"><strong>-csv</strong></span> |
| 118 | </p> |
| 119 | <p> |
| 120 | Sets output mode to csv. |
| 121 | </p> |
| 122 | </li> |
| 123 | <li> |
| 124 | <p> |
| 125 | <span class="bold"><strong>-html</strong></span> |
| 126 | </p> |
| 127 | <p> |
| 128 | Sets output mode to HTML. |
| 129 | </p> |
| 130 | </li> |
| 131 | <li> |
| 132 | <p> |
| 133 | <span class="bold"><strong>-line</strong></span> |
| 134 | </p> |
| 135 | <p> |
| 136 | Sets output mode to line. |
| 137 | </p> |
| 138 | </li> |
| 139 | <li> |
| 140 | <p> |
| 141 | <span class="bold"><strong>-list</strong></span> |
| 142 | </p> |
| 143 | <p> |
| 144 | Sets output mode to list. |
| 145 | </p> |
| 146 | </li> |
| 147 | <li> |
| 148 | <p> |
| 149 | <span class="bold"><strong>-separator 'x'</strong></span> |
| 150 | </p> |
| 151 | <p> |
| 152 | Sets output field separator (|). |
| 153 | </p> |
| 154 | </li> |
| 155 | <li> |
| 156 | <p> |
| 157 | <span class="bold"><strong>-nullvalue 'text'</strong></span> |
| 158 | </p> |
| 159 | <p> |
| 160 | Sets text string for NULL values. |
| 161 | </p> |
| 162 | </li> |
| 163 | <li> |
| 164 | <p> |
| 165 | <span class="bold"><strong>-version</strong></span> |
| 166 | </p> |
| 167 | <p> |
| 168 | Shows SQLite version. |
| 169 | </p> |
| 170 | </li> |
| 171 | </ul> |
| 172 | </div> |
| 173 | <p> |
| 174 | The <code class="literal">dbsql</code> executable provides the same interface as the <code class="literal">sqlite3</code> |
| 175 | executable that is part of SQLite. For more information on how |
| 176 | to use dbsql see the |
| 177 | <a class="ulink" href="http://www.sqlite.org/sqlite.html" target="_top">SQLite Documentation page.</a> |
| 178 | </p> |
| 179 | <div class="sect2" lang="en" xml:lang="en"> |
| 180 | <div class="titlepage"> |
| 181 | <div> |
| 182 | <div> |
| 183 | <h3 class="title"><a id="dbsql_command_feature"></a>Command Line Features Unique to dbsql</h3> |
| 184 | </div> |
| 185 | </div> |
| 186 | </div> |
| 187 | <p> |
| 188 | This section describes pre-defined query statements that can be |
| 189 | executed from the <code class="literal">dbsql</code> command line. These queries take the form |
| 190 | of: |
| 191 | </p> |
| 192 | <pre class="programlisting"> .stat <span class="emphasis"><em>ITEM</em></span></pre> |
| 193 | <p> |
| 194 | where <code class="literal">ITEM</code> is an optional parameter that indicates |
| 195 | what statistics to print. If <code class="literal">ITEM</code> is not |
| 196 | specified, then this command prints statistics for the Berkeley DB |
| 197 | environment, followed by statistics for all tables and indexes |
| 198 | within the database. |
| 199 | </p> |
| 200 | <p> |
| 201 | If <code class="literal">ITEM</code> is the name of a table or index, then this |
| 202 | command prints statistics for the table or index using the |
| 203 | <a class="xref" href="dbstat_print.html" title="Db::stat_print()">Db::stat_print()</a> |
| 204 | |
| 205 | method. |
| 206 | </p> |
| 207 | <p> |
| 208 | Otherwise, <code class="literal">ITEM</code> can be one of several keywords. |
| 209 | They are: |
| 210 | </p> |
| 211 | <div class="itemizedlist"> |
| 212 | <ul type="disc"> |
| 213 | <li> |
| 214 | <p> |
| 215 | <code class="literal">:env:</code> |
| 216 | </p> |
| 217 | <pre class="programlisting">dbsql> .stat :env:</pre> |
| 218 | <p> |
| 219 | Causes this command to print statistics for the Berkeley DB |
| 220 | environment using the |
| 221 | <a class="xref" href="envstat.html" title="DbEnv::stat_print()">DbEnv::stat_print()</a>. |
| 222 | |
| 223 | method. |
| 224 | </p> |
| 225 | </li> |
| 226 | <li> |
| 227 | <p> |
| 228 | <code class="literal">:rep:</code> |
| 229 | </p> |
| 230 | <pre class="programlisting">dbsql> .stat :rep:</pre> |
| 231 | <p> |
| 232 | Causes this command to print a summary of replication |
| 233 | statistics. |
| 234 | </p> |
| 235 | </li> |
| 236 | </ul> |
| 237 | </div> |
| 238 | </div> |
| 239 | </div> |
| 240 | <div class="navfooter"> |
| 241 | <hr /> |
| 242 | <table width="100%" summary="Navigation footer"> |
| 243 | <tr> |
| 244 | <td width="40%" align="left"><a accesskey="p" href="db_sql_codegen.html">Prev</a> </td> |
| 245 | <td width="20%" align="center"> |
| 246 | <a accesskey="u" href="utilities.html">Up</a> |
| 247 | </td> |
| 248 | <td width="40%" align="right"> <a accesskey="n" href="db_stat.html">Next</a></td> |
| 249 | </tr> |
| 250 | <tr> |
| 251 | <td width="40%" align="left" valign="top">db_sql_codegen </td> |
| 252 | <td width="20%" align="center"> |
| 253 | <a accesskey="h" href="index.html">Home</a> |
| 254 | </td> |
| 255 | <td width="40%" align="right" valign="top"> db_stat</td> |
| 256 | </tr> |
| 257 | </table> |
| 258 | </div> |
| 259 | </body> |
| 260 | </html> |