System.Data.SQLite
Check-in [3e112a4504]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Refresh all included SQLite core library documentation (e.g. SQL syntax).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3e112a45045e10f940ddbbeda0357b2353b3df34
User & Date: mistachkin 2014-02-05 01:39:53
Context
2014-02-05
01:46
Update table-of-contents topic names. check-in: 837439ff91 user: mistachkin tags: trunk
01:39
Refresh all included SQLite core library documentation (e.g. SQL syntax). check-in: 3e112a4504 user: mistachkin tags: trunk
01:39
Update version history docs. Closed-Leaf check-in: 6e651ad0df user: mistachkin tags: coreDocs
2014-02-04
22:55
Reorganize the documentation files. check-in: 6fc137b4c3 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added Doc/Extra/Core/images/sqlite370_banner.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/a.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/alter-table-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/analyze-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/attach-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/begin-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/column-constraint.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/column-def.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/comment-syntax.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/commit-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/common-table-expression.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/compound-operator.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/compound-select-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/conflict-clause.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/create-index-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/create-table-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/create-trigger-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/create-view-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/create-virtual-table-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/cte-table-name.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/delete-stmt-limited.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/delete-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/detach-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/drop-index-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/drop-table-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/drop-trigger-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/drop-view-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/expr.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/factored-select-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/floating-point-literal.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/foreign-key-clause.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/foreign-key-clause2.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/indexed-column.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/insert-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/join-clause.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/join-constraint.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/join-op.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/join-operator.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/join-source.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/literal-value.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/numeric-literal.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/ordering-term.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/pragma-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/pragma-value.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/qualified-table-name.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/raise-function.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/recursive-cte.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/reindex-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/release-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/result-column.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/rollback-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/savepoint-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/select-core.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/select-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/signed-number.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/simple-select-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/single-source.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/sql-stmt-list.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/sql-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/table-constraint.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/table-or-subquery.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/type-name.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/update-stmt-limited.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/update-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/vacuum-stmt.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/images/syntax/with-clause.gif.

cannot compute difference between binary files

Added Doc/Extra/Core/lang.html.

            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>Query Language Understood by SQLite</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
          126  +    </div>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +
          132  +
          133  +<h1 align=center>SQL As Understood By SQLite</h1>
          134  +
          135  +<p>SQLite understands most of the standard SQL
          136  +language.  But it does <a href="omitted.html">omit some features</a>
          137  +while at the same time
          138  +adding a few features of its own.  This document attempts to
          139  +describe precisely what parts of the SQL language SQLite does
          140  +and does not support.  A list of <a href="lang_keywords.html">SQL keywords</a> is 
          141  +also provided.  The SQL language syntax is described by
          142  +<a href="syntaxdiagrams.html">syntax diagrams</a>.
          143  +
          144  +<p>The following syntax documentation topics are available:</p>
          145  +
          146  +<table width="100%" cellpadding="5" border="0">
          147  +<tr><td valign="top"><ul>
          148  +
          149  +<li><a href="lang_aggfunc.html">aggregate functions</a></li><li><a href="lang_altertable.html">ALTER TABLE</a></li><li><a href="lang_analyze.html">ANALYZE</a></li><li><a href="lang_attach.html">ATTACH DATABASE</a></li><li><a href="lang_transaction.html">BEGIN TRANSACTION</a></li><li><a href="lang_comment.html">comment</a></li><li><a href="lang_transaction.html">COMMIT TRANSACTION</a></li><li><a href="lang_corefunc.html">core functions</a></li><li><a href="lang_createindex.html">CREATE INDEX</a></li><li><a href="lang_createtable.html">CREATE TABLE</a></li><li><a href="lang_createtrigger.html">CREATE TRIGGER</a></li><li><a href="lang_createview.html">CREATE VIEW</a></li><li><a href="lang_createvtab.html">CREATE VIRTUAL TABLE</a></li></ul></td><td valign="top"><ul><li><a href="lang_datefunc.html">date and time functions</a></li><li><a href="lang_delete.html">DELETE</a></li><li><a href="lang_detach.html">DETACH DATABASE</a></li><li><a href="lang_dropindex.html">DROP INDEX</a></li><li><a href="lang_droptable.html">DROP TABLE</a></li><li><a href="lang_droptrigger.html">DROP TRIGGER</a></li><li><a href="lang_dropview.html">DROP VIEW</a></li><li><a href="lang_transaction.html">END TRANSACTION</a></li><li><a href="lang_explain.html">EXPLAIN</a></li><li><a href="lang_expr.html">expression</a></li><li><a href="lang_indexedby.html">INDEXED BY</a></li><li><a href="lang_insert.html">INSERT</a></li><li><a href="lang_keywords.html">keywords</a></li></ul></td><td valign="top"><ul><li><a href="lang_conflict.html">ON CONFLICT clause</a></li><li><a href="pragma.html#syntax">PRAGMA</a></li><li><a href="lang_reindex.html">REINDEX</a></li><li><a href="lang_savepoint.html">RELEASE SAVEPOINT</a></li><li><a href="lang_replace.html">REPLACE</a></li><li><a href="lang_transaction.html">ROLLBACK TRANSACTION</a></li><li><a href="lang_savepoint.html">SAVEPOINT</a></li><li><a href="lang_select.html">SELECT</a></li><li><a href="lang_update.html">UPDATE</a></li><li><a href="lang_vacuum.html">VACUUM</a></li><li><a href="lang_with.html">WITH clause</a></li>
          150  +</ul></td></tr></table>
          151  +
          152  +<p>The routines <a href="c3ref/prepare.html">sqlite3_prepare_v2()</a>, <a href="c3ref/prepare.html">sqlite3_prepare()</a>,
          153  +<a href="c3ref/prepare.html">sqlite3_prepare16()</a>, <a href="c3ref/prepare.html">sqlite3_prepare16_v2()</a>, 
          154  +<a href="c3ref/exec.html">sqlite3_exec()</a>, and <a href="c3ref/free_table.html">sqlite3_get_table()</a> accept
          155  +an SQL statement list (sql-stmt-list) which is a semicolon-separated
          156  +list of statements.</p>
          157  +
          158  +<p><b><a href="syntaxdiagrams.html#sql-stmt-list">sql-stmt-list:</a></b></p><blockquote>
          159  + <img alt="syntax diagram sql-stmt-list" src="images/syntax/sql-stmt-list.gif"></img>
          160  + </blockquote>
          161  +
          162  +
          163  +<p>Each SQL statement in the statement list is an instance of the
          164  +following:</p>
          165  +
          166  +<p><b><a href="syntaxdiagrams.html#sql-stmt">sql-stmt:</a></b></p><blockquote>
          167  + <img alt="syntax diagram sql-stmt" src="images/syntax/sql-stmt.gif"></img>
          168  + </blockquote>
          169  +
          170  +
          171  +

Added Doc/Extra/Core/lang_aggfunc.html.

            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: Aggregate Functions</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
          126  +    </div>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>Aggregate Functions</h2>
          132  +
          133  +<p>
          134  +The aggregate functions shown below are available by default.  Additional
          135  +aggregate functions written in C may be added using the 
          136  +<a href="c3ref/create_function.html">sqlite3_create_function()</a></a>
          137  +API.</p>
          138  +
          139  +<p>
          140  +In any aggregate function that takes a single argument, that argument
          141  +can be preceded by the keyword DISTINCT.  In such cases, duplicate
          142  +elements are filtered before being passed into the aggregate function.
          143  +For example, the function "count(distinct X)" will return the number
          144  +of distinct values of column X instead of the total number of non-null
          145  +values in column X.
          146  +</p>
          147  +
          148  +<table border=0 cellpadding=10>
          149  +<tr><td valign="top" align="right" width="120"><a name="avg"></a>
          150  +avg(<i>X</i>)</td><td valign="top">
          151  +  The avg() function
          152  +  returns the average value of all non-NULL <i>X</i> within a
          153  +  group.  String and BLOB values that do not look like numbers are
          154  +  interpreted as 0.
          155  +  The result of avg() is always a floating point value as long as
          156  +  at there is at least one non-NULL input even if all
          157  +  inputs are integers.  The result of avg() is NULL if and only if
          158  +  there are no non-NULL inputs.  
          159  +</td></tr><tr><td valign="top" align="right" width="120"><a name="count"></a>
          160  +count(<i>X</i>)<br />count(*)</td><td valign="top">
          161  +  The count(X) function returns
          162  +  a count of the number of times
          163  +  that <i>X</i> is not NULL in a group.  The count(*) function
          164  +  (with no arguments) returns the total number of rows in the group.
          165  +</td></tr><tr><td valign="top" align="right" width="120"><a name="groupconcat"></a>
          166  +group_concat(<i>X</i>)<br />group_concat(<i>X</i>,<i>Y</i>)</td><td valign="top">
          167  +  The group_concat() function returns
          168  +  a string which is the concatenation of
          169  +  all non-NULL values of <i>X</i>.  If parameter <i>Y</i> is present then
          170  +  it is used as the separator
          171  +  between instances of <i>X</i>.  A comma (",") is used as the separator
          172  +  if <i>Y</i> is omitted.  The order of the concatenated elements is
          173  +  arbitrary.
          174  +</td></tr><tr><td valign="top" align="right" width="120"><a name="maxggunc"></a>
          175  +max(<i>X</i>)</td><td valign="top">
          176  +  The max() aggregate function
          177  +  returns the maximum value of all values in the group.
          178  +  The maximum value is the value that would be returned last in an
          179  +  ORDER BY on the same column.  Aggregate max() returns NULL 
          180  +  if and only if there are no non-NULL values in the group.
          181  +</td></tr><tr><td valign="top" align="right" width="120"><a name="minggunc"></a>
          182  +min(<i>X</i>)</td><td valign="top">
          183  +  The min() aggregate function
          184  +  returns the minimum non-NULL value of all values in the group.
          185  +  The minimum value is the first non-NULL value that would appear
          186  +  in an ORDER BY of the column.
          187  +  Aggregate min() returns NULL if and only if there are no non-NULL
          188  +  values in the group.
          189  +</td></tr><tr><td valign="top" align="right" width="120"><a name="sumunc"></a>
          190  +sum(<i>X</i>)<br />total(<i>X</i>)</td><td valign="top">
          191  +  The sum() and total() aggregate functions
          192  +  return sum of all non-NULL values in the group.
          193  +  If there are no non-NULL input rows then sum() returns
          194  +  NULL but total() returns 0.0.
          195  +  NULL is not normally a helpful result for the sum of no rows
          196  +  but the SQL standard requires it and most other
          197  +  SQL database engines implement sum() that way so SQLite does it in the
          198  +  same way in order to be compatible.   The non-standard total() function
          199  +  is provided as a convenient way to work around this design problem
          200  +  in the SQL language.</p>
          201  +
          202  +  <p>The result of total() is always a floating point value.
          203  +  The result of sum() is an integer value if all non-NULL inputs are integers.
          204  +  If any input to sum() is neither an integer or a NULL
          205  +  then sum() returns a floating point value
          206  +  which might be an approximation to the true sum.</p>
          207  +
          208  +  <p>Sum() will throw an "integer overflow" exception if all inputs
          209  +  are integers or NULL
          210  +  and an integer overflow occurs at any point during the computation.
          211  +  Total() never throws an integer overflow.
          212  +</td></tr>
          213  +</table>
          214  +
          215  +

Changes to Doc/Extra/Core/lang_altertable.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>ALTER TABLE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">ALTER TABLE</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        ALTER TABLE</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">ALTER TABLE </font></b>[<b><font color="#2c2cf0"></font></b><i><font
    55         -                color="#ff3434">database-name</font></i><b><font color="#2c2cf0"> <big>.</big></font></b>]<b><font
    56         -                  color="#2c2cf0"> </font></b><i><font color="#ff3434">table-name</font></i><b><font
    57         -                    color="#2c2cf0"> </font></b><i><font color="#ff3434">alteration</font></i><b><font
    58         -                      color="#2c2cf0"></font></b></td>
    59         -          </tr>
    60         -          <tr>
    61         -            <td align="right" width="1%" nowrap>
    62         -              <i><font color="#ff3434">alteration</font></i> ::=</td>
    63         -            <td>
    64         -              <b><font color="#2c2cf0">RENAME TO </font></b><i><font color="#ff3434">new-table-name</font></i><b><font
    65         -                color="#2c2cf0"></font></b></td>
    66         -          </tr>
    67         -          <tr>
    68         -            <td align="right" width="1%" nowrap>
    69         -              <i><font color="#ff3434">alteration</font></i> ::=</td>
    70         -            <td>
    71         -              <b><font color="#2c2cf0">ADD </font></b>[<b><font color="#2c2cf0">COLUMN</font></b>]<b><font
    72         -                color="#2c2cf0"> </font></b><i><font color="#ff3434">column-def</font></i><b><font
    73         -                  color="#2c2cf0"></font></b></td>
    74         -          </tr>
    75         -        </table>
    76         -      </p>
    77         -      <p>
    78         -        SQLite's version of the ALTER TABLE command allows the user to rename or add a new
    79         -        column to an existing table. It is not possible to remove a column from a table.
    80         -      </p>
    81         -      <p>
    82         -        The RENAME TO syntax is used to rename the table identified by <i>[database-name.]table-name</i>
    83         -        to <i>new-table-name</i>. This command cannot be used to move a table between attached
    84         -        databases, only to rename a table within the same database.</p>
    85         -      <p>
    86         -        If the table being renamed has triggers or indices, then these remain attached to
    87         -        the table after it has been renamed. However, if there are any view definitions,
    88         -        or statements executed by triggers that refer to the table being renamed, these
    89         -        are not automatically modified to use the new table name. If this is required, the
    90         -        triggers or view definitions must be dropped and recreated to use the new table
    91         -        name by hand.
    92         -      </p>
    93         -      <p>
    94         -        The ADD [COLUMN] syntax is used to add a new column to an existing table. The new
    95         -        column is always appended to the end of the list of existing columns. <i>Column-def</i>
    96         -        may take any of the forms permissable in a CREATE TABLE statement, with the following
    97         -        restrictions:
    98         -      </p>
    99         -      <ul>
   100         -        <li>The column may not have a PRIMARY KEY or UNIQUE constraint. </li>
   101         -        <li>The column may not have a default value of CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP.
   102         -        </li>
   103         -        <li>If a NOT NULL constraint is specified, then the column must have a default value
   104         -          other than NULL. </li>
   105         -      </ul>
   106         -      <p>
   107         -        The execution time of the ALTER TABLE command is independent of the amount of data
   108         -        in the table. The ALTER TABLE command runs as quickly on a table with 10 million
   109         -        rows as it does on a table with 1 row.
   110         -      </p>
   111         -      <p>
   112         -        After ADD COLUMN has been run on a database, that database will not be readable
   113         -        by SQLite version 3.1.3 and earlier until the database is <a href="lang_vacuum.html">
   114         -          VACUUM</a>ed.</p>
   115         -      <p>
   116         -        &nbsp;</p>
   117         -      <hr>
   118         -      <div id="footer">
   119         -        <p>
   120         -          &nbsp;</p>
   121         -        <p>
   122         -        </p>
   123         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: ALTER TABLE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
   124    126       </div>
   125         -    </div>
   126         -  </body>
   127         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>ALTER TABLE</h2><p><b><a href="syntaxdiagrams.html#alter-table-stmt">alter-table-stmt:</a></b>
          132  +<button id='x729' onclick='hideorshow("x729","x730")'>hide</button></p>
          133  + <blockquote id='x730'>
          134  + <img alt="syntax diagram alter-table-stmt" src="images/syntax/alter-table-stmt.gif" />
          135  +<p><b><a href="syntaxdiagrams.html#column-def">column-def:</a></b>
          136  +<button id='x731' onclick='hideorshow("x731","x732")'>show</button></p>
          137  + <blockquote id='x732' style='display:none;'>
          138  + <img alt="syntax diagram column-def" src="images/syntax/column-def.gif" />
          139  +<p><b><a href="syntaxdiagrams.html#column-constraint">column-constraint:</a></b>
          140  +<button id='x733' onclick='hideorshow("x733","x734")'>show</button></p>
          141  + <blockquote id='x734' style='display:none;'>
          142  + <img alt="syntax diagram column-constraint" src="images/syntax/column-constraint.gif" />
          143  +<p><b><a href="syntaxdiagrams.html#conflict-clause">conflict-clause:</a></b>
          144  +<button id='x735' onclick='hideorshow("x735","x736")'>show</button></p>
          145  + <blockquote id='x736' style='display:none;'>
          146  + <img alt="syntax diagram conflict-clause" src="images/syntax/conflict-clause.gif" />
          147  +</blockquote>
          148  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          149  +<button id='x737' onclick='hideorshow("x737","x738")'>show</button></p>
          150  + <blockquote id='x738' style='display:none;'>
          151  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          152  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          153  +<button id='x739' onclick='hideorshow("x739","x740")'>show</button></p>
          154  + <blockquote id='x740' style='display:none;'>
          155  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          156  +</blockquote>
          157  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          158  +<button id='x741' onclick='hideorshow("x741","x742")'>show</button></p>
          159  + <blockquote id='x742' style='display:none;'>
          160  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          161  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          162  +<button id='x743' onclick='hideorshow("x743","x744")'>show</button></p>
          163  + <blockquote id='x744' style='display:none;'>
          164  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          165  +</blockquote>
          166  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          167  +<button id='x745' onclick='hideorshow("x745","x746")'>show</button></p>
          168  + <blockquote id='x746' style='display:none;'>
          169  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          170  +</blockquote>
          171  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          172  +<button id='x747' onclick='hideorshow("x747","x748")'>show</button></p>
          173  + <blockquote id='x748' style='display:none;'>
          174  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          175  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          176  +<button id='x749' onclick='hideorshow("x749","x750")'>show</button></p>
          177  + <blockquote id='x750' style='display:none;'>
          178  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          179  +</blockquote>
          180  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          181  +<button id='x751' onclick='hideorshow("x751","x752")'>show</button></p>
          182  + <blockquote id='x752' style='display:none;'>
          183  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          184  +</blockquote>
          185  +</blockquote>
          186  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          187  +<button id='x753' onclick='hideorshow("x753","x754")'>show</button></p>
          188  + <blockquote id='x754' style='display:none;'>
          189  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          190  +</blockquote>
          191  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          192  +<button id='x755' onclick='hideorshow("x755","x756")'>show</button></p>
          193  + <blockquote id='x756' style='display:none;'>
          194  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          195  +</blockquote>
          196  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          197  +<button id='x757' onclick='hideorshow("x757","x758")'>show</button></p>
          198  + <blockquote id='x758' style='display:none;'>
          199  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          200  +</blockquote>
          201  +</blockquote>
          202  +</blockquote>
          203  +<p><b><a href="syntaxdiagrams.html#foreign-key-clause">foreign-key-clause:</a></b>
          204  +<button id='x759' onclick='hideorshow("x759","x760")'>show</button></p>
          205  + <blockquote id='x760' style='display:none;'>
          206  + <img alt="syntax diagram foreign-key-clause" src="images/syntax/foreign-key-clause.gif" />
          207  +</blockquote>
          208  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          209  +<button id='x761' onclick='hideorshow("x761","x762")'>show</button></p>
          210  + <blockquote id='x762' style='display:none;'>
          211  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          212  +</blockquote>
          213  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          214  +<button id='x763' onclick='hideorshow("x763","x764")'>show</button></p>
          215  + <blockquote id='x764' style='display:none;'>
          216  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          217  +</blockquote>
          218  +</blockquote>
          219  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          220  +<button id='x765' onclick='hideorshow("x765","x766")'>show</button></p>
          221  + <blockquote id='x766' style='display:none;'>
          222  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          223  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          224  +<button id='x767' onclick='hideorshow("x767","x768")'>show</button></p>
          225  + <blockquote id='x768' style='display:none;'>
          226  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          227  +</blockquote>
          228  +</blockquote>
          229  +</blockquote>
          230  +</blockquote>
          231  +
          232  +
          233  +<p>SQLite supports a limited subset of ALTER TABLE.
          234  +The ALTER TABLE command in SQLite allows the user to rename a table
          235  +or to add a new column to an existing table.
          236  +</p>
          237  +
          238  +<p> The RENAME TO syntax is used to rename the table identified by 
          239  +<i>&#91;database-name.&#93;table-name</i> to <i>new-table-name</i>.
          240  +This command 
          241  +cannot be used to move a table between attached databases, only to rename 
          242  +a table within the same database.</p>
          243  +
          244  +<p> If the table being renamed has triggers or indices, then these remain
          245  +attached to the table after it has been renamed.  However, if there are
          246  +any view definitions, or statements executed by triggers that refer to
          247  +the table being renamed, these are not automatically modified to use the new
          248  +table name. If this is required, the triggers or view definitions must be
          249  +dropped and recreated to use the new table name by hand.
          250  +</p>
          251  +
          252  +<p>If <a href="foreignkeys.html">foreign key constraints</a> are 
          253  +<a href="pragma.html#pragma_foreign_keys">enabled</a> when a table is renamed, then any
          254  +<a href="syntaxdiagrams.html#foreign-key-clause">REFERENCES clauses</a> in any table (either the
          255  +table being renamed or some other table)
          256  +that refer to the table being renamed are modified to refer 
          257  +to the renamed table by its new name.
          258  +
          259  +<p> The ADD COLUMN syntax
          260  +is used to add a new column to an existing table.
          261  +The new column is always appended to the end of the list of existing columns.
          262  +The <a href="syntaxdiagrams.html#column-def">column-def</a> rule defines the characteristics of the new column.
          263  +The new column may take any of the forms permissible in a <a href="lang_createtable.html">CREATE TABLE</a>
          264  +statement, with the following restrictions:
          265  +<ul>
          266  +<li>The column may not have a PRIMARY KEY or UNIQUE constraint.</li>
          267  +<li>The column may not have a default value of CURRENT_TIME, CURRENT_DATE, 
          268  +    CURRENT_TIMESTAMP, or an expression in parentheses.</li>
          269  +<li>If a NOT NULL constraint is specified, then the column must have a
          270  +    default value other than NULL.
          271  +<li>If <a href="foreignkeys.html">foreign key constraints</a> are <a href="pragma.html#pragma_foreign_keys">enabled</a> and
          272  +    a column with a <a href="syntaxdiagrams.html#foreign-key-clause">REFERENCES clause</a>
          273  +    is added, the column must have a default value of NULL.
          274  +</ul>
          275  +
          276  +<p>Note also that when adding a <a href="lang_createtable.html#ckconst">CHECK constraint</a>, the CHECK constraint
          277  +is not tested against preexisting rows of the table.
          278  +This can result in a table that contains data that
          279  +is in violation of the CHECK constraint.  Future versions of SQLite might
          280  +change to validate CHECK constraints as they are added.</p>
          281  +
          282  +<p> The execution time of the ALTER TABLE command is independent of
          283  +the amount of data in the table.  The ALTER TABLE command runs as quickly
          284  +on a table with 10 million rows as it does on a table with 1 row.
          285  +</p>
          286  +
          287  +<p>After ADD COLUMN has been run on a database, that database will not
          288  +be readable by SQLite version 3.1.3 and earlier.</p>
          289  +
          290  +

Changes to Doc/Extra/Core/lang_analyze.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>ANALYZE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">ANALYZE</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        ANALYZE</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">ANALYZE</font></b></td>
    55         -          </tr>
    56         -        </table>
    57         -        <table cellpadding="10">
    58         -          <tr>
    59         -            <td align="right" width="1%" nowrap>
    60         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    61         -            <td>
    62         -              <b><font color="#2c2cf0">ANALYZE </font></b><i><font color="#ff3434">database-name</font></i><b><font
    63         -                color="#2c2cf0"></font></b></td>
    64         -          </tr>
    65         -        </table>
    66         -        <table cellpadding="10">
    67         -          <tr>
    68         -            <td align="right" width="1%" nowrap>
    69         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    70         -            <td>
    71         -              <b><font color="#2c2cf0">ANALYZE </font></b>[<b><font color="#2c2cf0"></font></b><i><font
    72         -                color="#ff3434">database-name</font></i><b><font color="#2c2cf0"> <big>.</big></font></b>]<b><font
    73         -                  color="#2c2cf0"> </font></b><i><font color="#ff3434">table-name</font></i><b><font
    74         -                    color="#2c2cf0"></font></b></td>
    75         -          </tr>
    76         -        </table>
    77         -      </p>
    78         -      <p>
    79         -        The ANALYZE command gathers statistics about indices and stores them in a special
    80         -        tables in the database where the query optimizer can use them to help make better
    81         -        index choices. If no arguments are given, all indices in all attached databases
    82         -        are analyzed. If a database name is given as the argument, all indices in that one
    83         -        database are analyzed. If the argument is a table name, then only indices associated
    84         -        with that one table are analyzed.</p>
    85         -      <p>
    86         -        The initial implementation stores all statistics in a single table named <b>sqlite_stat1</b>.
    87         -        Future enhancements may create additional tables with the same name pattern except
    88         -        with the "1" changed to a different digit. The <b>sqlite_stat1</b> table cannot be <a href="lang_droptable.html">DROP</a>ped, but all the content can be <a href="lang_delete.html">
    89         -          DELETE</a>d which has the same effect.</p>
    90         -      <p>
    91         -        &nbsp;</p>
    92         -      <hr>
    93         -      <div id="footer">
    94         -        <p>
    95         -          &nbsp;</p>
    96         -        <p>
    97         -        </p>
    98         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: ANALYZE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    99    126       </div>
   100         -    </div>
   101         -  </body>
   102         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>ANALYZE</h2><p><b><a href="syntaxdiagrams.html#analyze-stmt">analyze-stmt:</a></b>
          132  +<button id='x769' onclick='hideorshow("x769","x770")'>hide</button></p>
          133  + <blockquote id='x770'>
          134  + <img alt="syntax diagram analyze-stmt" src="images/syntax/analyze-stmt.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p> The ANALYZE command gathers statistics about tables and
          139  +indices and stores the collected information
          140  +in <a href="fileformat2.html#intschema">internal tables</a> of the database where the query optimizer can
          141  +access the information and use it to help make better query planning choices.
          142  +If no arguments are given, all attached databases are
          143  +analyzed.  If a database name is given as the argument, then all tables
          144  +and indices in that one database are analyzed.  
          145  +If the argument is a table name, then only that table and the
          146  +indices associated with that table are analyzed.  If the argument
          147  +is an index name, then only that one index is analyzed.</p>
          148  +
          149  +<p> The default implementation stores all statistics in a single
          150  +table named "<a href="fileformat2.html#stat1tab">sqlite_stat1</a>".  If SQLite is compiled with the
          151  +<a href="compile.html#enable_stat3">SQLITE_ENABLE_STAT3</a> option and without the <a href="compile.html#enable_stat4">SQLITE_ENABLE_STAT4</a>
          152  +option, then additional histogram data is
          153  +collected and stored in <a href="fileformat2.html#stat3tab">sqlite_stat3</a>.
          154  + If SQLite is compiled with the
          155  +<a href="compile.html#enable_stat4">SQLITE_ENABLE_STAT4</a> option, then additional histogram data is
          156  +collected and stored in <a href="fileformat2.html#stat4tab">sqlite_stat4</a>.
          157  +Older versions of SQLite would make use of the <a href="fileformat2.html#stat2tab">sqlite_stat2</a> table
          158  +when compiled with <a href="compile.html#enable_stat2">SQLITE_ENABLE_STAT2</a> but all recent versions of
          159  +SQLite ignore the sqlite_stat2 table.
          160  +Future enhancements may create
          161  +additional <a href="fileformat2.html#intschema">internal tables</a> with the same name pattern except with
          162  +final digit larger than "4".
          163  +All of these tables are collectively referred to as "statistics tables".
          164  +</p>
          165  +
          166  +<p> The content of the statistics tables can be queried using <a href="lang_select.html">SELECT</a>
          167  +and can be changed using the <a href="lang_delete.html">DELETE</a>, <a href="lang_insert.html">INSERT</a>, and <a href="lang_update.html">UPDATE</a> commands.
          168  +The <a href="lang_droptable.html">DROP TABLE</a> command works on statistics tables
          169  +as of SQLite version 3.7.9.
          170  +The <a href="lang_altertable.html">ALTER TABLE</a> command does not work on statistics tables.
          171  +Appropriate care should be used when changing the content of the statistics
          172  +tables as invalid content can cause SQLite to select inefficient
          173  +query plans.  Generally speaking, one should not modify the content of
          174  +the statistics tables by any mechanism other than invoking the
          175  +ANALYZE command.  
          176  +See "<a href="optoverview.html#manctrl">Manual Control Of Query Plans Using SQLITE_STAT Tables</a>" for
          177  +further information.</p>
          178  +
          179  +<p> Statistics gathered by ANALYZE are not automatically updated as
          180  +the content of the database changes.  If the content of the database
          181  +changes significantly, or if the database schema changes, then one should
          182  +consider rerunning the ANALYZE command in order to update the statistics.</p>
          183  +
          184  +<p> The query planner loads the content of the statistics tables
          185  +into memory when the schema is read.  Hence, when an application
          186  +changes the statistics tables directly, SQLite will not immediately
          187  +notice the changes. An application
          188  +can force the query planner to reread the statistics tables by running
          189  +<b>ANALYZE sqlite_master</b>. </p>
          190  +
          191  +<p> 
          192  +
          193  +

Changes to Doc/Extra/Core/lang_attach.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>ATTACH DATABASE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">ATTACH DATABASE</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        ATTACH DATABASE</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">ATTACH </font></b>[<b><font color="#2c2cf0">DATABASE</font></b>]<b><font
    55         -                color="#2c2cf0"> </font></b><i><font color="#ff3434">database-filename</font></i><b><font
    56         -                  color="#2c2cf0"> AS </font></b><i><font color="#ff3434">database-name</font></i><b><font
    57         -                    color="#2c2cf0"></font></b></td>
    58         -          </tr>
    59         -        </table>
    60         -      </p>
    61         -      <p>
    62         -        The ATTACH DATABASE statement adds another database file to the current database
    63         -        connection. If the filename contains punctuation characters it must be quoted. The
    64         -        names 'main' and 'temp' refer to the main database and the database used for temporary
    65         -        tables. These cannot be detached. Attached databases are removed using the <a href="lang_detach.html">
    66         -          DETACH DATABASE</a> statement.</p>
    67         -      <p>
    68         -        You can read from and write to an attached database and you can modify the schema
    69         -        of the attached database. This is a new feature of SQLite version 3.0. In SQLite
    70         -        2.8, schema changes to attached databases were not allowed.</p>
    71         -      <p>
    72         -        You cannot create a new table with the same name as a table in an attached database,
    73         -        but you can attach a database which contains tables whose names are duplicates of
    74         -        tables in the main database. It is also permissible to attach the same database
    75         -        file multiple times.</p>
    76         -      <p>
    77         -        Tables in an attached database can be referred to using the syntax <i>database-name.table-name</i>.
    78         -        If an attached table doesn't have a duplicate table name in the main database, it
    79         -        doesn't require a database name prefix. When a database is attached, all of its
    80         -        tables which don't have duplicate names become the default table of that name. Any
    81         -        tables of that name attached afterwards require the table prefix. If the default
    82         -        table of a given name is detached, then the last table of that name attached becomes
    83         -        the new default.</p>
    84         -      <p>
    85         -        Transactions involving multiple attached databases are atomic, assuming that the
    86         -        main database is not ":memory:". If the main database is ":memory:" then transactions
    87         -        continue to be atomic within each individual database file. But if the host computer
    88         -        crashes in the middle of a COMMIT where two or more database files are updated,
    89         -        some of those files might get the changes where others might not. Atomic commit
    90         -        of attached databases is a new feature of SQLite version 3.0. In SQLite version
    91         -        2.8, all commits to attached databases behaved as if the main database were ":memory:".
    92         -      </p>
    93         -      <p>
    94         -        There is a compile-time limit of 10 attached database files.</p>
    95         -      <p>
    96         -      <hr>
    97         -        &nbsp;</p>
    98         -      <div id="footer">
    99         -        <p>
   100         -          &nbsp;</p>
   101         -        <p>
   102         -        </p>
   103         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: ATTACH DATABASE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
   104    126       </div>
   105         -    </div>
   106         -  </body>
   107         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>ATTACH DATABASE</h2><p><b><a href="syntaxdiagrams.html#attach-stmt">attach-stmt:</a></b>
          132  +<button id='x771' onclick='hideorshow("x771","x772")'>hide</button></p>
          133  + <blockquote id='x772'>
          134  + <img alt="syntax diagram attach-stmt" src="images/syntax/attach-stmt.gif" />
          135  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          136  +<button id='x773' onclick='hideorshow("x773","x774")'>show</button></p>
          137  + <blockquote id='x774' style='display:none;'>
          138  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          139  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          140  +<button id='x775' onclick='hideorshow("x775","x776")'>show</button></p>
          141  + <blockquote id='x776' style='display:none;'>
          142  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          143  +</blockquote>
          144  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          145  +<button id='x777' onclick='hideorshow("x777","x778")'>show</button></p>
          146  + <blockquote id='x778' style='display:none;'>
          147  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          148  +</blockquote>
          149  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          150  +<button id='x779' onclick='hideorshow("x779","x780")'>show</button></p>
          151  + <blockquote id='x780' style='display:none;'>
          152  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          153  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          154  +<button id='x781' onclick='hideorshow("x781","x782")'>show</button></p>
          155  + <blockquote id='x782' style='display:none;'>
          156  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          157  +</blockquote>
          158  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          159  +<button id='x783' onclick='hideorshow("x783","x784")'>show</button></p>
          160  + <blockquote id='x784' style='display:none;'>
          161  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          162  +</blockquote>
          163  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          164  +<button id='x785' onclick='hideorshow("x785","x786")'>show</button></p>
          165  + <blockquote id='x786' style='display:none;'>
          166  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          167  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          168  +<button id='x787' onclick='hideorshow("x787","x788")'>show</button></p>
          169  + <blockquote id='x788' style='display:none;'>
          170  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          171  +</blockquote>
          172  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          173  +<button id='x789' onclick='hideorshow("x789","x790")'>show</button></p>
          174  + <blockquote id='x790' style='display:none;'>
          175  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          176  +</blockquote>
          177  +</blockquote>
          178  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          179  +<button id='x791' onclick='hideorshow("x791","x792")'>show</button></p>
          180  + <blockquote id='x792' style='display:none;'>
          181  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          182  +</blockquote>
          183  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          184  +<button id='x793' onclick='hideorshow("x793","x794")'>show</button></p>
          185  + <blockquote id='x794' style='display:none;'>
          186  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          187  +</blockquote>
          188  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          189  +<button id='x795' onclick='hideorshow("x795","x796")'>show</button></p>
          190  + <blockquote id='x796' style='display:none;'>
          191  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          192  +</blockquote>
          193  +</blockquote>
          194  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          195  +<button id='x797' onclick='hideorshow("x797","x798")'>show</button></p>
          196  + <blockquote id='x798' style='display:none;'>
          197  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          198  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          199  +<button id='x799' onclick='hideorshow("x799","x800")'>show</button></p>
          200  + <blockquote id='x800' style='display:none;'>
          201  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          202  +</blockquote>
          203  +</blockquote>
          204  +</blockquote>
          205  +</blockquote>
          206  +
          207  +
          208  +<p> The ATTACH DATABASE statement adds another database 
          209  +file to the current <a href="c3ref/sqlite3.html">database connection</a>. 
          210  +The filename for the database to be attached is the value of
          211  +the expression that occurs before the AS keyword.
          212  +The filename of the database follows the same semantics as the
          213  +filename argument to <a href="c3ref/open.html">sqlite3_open()</a> and <a href="c3ref/open.html">sqlite3_open_v2()</a>; the
          214  +special name "<a href="inmemorydb.html">:memory:</a>" results in an <a href="inmemorydb.html">in-memory database</a> and an
          215  +empty string results in a new temporary database.
          216  +The filename argument can be a <a href="uri.html">URI filename</a> if URI filename processing
          217  +is enable on the database connection.  The default behavior is for
          218  +URI filenames to be disabled, however that might change in a future release
          219  +of SQLite, so application developers are advised to plan accordingly.
          220  +
          221  +<p>The name that occurs after the AS keyword is the name of the database
          222  +used internally by SQLite.
          223  +The database-names 'main' and 
          224  +'temp' refer to the main database and the database used for 
          225  +temporary tables.  The main and temp databases cannot be attached or
          226  +detached.</p>
          227  +
          228  +<p> Tables in an attached database can be referred to using the syntax 
          229  +<i>database-name.table-name</i>.  If the name of the table is unique
          230  +across all attached databases and the main and temp databases, then the
          231  +<i>database-name</i> prefix is not required.  If two or more tables in
          232  +different databases have the same name and the 
          233  +<i>database-name</i> prefix is not used on a table reference, then the
          234  +table chosen is the one in the database that was least recently attached.</p>
          235  +
          236  +<p>
          237  +Transactions involving multiple attached databases are atomic,
          238  +assuming that the main database is not "<a href="inmemorydb.html">:memory:</a>" and the 
          239  +<a href="pragma.html#pragma_journal_mode">journal_mode</a> is not <a href="wal.html">WAL</a>.  If the main
          240  +database is ":memory:" or if the journal_mode is WAL, then 
          241  +transactions continue to be atomic within each individual
          242  +database file. But if the host computer crashes in the middle
          243  +of a <a href="lang_transaction.html">COMMIT</a> where two or more database files are updated,
          244  +some of those files might get the changes where others
          245  +might not.
          246  +</p>
          247  +
          248  +<p> There is a limit, set using <a href="c3ref/limit.html">sqlite3_limit()</a> and 
          249  +<a href="c3ref/c_limit_attached.html#sqlitelimitattached">SQLITE_LIMIT_ATTACHED</a>, to the number of databases that can be
          250  +simultaneously attached to a single database connection.</p>
          251  +
          252  +

Changes to Doc/Extra/Core/lang_comment.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>comment</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">comment</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        comment</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">comment</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0"></font></b><i><font color="#ff3434">SQL-comment</font></i><b><font
    55         -                color="#2c2cf0"> </font></b><big>|</big><b><font color="#2c2cf0"> </font></b><i><font
    56         -                  color="#ff3434">C-comment</font></i><b><font color="#2c2cf0"></font></b></td>
    57         -          </tr>
    58         -          <tr>
    59         -            <td align="right" width="1%" nowrap>
    60         -              <i><font color="#ff3434">SQL-comment</font></i> ::=</td>
    61         -            <td>
    62         -              <b><font color="#2c2cf0">-- </font></b><i><font color="#ff3434">single-line</font></i><b><font
    63         -                color="#2c2cf0"></font></b></td>
    64         -          </tr>
    65         -          <tr>
    66         -            <td align="right" width="1%" nowrap>
    67         -              <i><font color="#ff3434">C-comment</font></i> ::=</td>
    68         -            <td>
    69         -              <b><font color="#2c2cf0">/<big>*</big> </font></b><i><font color="#ff3434">multiple-lines</font></i><b><font
    70         -                color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"><big>*</big>/</font></b>]<b><font
    71         -                  color="#2c2cf0"></font></b></td>
    72         -          </tr>
    73         -        </table>
    74         -      </p>
    75         -      <p>
    76         -        Comments aren't SQL commands, but can occur in SQL queries. They are treated as
    77         -        whitespace by the parser. They can begin anywhere whitespace can be found, including
    78         -        inside expressions that span multiple lines.
    79         -      </p>
    80         -      <p>
    81         -        SQL comments only extend to the end of the current line.</p>
    82         -      <p>
    83         -        C comments can span any number of lines. If there is no terminating delimiter, they
    84         -        extend to the end of the input. This is not treated as an error. A new SQL statement
    85         -        can begin on a line after a multiline comment ends. C comments can be embedded anywhere
    86         -        whitespace can occur, including inside expressions, and in the middle of
    87         -          other SQL
    88         -        statements. C comments do not nest. SQL comments inside a C comment will be ignored.
    89         -      </p>
    90         -      <p>
    91         -      <hr>
    92         -        &nbsp;</p>
    93         -      <div id="footer">
    94         -        <p>
    95         -          &nbsp;</p>
    96         -        <p>
    97         -        </p>
    98         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: comment</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    99    126       </div>
   100         -    </div>
   101         -  </body>
   102         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>comment</h2><p><b><a href="syntaxdiagrams.html#comment-syntax">comment-syntax:</a></b>
          132  +<button id='x805' onclick='hideorshow("x805","x806")'>hide</button></p>
          133  + <blockquote id='x806'>
          134  + <img alt="syntax diagram comment-syntax" src="images/syntax/comment-syntax.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>Comments are not SQL commands, but can occur within the text of
          139  +SQL queries passed to <a href="c3ref/prepare.html">sqlite3_prepare_v2()</a> and related interfaces.
          140  +Comments are treated as whitespace by the parser.
          141  +Comments can begin anywhere whitespace 
          142  +can be found, including inside expressions that span multiple lines.
          143  +</p>
          144  +
          145  +<p>SQL comments begin with two consecutive "-" characters (ASCII 0x2d)
          146  +and extend up to and including the next newline character (ASCII 0x0a)
          147  +or until the end of input, whichever comes first.</p>
          148  +
          149  +<p>C-style comments begin
          150  +with "/*" and extend up to and including the next "*/" character pair
          151  +or until the end of input, whichever comes first.  C-style comments
          152  +can span multiple lines. </p>
          153  +
          154  +<p>Comments can appear anywhere whitespace can occur,
          155  +including inside expressions and in the middle of other SQL statements.
          156  +Comments do not nest.
          157  +</p>
          158  +
          159  +
          160  +

Changes to Doc/Extra/Core/lang_conflict.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>ON CONFLICT</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">ON CONFLICT clause</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        ON CONFLICT clause</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">conflict-clause</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">ON CONFLICT </font></b><i><font color="#ff3434">conflict-algorithm</font></i><b><font
    55         -                color="#2c2cf0"></font></b></td>
    56         -          </tr>
    57         -          <tr>
    58         -            <td align="right" width="1%" nowrap>
    59         -              <i><font color="#ff3434">conflict-algorithm</font></i> ::=</td>
    60         -            <td>
    61         -              <b><font color="#2c2cf0">ROLLBACK </font></b><big>|</big><b><font color="#2c2cf0">
    62         -                ABORT </font></b><big>|</big><b><font color="#2c2cf0"> FAIL </font></b><big>|</big><b><font
    63         -                  color="#2c2cf0"> IGNORE </font></b><big>|</big><b><font color="#2c2cf0"> REPLACE</font></b></td>
    64         -          </tr>
    65         -        </table>
    66         -      </p>
    67         -      <p>
    68         -        The ON CONFLICT clause is not a separate SQL command. It is a non-standard clause
    69         -        that can appear in many
    70         -          other SQL commands. It is given its own section in this
    71         -        document because it is not part of standard SQL and therefore might not be familiar.</p>
    72         -      <p>
    73         -        The syntax for the ON CONFLICT clause is as shown above for the CREATE TABLE command.
    74         -        For the INSERT and UPDATE commands, the keywords "ON CONFLICT" are replaced by "OR",
    75         -        to make the syntax seem more natural. For example, instead of "INSERT ON CONFLICT
    76         -        IGNORE" we have "INSERT OR IGNORE". The keywords change but the meaning of the clause
    77         -        is the same either way.</p>
    78         -      <p>
    79         -        The ON CONFLICT clause specifies an algorithm used to resolve constraint conflicts.
    80         -        There are five choices: ROLLBACK, ABORT, FAIL, IGNORE, and REPLACE. The default
    81         -        algorithm is ABORT. This is what they mean:</p>
    82         -      <dl>
    83         -        <dt><b>ROLLBACK</b> </dt>
    84         -        <dd>
    85         -          <p>
    86         -            When a constraint violation occurs, an immediate ROLLBACK occurs, thus ending the
    87         -            current transaction, and the command aborts with a return code of SQLITE_CONSTRAINT.
    88         -            If no transaction is active (other than the implied transaction that is created
    89         -            on every command) then this algorithm works the same as ABORT.</p>
    90         -        </dd>
    91         -        <dt><b>ABORT</b> </dt>
    92         -        <dd>
    93         -          <p>
    94         -            When a constraint violation occurs, the command backs out any prior changes it might
    95         -            have made and aborts with a return code of SQLITE_CONSTRAINT. But no ROLLBACK is
    96         -            executed so changes from prior commands within the same transaction are preserved.
    97         -            This is the default behavior.</p>
    98         -        </dd>
    99         -        <dt><b>FAIL</b> </dt>
   100         -        <dd>
   101         -          <p>
   102         -            When a constraint violation occurs, the command aborts with a return code SQLITE_CONSTRAINT.
   103         -            But any changes to the database that the command made prior to encountering the
   104         -            constraint violation are preserved and are not backed out. For example, if an UPDATE
   105         -            statement encountered a constraint violation on the 100th row that it attempts to
   106         -            update, then the first 99 row changes are preserved but changes to rows 100 and
   107         -            beyond never occur.</p>
   108         -        </dd>
   109         -        <dt><b>IGNORE</b> </dt>
   110         -        <dd>
   111         -          <p>
   112         -            When a constraint violation occurs, the one row that contains the constraint violation
   113         -            is not inserted or changed. But the command continues executing normally. Other
   114         -            rows before and after the row that contained the constraint violation continue to
   115         -            be inserted or updated normally. No error is returned.</p>
   116         -        </dd>
   117         -        <dt><b>REPLACE</b> </dt>
   118         -        <dd>
   119         -          <p>
   120         -            When a UNIQUE constraint violation occurs, the pre-existing rows that are causing
   121         -            the constraint violation are removed prior to inserting or updating the current
   122         -            row. Thus the insert or update always occurs. The command continues executing normally.
   123         -            No error is returned. If a NOT NULL constraint violation occurs, the NULL value
   124         -            is replaced by the default value for that column. If the column has no default value,
   125         -            then the ABORT algorithm is used. If a CHECK constraint violation occurs then the
   126         -            IGNORE algorithm is used.</p>
   127         -          <p>
   128         -            When this conflict resolution strategy deletes rows in order to satisfy a constraint,
   129         -            it does not invoke delete triggers on those rows. This behavior might change in
   130         -            a future release.</p>
   131         -        </dd>
   132         -      </dl>
   133         -      <p>
   134         -        The algorithm specified in the OR clause of a INSERT or UPDATE overrides any algorithm
   135         -        specified in a CREATE TABLE. If no algorithm is specified anywhere, the ABORT algorithm
   136         -        is used.</p>
   137         -      <p>
   138         -      <hr>
   139         -        &nbsp;</p>
   140         -      <div id="footer">
   141         -        <p>
   142         -          &nbsp;</p>
   143         -        <p>
   144         -        </p>
   145         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: ON CONFLICT clause</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
   146    126       </div>
   147         -    </div>
   148         -  </body>
   149         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>ON CONFLICT clause</h2><p><b><a href="syntaxdiagrams.html#conflict-clause">conflict-clause:</a></b>
          132  +<button id='x1117' onclick='hideorshow("x1117","x1118")'>hide</button></p>
          133  + <blockquote id='x1118'>
          134  + <img alt="syntax diagram conflict-clause" src="images/syntax/conflict-clause.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>The ON CONFLICT clause is not a separate SQL command.  It is a
          139  +non-standard clause that can appear in many other SQL commands.
          140  +It is given its own section in this document because it is not
          141  +part of standard SQL and therefore might not be familiar.</p>
          142  +
          143  +<p>The syntax for the ON CONFLICT clause is as shown above for
          144  +the CREATE TABLE command.  For the INSERT and
          145  +UPDATE commands, the keywords "ON CONFLICT" are replaced by "OR" so that
          146  +the syntax reads more naturally.  For example, instead of
          147  +"INSERT ON CONFLICT IGNORE" we have "INSERT OR IGNORE".
          148  +The keywords change but the meaning of the clause is the same
          149  +either way.</p>
          150  +
          151  +<p>The ON CONFLICT clause applies to UNIQUE and NOT NULL
          152  +constraints (and to PRIMARY KEY constraints which for the purposes 
          153  +of this section are the same thing as UNIQUE constraints).
          154  +The ON CONFLICT algorithm does not
          155  +apply to <a href="foreignkeys.html">FOREIGN KEY constraints</a>.
          156  +There are five conflict resolution algorithm choices:
          157  +ROLLBACK, ABORT, FAIL, IGNORE, and REPLACE.
          158  +The default conflict resolution algorithm is ABORT.  This
          159  +is what they mean:</p>
          160  +
          161  +<dl>
          162  +<dt><b>ROLLBACK</b></dt>
          163  +<dd><p> When an applicable constraint violation occurs, the ROLLBACK
          164  +resolution algorithm aborts the current SQL statement with
          165  +an SQLITE_CONSTRAINT error and rolls back the current transaction.
          166  +If no transaction is
          167  +active (other than the implied transaction that is created on every
          168  +command) then the ROLLBACK resolution algorithm works the same as the
          169  +ABORT algorithm.</p></dd>
          170  +
          171  +<dt><b>ABORT</b></dt>
          172  +<dd><p> When an applicable constraint violation occurs, the ABORT
          173  +resolution algorithm aborts the current SQL statement
          174  +with an SQLITE_CONSTRAINT error and backs out any changes
          175  +made by the current SQL statement; but changes caused
          176  +by prior SQL statements within the same transaction are preserved and the
          177  +transaction remains active.
          178  +This is the default behavior and the behavior specified by the SQL
          179  +standard.</p></dd>
          180  +
          181  +<dt><b>FAIL</b></dt>
          182  +<dd><p> When an applicable constraint violation occurs, the FAIL
          183  +resolution algorithm aborts the current SQL statement with an
          184  +SQLITE_CONSTRAINT error.  But the FAIL resolution does not
          185  +back out prior changes of the SQL statement that failed nor does
          186  +it end the transaction.
          187  +For example, if an UPDATE
          188  +statement encountered a constraint violation on the 100th row that
          189  +it attempts to update, then the first 99 row changes are preserved
          190  +but changes to rows 100 and beyond never occur.</p></dd>
          191  +
          192  +<dt><b>IGNORE</b></dt>
          193  +<dd><p> When an applicable constraint violation occurs, 
          194  +the IGNORE resolution algorithm skips the one row that contains
          195  +the constraint violation and continues processing subsequent rows
          196  +of the SQL statement as if nothing went wrong.
          197  +Other rows before and after the row that
          198  +contained the constraint violation are inserted or updated
          199  +normally. No error is returned when the IGNORE conflict resolution
          200  +algorithm is used.</p></dd>
          201  +
          202  +<dt><b>REPLACE</b></dt>
          203  +<dd><p> When a UNIQUE constraint violation occurs, the REPLACE algorithm
          204  +deletes pre-existing rows that are causing the constraint violation
          205  +prior to inserting or updating the current row and the command continues 
          206  +executing normally.
          207  +If a NOT NULL constraint violation occurs, the REPLACE conflict
          208  +resolution replaces the NULL value with
          209  +the default value for that column, or if the column has no default
          210  +value, then the ABORT algorithm is used.
          211  +If a CHECK constraint violation occurs, the REPLACE conflict resolution
          212  +algorithm always works like ABORT.</p>
          213  +
          214  +<p>When the REPLACE conflict resolution strategy deletes rows in order to
          215  +satisfy a constraint, <a href="lang_createtrigger.html">delete triggers</a> fire if and only if
          216  +<a href="pragma.html#pragma_recursive_triggers">recursive triggers</a> are enabled.</p>
          217  +
          218  +<p>The <a href="c3ref/update_hook.html">update hook</a> is not invoked for rows that
          219  +are deleted by the REPLACE conflict resolution strategy.  Nor does
          220  +REPLACE increment the <a href="c3ref/changes.html">change counter</a>.
          221  +The exceptional behaviors defined in this paragraph might change 
          222  +in a future release.</p>
          223  +</dl>
          224  +
          225  +<p>The algorithm specified in the OR clause of an INSERT or UPDATE
          226  +overrides any algorithm specified in a CREATE TABLE.
          227  +If no algorithm is specified anywhere, the ABORT algorithm is used.</p>
          228  +
          229  +

Added Doc/Extra/Core/lang_corefunc.html.

            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: Core Functions</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
          126  +    </div>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>Core Functions</h2>
          132  +
          133  +<p>The core functions shown below are available by default. 
          134  +<a href="lang_datefunc.html">Date &amp; Time functions</a> and
          135  +<a href="lang_aggfunc.html">aggregate functions</a> are documented separately.  An
          136  +application may define additional
          137  +functions written in C and added to the database engine using
          138  +the <a href="c3ref/create_function.html">sqlite3_create_function()</a> API.</p>
          139  +
          140  +<table border=0 cellpadding=10>
          141  +<tr><td valign="top" align="right" width="120"><a name="abs"></a>
          142  +abs(<i>X</i>)</td><td valign="top">
          143  +  The abs(X) function returns the absolute value of the numeric
          144  +  argument X.  Abs(X) returns NULL if X is NULL. 
          145  +  Abs(X) return 0.0 if X is a string or blob
          146  +  that cannot be converted to a numeric value.  If X is the 
          147  +  integer -9223372036854775808 then abs(X) throws an integer overflow
          148  +  error since there is no equivalent positive 64-bit two complement value.
          149  +</td></tr><tr><td valign="top" align="right" width="120"><a name="changes"></a>
          150  +changes()</td><td valign="top">
          151  +  The changes() function returns the number of database rows that were changed
          152  +  or inserted or deleted by the most recently completed INSERT, DELETE,
          153  +  or UPDATE statement, exclusive of statements in lower-level triggers.
          154  +  The changes() SQL function is a wrapper around the <a href="c3ref/changes.html">sqlite3_changes()</a>
          155  +  C/C++ function and hence follows the same rules for counting changes.
          156  +</td></tr><tr><td valign="top" align="right" width="120"><a name="char"></a>
          157  +char(<i>X1</i>,<i>X2</i>,...,<i>XN</i>)</td><td valign="top">
          158  +  The char(X1,X2,...,XN) function returns a string composed of characters having the
          159  +   unicode code point values of integers X1 through XN, respectively.
          160  +</td></tr><tr><td valign="top" align="right" width="120"><a name="coalesce"></a>
          161  +coalesce(<i>X</i>,<i>Y</i>,...)</td><td valign="top">
          162  +  The coalesce() function returns a copy of its first non-NULL argument, or
          163  +  NULL if all arguments are NULL.  Coalesce() must have at least 
          164  +  2 arguments.
          165  +</td></tr><tr><td valign="top" align="right" width="120"><a name="glob"></a>
          166  +glob(<i>X</i>,<i>Y</i>)</td><td valign="top">
          167  +  The glob(X,Y) function is equivalent to the
          168  +  expression "<b>Y GLOB X</b>".
          169  +  Note that the X and Y arguments are reversed in the glob() function
          170  +  relative to the infix <a href="lang_expr.html#glob">GLOB</a> operator.
          171  +  If the <a href="c3ref/create_function.html">sqlite3_create_function()</a> interface is used to
          172  +  override the glob(X,Y) function with an alternative implementation then
          173  +  the <a href="lang_expr.html#glob">GLOB</a> operator will invoke the alternative implementation.
          174  +</td></tr><tr><td valign="top" align="right" width="120"><a name="ifnull"></a>
          175  +ifnull(<i>X</i>,<i>Y</i>)</td><td valign="top">
          176  +  The ifnull() function returns a copy of its first non-NULL argument, or
          177  +  NULL if both arguments are NULL.  Ifnull() must have exactly 2 arguments.
          178  +  The ifnull() function is equivalent to <a href="lang_corefunc.html#coalesce">coalesce()</a> with two arguments.
          179  +</td></tr><tr><td valign="top" align="right" width="120"><a name="instr"></a>
          180  +instr(<i>X</i>,<i>Y</i>)</td><td valign="top">
          181  +  The instr(X,Y) function finds the first occurrence of string Y within 
          182  +  string X and returns the number of prior characters plus 1, or 0 if
          183  +  Y is nowhere found within X.
          184  +  Or, if X and Y are both BLOBs, then instr(X,Y) returns one
          185  +  more than the number bytes prior to the first occurrence of Y, or 0 if
          186  +  Y does not occur anywhere within X.
          187  +  If both arguments X and Y to instr(X,Y) are non-NULL and are not BLOBs
          188  +  then both are interpreted as strings.
          189  +  If either X or Y are NULL in instr(X,Y) then the result is NULL.
          190  +</td></tr><tr><td valign="top" align="right" width="120"><a name="hex"></a>
          191  +hex(<i>X</i>)</td><td valign="top">
          192  +  The hex() function interprets its argument as a BLOB and returns
          193  +  a string which is the upper-case hexadecimal rendering of the content of
          194  +  that blob.
          195  +</td></tr><tr><td valign="top" align="right" width="120"><a name="last_insert_rowid"></a>
          196  +last_insert_rowid()</td><td valign="top">
          197  +  The last_insert_rowid() function returns the <a href="lang_createtable.html#rowid">ROWID</a>
          198  +  of the last row insert from the database connection which invoked the
          199  +  function.
          200  +  The last_insert_rowid() SQL function is a wrapper around the
          201  +  <a href="c3ref/last_insert_rowid.html">sqlite3_last_insert_rowid()</a> C/C++ interface function.
          202  +</td></tr><tr><td valign="top" align="right" width="120"><a name="length"></a>
          203  +length(<i>X</i>)</td><td valign="top">
          204  +  For a string value X, the length(X) function returns the number of 
          205  +  characters (not bytes) in X prior to the first NUL character.
          206  +  Since SQLite strings do not normally contain NUL characters, the length(X)
          207  +  function will usually return the total number of characters in the string X.
          208  +  For a blob value X, length(X) returns the number of bytes in the blob.
          209  +  If X is NULL then length(X) is NULL.
          210  +  If X is numeric then length(X) returns the length of a string
          211  +  representation of X.
          212  +</td></tr><tr><td valign="top" align="right" width="120"><a name="like"></a>
          213  +like(<i>X</i>,<i>Y</i>)<br />like(<i>X</i>,<i>Y</i>,<i>Z</i>)</td><td valign="top">
          214  +  The like() function is used to implement the
          215  +  "<b>Y LIKE X &#91;ESCAPE Z&#93;</b>" expression. 
          216  +  If the optional ESCAPE clause is present, then the
          217  +  like() function is invoked with three arguments.  Otherwise, it is
          218  +  invoked with two arguments only. Note that the X and Y parameters are
          219  +  reversed in the like() function relative to the infix <a href="lang_expr.html#like">LIKE</a> operator.
          220  +  The <a href="c3ref/create_function.html">sqlite3_create_function()</a> interface can be used to override the
          221  +  like() function and thereby change the operation of the
          222  +  <a href="lang_expr.html#like">LIKE</a> operator.  When overriding the like() function, it may be important
          223  +  to override both the two and three argument versions of the like() 
          224  +  function. Otherwise, different code may be called to implement the
          225  +  <a href="lang_expr.html#like">LIKE</a> operator depending on whether or not an ESCAPE clause was 
          226  +  specified.
          227  +</td></tr><tr><td valign="top" align="right" width="120"><a name="likelihood"></a>
          228  +likelihood(<i>X</i>,<i>Y</i>)</td><td valign="top">
          229  +  The likelihood(X,Y) function returns argument X unchanged.
          230  +  The value Y in likelihood(X,Y) must be a floating point constant
          231  +  between 0.0 and 1.0, inclusive.
          232  +  The likelihood(X) function is a no-op that the code generator
          233  +  optimizes away so that it consumes no CPU cycles during run-time
          234  +  (that is, during calls to <a href="c3ref/step.html">sqlite3_step()</a>).
          235  +  The purpose of the likelihood(X,Y) function is to provide a hint
          236  +  to the query planner that the argument X is a boolean that is
          237  +  true with a probability of approximately Y.
          238  +  The <a href="lang_corefunc.html#unlikely">unlikely(X)</a> function is short-hand for likelihood(X,0.0625).
          239  +</td></tr><tr><td valign="top" align="right" width="120"><a name="load_extension"></a>
          240  +load_extension(<i>X</i>)<br />load_extension(<i>X</i>,<i>Y</i>)</td><td valign="top">
          241  +  The load_extension(X,Y) function loads <a href="loadext.html">SQLite extensions</a> out of the shared
          242  +  library file named X using the entry point Y.  The result of load_extension()
          243  +  is always a NULL.  If Y is omitted then the default entry point name is used.
          244  +  The load_extension() function raises an exception if the extension fails to
          245  +  load or initialize correctly.
          246  +
          247  +  <p>The load_extension() function will fail if the extension attempts to 
          248  +  modify or delete an SQL function or collating sequence.  The
          249  +  extension can add new functions or collating sequences, but cannot
          250  +  modify or delete existing functions or collating sequences because
          251  +  those functions and/or collating sequences might be used elsewhere
          252  +  in the currently running SQL statement.  To load an extension that
          253  +  changes or deletes functions or collating sequences, use the
          254  +  <a href="c3ref/load_extension.html">sqlite3_load_extension()</a> C-language API.</p>
          255  +
          256  +  <p>For security reasons, extension loaded is turned off by default and must
          257  +  be enabled by a prior call to <a href="c3ref/enable_load_extension.html">sqlite3_enable_load_extension()</a>.</p>
          258  +</td></tr><tr><td valign="top" align="right" width="120"><a name="lower"></a>
          259  +lower(<i>X</i>)</td><td valign="top">
          260  +  The lower(X) function returns a copy of string X with all ASCII characters
          261  +  converted to lower case.  The default built-in lower() function works
          262  +  for ASCII characters only.  To do case conversions on non-ASCII
          263  +  characters, load the ICU extension.
          264  +</td></tr><tr><td valign="top" align="right" width="120"><a name="ltrim"></a>
          265  +ltrim(<i>X</i>)<br />ltrim(<i>X</i>,<i>Y</i>)</td><td valign="top">
          266  +  The ltrim(X,Y) function returns a string formed by removing any and all
          267  +  characters that appear in Y from the left side of X.
          268  +  If the Y argument is omitted, ltrim(X) removes spaces from the left side
          269  +  of X.
          270  +</td></tr><tr><td valign="top" align="right" width="120"><a name="maxoreunc"></a>
          271  +max(<i>X</i>,<i>Y</i>,...)</td><td valign="top">
          272  +  The multi-argument max() function returns the argument with the 
          273  +  maximum value, or return NULL if any argument is NULL. 
          274  +  The multi-argument max() function searches its arguments from left to right
          275  +  for an argument that defines a collating function and uses that collating
          276  +  function for all string comparisons.  If none of the arguments to max()
          277  +  define a collating function, then the BINARY collating function is used.
          278  +  Note that <b>max()</b> is a simple function when
          279  +  it has 2 or more arguments but operates as an
          280  +  <a href="lang_aggfunc.html#minggunc">aggregate function</a> if given only a single argument.
          281  +</td></tr><tr><td valign="top" align="right" width="120"><a name="minoreunc"></a>
          282  +min(<i>X</i>,<i>Y</i>,...)</td><td valign="top">
          283  +  The multi-argument min() function returns the argument with the
          284  +  minimum value.
          285  +  The multi-argument min() function searches its arguments from left to right
          286  +  for an argument that defines a collating function and uses that collating
          287  +  function for all string comparisons.  If none of the arguments to min()
          288  +  define a collating function, then the BINARY collating function is used.
          289  +  Note that <b>min()</b> is a simple function when
          290  +  it has 2 or more arguments but operates as an 
          291  +  <a href="lang_aggfunc.html#maxggunc">aggregate function</a> if given
          292  +  only a single argument.
          293  +</td></tr><tr><td valign="top" align="right" width="120"><a name="nullif"></a>
          294  +nullif(<i>X</i>,<i>Y</i>)</td><td valign="top">
          295  +  The nullif(X,Y) function returns its first argument if the arguments are
          296  +  different and NULL if the arguments are the same.  The nullif(X,Y) function
          297  +  searches its arguments from left to right for an argument that defines a
          298  +  collating function and uses that collating function for all string
          299  +  comparisons.  If neither argument to nullif() defines a collating function
          300  +  then the BINARY is used.
          301  +</td></tr><tr><td valign="top" align="right" width="120"><a name="printf"></a>
          302  +printf(<i>FORMAT</i>,...)</td><td valign="top">
          303  +  The printf(FORMAT,...) SQL function works like the <a href="c3ref/mprintf.html">sqlite3_mprintf()</a> C-language
          304  +  function and the printf() function from the standard C library.
          305  +  The first argument is a format string that specifies how to construct the output
          306  +  string using values taken from subsequent arguments.  If the FORMAT argument is
          307  +  missing or NULL then the result is NULL.  The %n format is silently ignored and
          308  +  does not consume an argument.  The %p format is an alias for %X.  The %z format
          309  +  is interchangeable with %s.  If there are too few arguments in the argument list,
          310  +  missing arguments are assumed to have a NULL value, which is translated into
          311  +  0 or 0.0 for numeric formats or an empty string for %s.
          312  +</td></tr><tr><td valign="top" align="right" width="120"><a name="quote"></a>
          313  +quote(<i>X</i>)</td><td valign="top">
          314  +  The quote(X) function returns the text of an SQL literal which
          315  +  is the value of its argument suitable for inclusion into an SQL statement.
          316  +  Strings are surrounded by single-quotes with escapes on interior quotes
          317  +  as needed.  BLOBs are encoded as hexadecimal literals.
          318  +  Strings with embedded NUL characters cannot be represented as string
          319  +  literals in SQL and hence the returned string literal is truncated prior
          320  +  to the first NUL.
          321  +</td></tr><tr><td valign="top" align="right" width="120"><a name="random"></a>
          322  +random()</td><td valign="top">
          323  +  The random() function returns a pseudo-random integer
          324  +  between -9223372036854775808 and +9223372036854775807.
          325  +</td></tr><tr><td valign="top" align="right" width="120"><a name="randomblob"></a>
          326  +randomblob(<i>N</i>)</td><td valign="top">
          327  +  The randomblob(N) function return an N-byte blob containing pseudo-random
          328  +  bytes. If N is less than 1 then a 1-byte random blob is returned.
          329  +
          330  +  <p>Hint:  applications can generate globally unique identifiers
          331  +  using this function together with <a href="lang_corefunc.html#hex">hex()</a> and/or
          332  +  <a href="lang_corefunc.html#lower">lower()</a> like this:</p>
          333  +
          334  +  <blockquote>
          335  +  hex(randomblob(16))<br></br>
          336  +  lower(hex(randomblob(16)))
          337  +  </blockquote>
          338  +</td></tr><tr><td valign="top" align="right" width="120"><a name="replace"></a>
          339  +replace(<i>X</i>,<i>Y</i>,<i>Z</i>)</td><td valign="top">
          340  +  The replace(X,Y,Z) function returns a string formed by substituting
          341  +  string Z for every occurrence of string Y in string X.  The <a href="datatype3.html#collation">BINARY</a>
          342  +  collating sequence is used for comparisons.  If Y is an empty
          343  +  string then return X unchanged.  If Z is not initially
          344  +  a string, it is cast to a UTF-8 string prior to processing.
          345  +</td></tr><tr><td valign="top" align="right" width="120"><a name="round"></a>
          346  +round(<i>X</i>)<br />round(<i>X</i>,<i>Y</i>)</td><td valign="top">
          347  +  The round(X,Y) function returns a floating-point
          348  +  value X rounded to Y digits to the right of the decimal point.
          349  +  If the Y argument is omitted, it is assumed to be 0.
          350  +</td></tr><tr><td valign="top" align="right" width="120"><a name="rtrim"></a>
          351  +rtrim(<i>X</i>)<br />rtrim(<i>X</i>,<i>Y</i>)</td><td valign="top">
          352  +  The rtrim(X,Y) function returns a string formed by removing any and all
          353  +  characters that appear in Y from the right side of X.
          354  +  If the Y argument is omitted, rtrim(X) removes spaces from the right
          355  +  side of X.
          356  +</td></tr><tr><td valign="top" align="right" width="120"><a name="soundex"></a>
          357  +soundex(<i>X</i>)</td><td valign="top">
          358  +  The soundex(X) function returns a string that is the soundex encoding 
          359  +  of the string X.
          360  +  The string "?000" is returned if the argument is NULL or contains
          361  +  no ASCII alphabetic characters.
          362  +  This function is omitted from SQLite by default.
          363  +  It is only available if the <a href="compile.html#soundex">SQLITE_SOUNDEX</a> compile-time option
          364  +  is used when SQLite is built.
          365  +</td></tr><tr><td valign="top" align="right" width="120"><a name="sqlite_compileoption_get"></a>
          366  +sqlite_compileoption_get(<i>N</i>)</td><td valign="top">
          367  +  The sqlite_compileoption_get() SQL function is a wrapper around the
          368  +  <a href="c3ref/compileoption_get.html">sqlite3_compileoption_get()</a> C/C++ function.
          369  +  This routine returns the N-th compile-time option used to build SQLite
          370  +  or NULL if N is out of range.  See also the <a href="pragma.html#pragma_compile_options">compile_options pragma</a>.
          371  +</td></tr><tr><td valign="top" align="right" width="120"><a name="sqlite_compileoption_used"></a>
          372  +sqlite_compileoption_used(<i>X</i>)</td><td valign="top">
          373  +  The sqlite_compileoption_used() SQL function is a wrapper around the
          374  +  <a href="c3ref/compileoption_get.html">sqlite3_compileoption_used()</a> C/C++ function.
          375  +  When the argument X to sqlite_compileoption_used(X) is a string which
          376  +  is the name of a compile-time option, this routine returns true (1) or
          377  +  false (0) depending on whether or not that option was used during the
          378  +  build.
          379  +</td></tr><tr><td valign="top" align="right" width="120"><a name="sqlite_source_id"></a>
          380  +sqlite_source_id()</td><td valign="top">
          381  +  The sqlite_source_id() function returns a string that identifies the
          382  +  specific version of the source code that was used to build the SQLite
          383  +  library.  The string returned by sqlite_source_id() begins with
          384  +  the date and time that the source code was checked in and is follows by
          385  +  an SHA1 hash that uniquely identifies the source tree.  This function is
          386  +  an SQL wrapper around the <a href="c3ref/libversion.html">sqlite3_sourceid()</a> C interface.
          387  +</td></tr><tr><td valign="top" align="right" width="120"><a name="sqlite_version"></a>
          388  +sqlite_version()</td><td valign="top">
          389  +  The sqlite_version() function returns the version string for the SQLite
          390  +  library that is running.  This function is an SQL
          391  +  wrapper around the <a href="c3ref/libversion.html">sqlite3_libversion()</a> C-interface.
          392  +</td></tr><tr><td valign="top" align="right" width="120"><a name="substr"></a>
          393  +substr(<i>X</i>,<i>Y</i>,<i>Z</i>)<br />substr(<i>X</i>,<i>Y</i>)</td><td valign="top">
          394  +  The substr(X,Y,Z) function returns a substring of input string X that begins
          395  +  with the Y-th character and which is Z characters long.
          396  +  If Z is omitted then substr(X,Y) returns all characters through the end
          397  +  of the string X beginning with the Y-th.
          398  +  The left-most character of X is number 1.  If Y is negative
          399  +  then the first character of the substring is found by counting from the
          400  +  right rather than the left.  If Z is negative then
          401  +  the abs(Z) characters preceding the Y-th character are returned.
          402  +  If X is a string then characters indices refer to actual UTF-8 
          403  +  characters.  If X is a BLOB then the indices refer to bytes.
          404  +</td></tr><tr><td valign="top" align="right" width="120"><a name="total_changes"></a>
          405  +total_changes()</td><td valign="top">
          406  +  The total_changes() function returns the number of row changes
          407  +  caused by INSERT, UPDATE or DELETE
          408  +  statements since the current database connection was opened.
          409  +  This function is a wrapper around the <a href="c3ref/total_changes.html">sqlite3_total_changes()</a>
          410  +  C/C++ interface.
          411  +</td></tr><tr><td valign="top" align="right" width="120"><a name="trim"></a>
          412  +trim(<i>X</i>)<br />trim(<i>X</i>,<i>Y</i>)</td><td valign="top">
          413  +  The trim(X,Y) function returns a string formed by removing any and all
          414  +  characters that appear in Y from both ends of X.
          415  +  If the Y argument is omitted, trim(X) removes spaces from both ends of X.
          416  +</td></tr><tr><td valign="top" align="right" width="120"><a name="typeof"></a>
          417  +typeof(<i>X</i>)</td><td valign="top">
          418  +  The typeof(X) function returns a string that indicates the <a href="datatype3.html">datatype</a> of
          419  +  the expression X: "null", "integer", "real", "text", or "blob".
          420  +</td></tr><tr><td valign="top" align="right" width="120"><a name="unlikely"></a>
          421  +unlikely(<i>X</i>)</td><td valign="top">
          422  +  The unlikely(X) function returns the argument X unchanged.
          423  +  The unlikely(X) function is a no-op that the code generator
          424  +  optimizes away so that it consumes no CPU cycles at
          425  +  run-time (that is, during calls to <a href="c3ref/step.html">sqlite3_step()</a>).
          426  +  The purpose of the unlikely(X) function is to provide a hint
          427  +  to the query planner that the argument X is a boolean value
          428  +  that is usually not true. The unlikely(X) function is equivalent
          429  +  to <a href="lang_corefunc.html#likelihood">likelihood</a>(X, 0.0625).
          430  +</td></tr><tr><td valign="top" align="right" width="120"><a name="unicode"></a>
          431  +unicode(<i>X</i>)</td><td valign="top">
          432  +  The unicode(X) function returns the numeric unicode code point corresponding to
          433  +  the first character of the string X.  If the argument to unicode(X) is not a string
          434  +  then the result is undefined.
          435  +</td></tr><tr><td valign="top" align="right" width="120"><a name="upper"></a>
          436  +upper(<i>X</i>)</td><td valign="top">
          437  +  The upper(X) function returns a copy of input string X in which all 
          438  +  lower-case ASCII characters are converted to their upper-case equivalent.
          439  +</td></tr><tr><td valign="top" align="right" width="120"><a name="zeroblob"></a>
          440  +zeroblob(<i>N</i>)</td><td valign="top">
          441  +  The zeroblob(N) function returns a BLOB consisting of N bytes of 0x00.
          442  +  SQLite manages these zeroblobs very efficiently.  Zeroblobs can be used to
          443  +  reserve space for a BLOB that is later written using 
          444  +  <a href="c3ref/blob_open.html">incremental BLOB I/O</a>.
          445  +  This SQL function is implemented using the <a href="c3ref/result_blob.html">sqlite3_result_zeroblob()</a>
          446  +  routine from the C/C++ interface.
          447  +</td></tr>
          448  +</table>
          449  +
          450  +

Changes to Doc/Extra/Core/lang_createindex.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>CREATE INDEX</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">CREATE INDEX</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        CREATE INDEX</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">CREATE </font></b>[<b><font color="#2c2cf0">UNIQUE</font></b>]<b><font
    55         -                color="#2c2cf0"> INDEX </font></b>[<b><font color="#2c2cf0">IF NOT EXISTS</font></b>]<b><font
    56         -                  color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    57         -                    color="#2c2cf0"> <big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    58         -              <i><font color="#ff3434">index-name</font></i><b><font color="#2c2cf0">
    59         -                <br />
    60         -                ON </font></b><i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0">
    61         -                  <big>(</big> </font></b><i><font color="#ff3434">column-name</font></i><b><font color="#2c2cf0">
    62         -                  </font></b>[<b><font color="#2c2cf0"><big>,</big> </font></b><i><font color="#ff3434">
    63         -                    column-name</font></i><b><font color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"></font></b><big>*</big><b><font
    64         -                      color="#2c2cf0"> <big>)</big></font></b></td>
    65         -          </tr>
    66         -          <tr>
    67         -            <td align="right" width="1%" nowrap>
    68         -              <i><font color="#ff3434">column-name</font></i> ::=</td>
    69         -            <td>
    70         -              <b><font color="#2c2cf0"></font></b><i><font color="#ff3434">name</font></i><b><font
    71         -                color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"> COLLATE </font></b><i><font
    72         -                  color="#ff3434">collation-name</font></i><b><font color="#2c2cf0"></font></b>]<b><font
    73         -                    color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"> ASC </font></b><big>|</big><b><font
    74         -                      color="#2c2cf0"> DESC </font></b>]<b><font color="#2c2cf0"></font></b></td>
    75         -          </tr>
    76         -        </table>
    77         -      </p>
    78         -      <p>
    79         -        The CREATE INDEX command consists of the keywords "CREATE INDEX" followed by the
    80         -        name of the new index, the keyword "ON", the name of a previously created table
    81         -        that is to be indexed, and a parenthesized list of names of columns in the table
    82         -        that are used for the index key. Each column name can be followed by one of the
    83         -        "ASC" or "DESC" keywords to indicate sort order, but the sort order is ignored in
    84         -        the current implementation. Sorting is always done in ascending order.</p>
    85         -      <p>
    86         -        The COLLATE clause following each column name defines a collating sequence used
    87         -        for text entires in that column. The default collating sequence is the collating
    88         -        sequence defined for that column in the CREATE TABLE statement. Or if no collating
    89         -        sequence is otherwise defined, the built-in BINARY collating sequence is used.</p>
    90         -      <p>
    91         -        There are no arbitrary limits on the number of indices that can be attached to a
    92         -        single table, nor on the number of columns in an index.</p>
    93         -      <p>
    94         -        If the UNIQUE keyword appears between CREATE and INDEX then duplicate index entries
    95         -        are not allowed. Any attempt to insert a duplicate entry will result in an error.</p>
    96         -      <p>
    97         -        The exact text of each CREATE INDEX statement is stored in the <b>sqlite_master</b>
    98         -        or <b>sqlite_temp_master</b> table, depending on whether the table being indexed
    99         -        is temporary. Every time the database is opened, all CREATE INDEX statements are
   100         -        read from the <b>sqlite_master</b> table and used to regenerate
   101         -        SQLite's internal
   102         -        representation of the index layout.</p>
   103         -      <p>
   104         -        If the optional IF NOT EXISTS clause is present and another index with the same name aleady exists, then this command becomes a no-op.</p>
   105         -      <p>
   106         -        Indexes are removed with the <a href="lang_dropindex.html">DROP INDEX</a> command.</p>
   107         -      <p>
   108         -      <hr>
   109         -        &nbsp;</p>
   110         -      <div id="footer">
   111         -        <p>
   112         -          &nbsp;</p>
   113         -        <p>
   114         -        </p>
   115         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: CREATE INDEX</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
   116    126       </div>
   117         -    </div>
   118         -  </body>
   119         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>CREATE INDEX</h2><p><b><a href="syntaxdiagrams.html#create-index-stmt">create-index-stmt:</a></b>
          132  +<button id='x807' onclick='hideorshow("x807","x808")'>hide</button></p>
          133  + <blockquote id='x808'>
          134  + <img alt="syntax diagram create-index-stmt" src="images/syntax/create-index-stmt.gif" />
          135  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          136  +<button id='x809' onclick='hideorshow("x809","x810")'>show</button></p>
          137  + <blockquote id='x810' style='display:none;'>
          138  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          139  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          140  +<button id='x811' onclick='hideorshow("x811","x812")'>show</button></p>
          141  + <blockquote id='x812' style='display:none;'>
          142  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          143  +</blockquote>
          144  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          145  +<button id='x813' onclick='hideorshow("x813","x814")'>show</button></p>
          146  + <blockquote id='x814' style='display:none;'>
          147  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          148  +</blockquote>
          149  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          150  +<button id='x815' onclick='hideorshow("x815","x816")'>show</button></p>
          151  + <blockquote id='x816' style='display:none;'>
          152  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          153  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          154  +<button id='x817' onclick='hideorshow("x817","x818")'>show</button></p>
          155  + <blockquote id='x818' style='display:none;'>
          156  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          157  +</blockquote>
          158  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          159  +<button id='x819' onclick='hideorshow("x819","x820")'>show</button></p>
          160  + <blockquote id='x820' style='display:none;'>
          161  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          162  +</blockquote>
          163  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          164  +<button id='x821' onclick='hideorshow("x821","x822")'>show</button></p>
          165  + <blockquote id='x822' style='display:none;'>
          166  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          167  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          168  +<button id='x823' onclick='hideorshow("x823","x824")'>show</button></p>
          169  + <blockquote id='x824' style='display:none;'>
          170  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          171  +</blockquote>
          172  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          173  +<button id='x825' onclick='hideorshow("x825","x826")'>show</button></p>
          174  + <blockquote id='x826' style='display:none;'>
          175  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          176  +</blockquote>
          177  +</blockquote>
          178  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          179  +<button id='x827' onclick='hideorshow("x827","x828")'>show</button></p>
          180  + <blockquote id='x828' style='display:none;'>
          181  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          182  +</blockquote>
          183  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          184  +<button id='x829' onclick='hideorshow("x829","x830")'>show</button></p>
          185  + <blockquote id='x830' style='display:none;'>
          186  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          187  +</blockquote>
          188  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          189  +<button id='x831' onclick='hideorshow("x831","x832")'>show</button></p>
          190  + <blockquote id='x832' style='display:none;'>
          191  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          192  +</blockquote>
          193  +</blockquote>
          194  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          195  +<button id='x833' onclick='hideorshow("x833","x834")'>show</button></p>
          196  + <blockquote id='x834' style='display:none;'>
          197  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          198  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          199  +<button id='x835' onclick='hideorshow("x835","x836")'>show</button></p>
          200  + <blockquote id='x836' style='display:none;'>
          201  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          202  +</blockquote>
          203  +</blockquote>
          204  +</blockquote>
          205  +<p><b><a href="syntaxdiagrams.html#indexed-column">indexed-column:</a></b>
          206  +<button id='x837' onclick='hideorshow("x837","x838")'>show</button></p>
          207  + <blockquote id='x838' style='display:none;'>
          208  + <img alt="syntax diagram indexed-column" src="images/syntax/indexed-column.gif" />
          209  +</blockquote>
          210  +</blockquote>
          211  +
          212  +
          213  +<p>The CREATE INDEX command consists of the keywords "CREATE INDEX" followed
          214  +by the name of the new index, the keyword "ON", the name of a previously
          215  +created table that is to be indexed, and a parenthesized list of names of
          216  +columns in the table that are used for the index key.
          217  +If the optional WHERE clause is included, then the index is a "<a href="partialindex.html">partial index</a>".
          218  +</p>
          219  +
          220  +<a name="descidx"></a>
          221  +
          222  +<p>Each column name can be followed by one of the "ASC" or "DESC" keywords
          223  +to indicate sort order.  The sort order may or may not be ignored depending
          224  +on the database file format, and in particular the <a href="fileformat2.html#schemaformat">schema format number</a>.
          225  +The "legacy" schema format (1) ignores index
          226  +sort order.  The descending index schema format (4) takes index sort order
          227  +into account.  Only versions of SQLite 3.3.0 and later are able to understand
          228  +the descending index format. For compatibility, version of SQLite between 3.3.0
          229  +and 3.7.9 use the legacy schema format by default.  The newer schema format is
          230  +used by default in version 3.7.10 and later.
          231  +The <a href="pragma.html#pragma_legacy_file_format">legacy_file_format pragma</a> can be used to change set the specific
          232  +behavior for any version of SQLite.</p>
          233  +
          234  +<p>The COLLATE clause optionally following each column name defines a
          235  +collating sequence used for text entries in that column.
          236  +The default collating
          237  +sequence is the collating sequence defined for that column in the
          238  +<a href="lang_createtable.html">CREATE TABLE</a> statement.  Or if no collating sequence is otherwise defined,
          239  +the built-in BINARY collating sequence is used.</p>
          240  +
          241  +<p>There are no arbitrary limits on the number of indices that can be
          242  +attached to a single table.  The number of columns in an index is 
          243  +limited to the value set by
          244  +<a href="c3ref/limit.html">sqlite3_limit</a>(<a href="c3ref/c_limit_attached.html#sqlitelimitcolumn">SQLITE_LIMIT_COLUMN</a>,...).</p>
          245  +
          246  +<a name="uniqueidx"></a>
          247  +
          248  +<p>If the UNIQUE keyword appears between CREATE and INDEX then duplicate
          249  +index entries are not allowed.  Any attempt to insert a duplicate entry
          250  +will result in an error.  For the purposes of unique indices, all NULL values
          251  +are considered to different from all other NULL values and are thus unique.
          252  +This is one of the two possible interpretations of the SQL-92 standard
          253  +(the language in the standard is ambiguous) and is the interpretation
          254  +followed by PostgreSQL, MySQL, Firebird, and Oracle.  Informix and
          255  +Microsoft SQL Server follow the other interpretation of the standard.</p>
          256  +
          257  +<p>If the optional IF NOT EXISTS clause is present and another index
          258  +with the same name already exists, then this command becomes a no-op.</p>
          259  +
          260  +<p>Indexes are removed with the <a href="lang_dropindex.html">DROP INDEX</a> command.</p>
          261  +
          262  +
          263  +

Changes to Doc/Extra/Core/lang_createtable.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>CREATE TABLE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">CREATE TABLE</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: CREATE TABLE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    41    126       </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        CREATE TABLE</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">CREATE </font></b>[<b><font color="#2c2cf0">TEMP </font></b>
    55         -              <big>|</big><b><font color="#2c2cf0"> TEMPORARY</font></b>]<b><font color="#2c2cf0">
    56         -                TABLE </font></b>[<b><font color="#2c2cf0">IF NOT EXISTS</font></b>]<b><font color="#2c2cf0">
    57         -                </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    58         -                  color="#2c2cf0"> <big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    59         -              <i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0"> <big>(</big><br />
    60         -                &nbsp; &nbsp; </font></b><i><font color="#ff3434">column-def</font></i><b><font color="#2c2cf0">
    61         -                </font></b>[<b><font color="#2c2cf0"><big>,</big> </font></b><i><font color="#ff3434">
    62         -                  column-def</font></i><b><font color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"></font></b><big>*</big><b><font
    63         -                    color="#2c2cf0"><br />
    64         -                    &nbsp; &nbsp; </font></b>[<b><font color="#2c2cf0"><big>,</big> </font></b>
    65         -              <i><font color="#ff3434">constraint</font></i><b><font color="#2c2cf0"></font></b>]<b><font
    66         -                color="#2c2cf0"></font></b><big>*</big><b><font color="#2c2cf0"><br />
    67         -                  <big>)</big></font></b></td>
    68         -          </tr>
    69         -          <tr>
    70         -            <td align="right" width="1%" nowrap>
    71         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    72         -            <td>
    73         -              <b><font color="#2c2cf0">CREATE </font></b>[<b><font color="#2c2cf0">TEMP </font></b>
    74         -              <big>|</big><b><font color="#2c2cf0"> TEMPORARY</font></b>]<b><font color="#2c2cf0">
    75         -                TABLE </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    76         -                  color="#2c2cf0"><big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    77         -              <i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0"> AS </font>
    78         -              </b><i><font color="#ff3434">select-statement</font></i><b><font color="#2c2cf0"></font></b></td>
    79         -          </tr>
    80         -          <tr>
    81         -            <td align="right" width="1%" nowrap>
    82         -              <i><font color="#ff3434">column-def</font></i> ::=</td>
    83         -            <td>
    84         -              <b><font color="#2c2cf0"></font></b><i><font color="#ff3434">name</font></i><b><font
    85         -                color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">type</font></i><b><font
    86         -                  color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"></font></b>[<b><font
    87         -                    color="#2c2cf0">CONSTRAINT </font></b><i><font color="#ff3434">name</font></i><b><font
    88         -                      color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"> </font></b><i><font color="#ff3434">
    89         -                        column-constraint</font></i><b><font color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"></font></b><big>*</big><b><font
    90         -                          color="#2c2cf0"></font></b></td>
    91         -          </tr>
    92         -          <tr>
    93         -            <td align="right" width="1%" nowrap>
    94         -              <i><font color="#ff3434">type</font></i> ::=</td>
    95         -            <td>
    96         -              <b><font color="#2c2cf0"></font></b><i><font color="#ff3434">typename</font></i><b><font
    97         -                color="#2c2cf0"> </font></b><big>|</big><b><font color="#2c2cf0"><br />
    98         -                </font></b><i><font color="#ff3434">typename</font></i><b><font color="#2c2cf0"> <big>
    99         -                  (</big> </font></b><i><font color="#ff3434">number</font></i><b><font color="#2c2cf0">
   100         -                    <big>)</big> </font></b><big>|</big><b><font color="#2c2cf0"><br />
   101         -                    </font></b><i><font color="#ff3434">typename</font></i><b><font color="#2c2cf0"> <big>
   102         -                      (</big> </font></b><i><font color="#ff3434">number</font></i><b><font color="#2c2cf0">
   103         -                        <big>,</big> </font></b><i><font color="#ff3434">number</font></i><b><font color="#2c2cf0">
   104         -                          <big>)</big></font></b></td>
   105         -          </tr>
   106         -          <tr>
   107         -            <td align="right" width="1%" nowrap>
   108         -              <i><font color="#ff3434">column-constraint</font></i> ::=</td>
   109         -            <td>
   110         -              <b><font color="#2c2cf0">NOT NULL </font></b>[<b><font color="#2c2cf0"> </font></b>
   111         -              <i><font color="#ff3434">conflict-clause</font></i><b><font color="#2c2cf0"> </font>
   112         -              </b>]<b><font color="#2c2cf0"> </font></b><big>|</big><b><font color="#2c2cf0"><br />
   113         -                PRIMARY KEY </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">sort-order</font></i><b><font
   114         -                  color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0">
   115         -                  </font></b><i><font color="#ff3434">conflict-clause</font></i><b><font color="#2c2cf0">
   116         -                  </font></b>]<b><font color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0">AUTOINCREMENT</font></b>]<b><font
   117         -                    color="#2c2cf0"> </font></b><big>|</big><b><font color="#2c2cf0"><br />
   118         -                      UNIQUE </font></b>[<b><font color="#2c2cf0"> </font></b><i><font color="#ff3434">conflict-clause</font></i><b><font
   119         -                        color="#2c2cf0"> </font></b>]<b><font color="#2c2cf0"> </font></b><big>|</big><b><font
   120         -                          color="#2c2cf0"><br />
   121         -                          CHECK <big>(</big> </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0">
   122         -                            <big>)</big> </font></b><big>|</big><b><font color="#2c2cf0"><br />
   123         -                              DEFAULT </font></b><i><font color="#ff3434">value</font></i><b><font color="#2c2cf0">
   124         -                              </font></b><big>|</big><b><font color="#2c2cf0"><br />
   125         -                                COLLATE </font></b><i><font color="#ff3434">collation-name</font></i><b><font color="#2c2cf0"></font></b></td>
   126         -          </tr>
   127         -          <tr>
   128         -            <td align="right" width="1%" nowrap>
   129         -              <i><font color="#ff3434">constraint</font></i> ::=</td>
   130         -            <td>
   131         -              <b><font color="#2c2cf0">PRIMARY KEY <big>(</big> </font></b><i><font color="#ff3434">
   132         -                column-list</font></i><b><font color="#2c2cf0"> <big>)</big> </font></b>[<b><font
   133         -                  color="#2c2cf0"> </font></b><i><font color="#ff3434">conflict-clause</font></i><b><font
   134         -                    color="#2c2cf0"> </font></b>]<b><font color="#2c2cf0"> </font></b><big>|</big><b><font
   135         -                      color="#2c2cf0"><br />
   136         -                      UNIQUE <big>(</big> </font></b><i><font color="#ff3434">column-list</font></i><b><font
   137         -                        color="#2c2cf0"> <big>)</big> </font></b>[<b><font color="#2c2cf0"> </font></b>
   138         -              <i><font color="#ff3434">conflict-clause</font></i><b><font color="#2c2cf0"> </font>
   139         -              </b>]<b><font color="#2c2cf0"> </font></b><big>|</big><b><font color="#2c2cf0"><br />
   140         -                CHECK <big>(</big> </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0">
   141         -                  <big>)</big></font></b></td>
   142         -          </tr>
   143         -          <tr>
   144         -            <td align="right" width="1%" nowrap>
   145         -              <i><font color="#ff3434">conflict-clause</font></i> ::=</td>
   146         -            <td>
   147         -              <b><font color="#2c2cf0">ON CONFLICT </font></b><i><font color="#ff3434">conflict-algorithm</font></i><b><font
   148         -                color="#2c2cf0"></font></b></td>
   149         -          </tr>
   150         -        </table>
   151         -      </p>
   152         -      <p>
   153         -        A CREATE TABLE statement is basically the keywords "CREATE TABLE" followed by the
   154         -        name of a new table and a parenthesized list of column definitions and constraints.
   155         -        The table name can be either an identifier or a string. Tables names that begin
   156         -        with "<b>sqlite_</b>" are reserved for use by the engine.</p>
   157         -      <p>
   158         -        Each column definition is the name of the column followed by the datatype for that
   159         -        column, then one or more optional column constraints. The datatype for the column
   160         -        does not restrict what data may be put in that column. See <a href="http://www.sqlite.org/datatype3.html">
   161         -          Datatypes In SQLite Version 3</a> for additional information. The UNIQUE constraint
   162         -        causes an index to be created on the specified columns. This index must contain
   163         -        unique keys. The COLLATE clause specifies what text <a href="http://www.sqlite.org/datatype3.html#collation">
   164         -          collating function</a> to use when comparing text entries for the column. The
   165         -        built-in BINARY collating function is used by default.
   166         -      </p>
   167         -      <p>
   168         -        The DEFAULT constraint specifies a default value to use when doing an INSERT. The
   169         -        value may be NULL, a string constant or a number. Starting with version 3.1.0, the
   170         -        default value may also be one of the special case-independant keywords CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP. If the value is NULL, a string constant or number,
   171         -        it is literally inserted into the column whenever an INSERT statement that does
   172         -        not specify a value for the column is executed. If the value is CURRENT_TIME, CURRENT_DATE
   173         -        or CURRENT_TIMESTAMP, then the current UTC date and/or time is inserted into the
   174         -        columns. For CURRENT_TIME, the format is HH:MM:SS. For CURRENT_DATE, YYYY-MM-DD.
   175         -        The format for CURRENT_TIMESTAMP is "YYYY-MM-DD HH:MM:SS".
   176         -      </p>
   177         -      <p>
   178         -        Specifying a PRIMARY KEY normally just creates a UNIQUE index on the corresponding
   179         -        columns. However, if primary key is on a single column that has datatype INTEGER,
   180         -        then that column is used internally as the actual key of the B-Tree for the table.
   181         -        This means that the column may only hold unique integer values. (Except for this
   182         -        one case, SQLite ignores the datatype specification of columns and allows any kind
   183         -        of data to be put in a column regardless of its declared datatype.) If a table does
   184         -        not have an INTEGER PRIMARY KEY column, then the B-Tree key will be a automatically
   185         -        generated integer. The B-Tree key for a row can always be accessed using one of
   186         -        the special names "<b>ROWID</b>", "<b>OID</b>", or "<b>_ROWID_</b>". This is true
   187         -        regardless of whether or not there is an INTEGER PRIMARY KEY. An INTEGER PRIMARY
   188         -        KEY column man also include the keyword AUTOINCREMENT. The AUTOINCREMENT keyword
   189         -        modified the way that B-Tree keys are automatically generated. Additional detail
   190         -        on automatic B-Tree key generation is available <a href="http://www.sqlite.org/autoinc.html">
   191         -          separately</a>.</p>
   192         -      <p>
   193         -        If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE" and "TABLE" then
   194         -        the table that is created is only visible within that same database connection and
   195         -        is automatically deleted when the database connection is closed. Any indices created
   196         -        on a temporary table are also temporary. Temporary tables and indices are stored
   197         -        in a separate file distinct from the main database file.</p>
   198         -      <p>
   199         -        If a &lt;database-name&gt; is specified, then the table is created in the named
   200         -        database. It is an error to specify both a &lt;database-name&gt; and the TEMP keyword,
   201         -        unless the &lt;database-name&gt; is "temp". If no database name is specified, and
   202         -        the TEMP keyword is not present, the table is created in the main database.</p>
   203         -      <p>
   204         -        The optional conflict-clause following each constraint allows the specification
   205         -        of an alternative default constraint conflict resolution algorithm for that constraint. The default is abort ABORT. Different constraints within the same table may have
   206         -        different default conflict resolution algorithms. If an COPY, INSERT, or UPDATE
   207         -        command specifies a different conflict resolution algorithm, then that algorithm
   208         -        is used in place of the default algorithm specified in the CREATE TABLE statement.
   209         -        See the section titled <a href="lang_conflict.html">ON CONFLICT</a> for additional
   210         -        information.</p>
   211         -      <p>
   212         -        CHECK constraints are supported as of version 3.3.0. Prior to version 3.3.0, CHECK
   213         -        constraints were parsed but not enforced.</p>
   214         -      <p>
   215         -        There are no arbitrary limits on the number of columns or on the number of constraints
   216         -        in a table. The total amount of data in a single row is limited to about 1 megabytes
   217         -        in version 2.8. In version 3.0 there is no arbitrary limit on the amount of data
   218         -        in a row.</p>
   219         -      <p>
   220         -        The CREATE TABLE AS form defines the table to be the result set of a query. The
   221         -        names of the table columns are the names of the columns in the result.</p>
   222         -      <p>
   223         -        The exact text of each CREATE TABLE statement is stored in the <b>sqlite_master</b>
   224         -        table. Every time the database is opened, all CREATE TABLE statements are read from
   225         -        the <b>sqlite_master</b> table and used to regenerate
   226         -        SQLite's internal representation
   227         -        of the table layout. If the original command was a CREATE TABLE AS then then an
   228         -        equivalent CREATE TABLE statement is synthesized and store in <b>sqlite_master</b>
   229         -        in place of the original command. The text of CREATE TEMPORARY TABLE statements
   230         -        are stored in the <b>sqlite_temp_master</b> table.
   231         -      </p>
   232         -      <p>
   233         -        If the optional IF NOT EXISTS clause is present and another table with the same
   234         -        name aleady exists, then this command becomes a no-op.</p>
   235         -      <p>
   236         -        Tables are removed using the <a href="lang_droptable.html">DROP TABLE</a> statement.
   237         -      </p>
   238         -      <p>
   239         -      <hr>
   240         -        &nbsp;</p>
   241         -      <div id="footer">
   242         -        <p>
   243         -          &nbsp;</p>
   244         -        <p>
   245         -        </p>
   246         -      </div>
   247         -    </div>
   248         -    </div>
   249         -  </body>
   250         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>CREATE TABLE</h2><p><b><a href="syntaxdiagrams.html#create-table-stmt">create-table-stmt:</a></b>
          132  +<button id='x839' onclick='hideorshow("x839","x840")'>hide</button></p>
          133  + <blockquote id='x840'>
          134  + <img alt="syntax diagram create-table-stmt" src="images/syntax/create-table-stmt.gif" />
          135  +<p><b><a href="syntaxdiagrams.html#column-def">column-def:</a></b>
          136  +<button id='x841' onclick='hideorshow("x841","x842")'>show</button></p>
          137  + <blockquote id='x842' style='display:none;'>
          138  + <img alt="syntax diagram column-def" src="images/syntax/column-def.gif" />
          139  +<p><b><a href="syntaxdiagrams.html#column-constraint">column-constraint:</a></b>
          140  +<button id='x843' onclick='hideorshow("x843","x844")'>show</button></p>
          141  + <blockquote id='x844' style='display:none;'>
          142  + <img alt="syntax diagram column-constraint" src="images/syntax/column-constraint.gif" />
          143  +<p><b><a href="syntaxdiagrams.html#conflict-clause">conflict-clause:</a></b>
          144  +<button id='x845' onclick='hideorshow("x845","x846")'>show</button></p>
          145  + <blockquote id='x846' style='display:none;'>
          146  + <img alt="syntax diagram conflict-clause" src="images/syntax/conflict-clause.gif" />
          147  +</blockquote>
          148  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          149  +<button id='x847' onclick='hideorshow("x847","x848")'>show</button></p>
          150  + <blockquote id='x848' style='display:none;'>
          151  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          152  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          153  +<button id='x849' onclick='hideorshow("x849","x850")'>show</button></p>
          154  + <blockquote id='x850' style='display:none;'>
          155  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          156  +</blockquote>
          157  +</blockquote>
          158  +<p><b><a href="syntaxdiagrams.html#foreign-key-clause">foreign-key-clause:</a></b>
          159  +<button id='x851' onclick='hideorshow("x851","x852")'>show</button></p>
          160  + <blockquote id='x852' style='display:none;'>
          161  + <img alt="syntax diagram foreign-key-clause" src="images/syntax/foreign-key-clause.gif" />
          162  +</blockquote>
          163  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          164  +<button id='x853' onclick='hideorshow("x853","x854")'>show</button></p>
          165  + <blockquote id='x854' style='display:none;'>
          166  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          167  +</blockquote>
          168  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          169  +<button id='x855' onclick='hideorshow("x855","x856")'>show</button></p>
          170  + <blockquote id='x856' style='display:none;'>
          171  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          172  +</blockquote>
          173  +</blockquote>
          174  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          175  +<button id='x857' onclick='hideorshow("x857","x858")'>show</button></p>
          176  + <blockquote id='x858' style='display:none;'>
          177  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          178  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          179  +<button id='x859' onclick='hideorshow("x859","x860")'>show</button></p>
          180  + <blockquote id='x860' style='display:none;'>
          181  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          182  +</blockquote>
          183  +</blockquote>
          184  +</blockquote>
          185  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          186  +<button id='x861' onclick='hideorshow("x861","x862")'>show</button></p>
          187  + <blockquote id='x862' style='display:none;'>
          188  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          189  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          190  +<button id='x863' onclick='hideorshow("x863","x864")'>show</button></p>
          191  + <blockquote id='x864' style='display:none;'>
          192  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          193  +</blockquote>
          194  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          195  +<button id='x865' onclick='hideorshow("x865","x866")'>show</button></p>
          196  + <blockquote id='x866' style='display:none;'>
          197  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          198  +</blockquote>
          199  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          200  +<button id='x867' onclick='hideorshow("x867","x868")'>show</button></p>
          201  + <blockquote id='x868' style='display:none;'>
          202  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          203  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          204  +<button id='x869' onclick='hideorshow("x869","x870")'>show</button></p>
          205  + <blockquote id='x870' style='display:none;'>
          206  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          207  +</blockquote>
          208  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          209  +<button id='x871' onclick='hideorshow("x871","x872")'>show</button></p>
          210  + <blockquote id='x872' style='display:none;'>
          211  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          212  +</blockquote>
          213  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          214  +<button id='x873' onclick='hideorshow("x873","x874")'>show</button></p>
          215  + <blockquote id='x874' style='display:none;'>
          216  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          217  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          218  +<button id='x875' onclick='hideorshow("x875","x876")'>show</button></p>
          219  + <blockquote id='x876' style='display:none;'>
          220  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          221  +</blockquote>
          222  +</blockquote>
          223  +</blockquote>
          224  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          225  +<button id='x877' onclick='hideorshow("x877","x878")'>show</button></p>
          226  + <blockquote id='x878' style='display:none;'>
          227  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          228  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          229  +<button id='x879' onclick='hideorshow("x879","x880")'>show</button></p>
          230  + <blockquote id='x880' style='display:none;'>
          231  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          232  +</blockquote>
          233  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          234  +<button id='x881' onclick='hideorshow("x881","x882")'>show</button></p>
          235  + <blockquote id='x882' style='display:none;'>
          236  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          237  +</blockquote>
          238  +</blockquote>
          239  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          240  +<button id='x883' onclick='hideorshow("x883","x884")'>show</button></p>
          241  + <blockquote id='x884' style='display:none;'>
          242  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          243  +</blockquote>
          244  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          245  +<button id='x885' onclick='hideorshow("x885","x886")'>show</button></p>
          246  + <blockquote id='x886' style='display:none;'>
          247  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          248  +</blockquote>
          249  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          250  +<button id='x887' onclick='hideorshow("x887","x888")'>show</button></p>
          251  + <blockquote id='x888' style='display:none;'>
          252  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          253  +</blockquote>
          254  +</blockquote>
          255  +<p><b><a href="syntaxdiagrams.html#table-constraint">table-constraint:</a></b>
          256  +<button id='x889' onclick='hideorshow("x889","x890")'>show</button></p>
          257  + <blockquote id='x890' style='display:none;'>
          258  + <img alt="syntax diagram table-constraint" src="images/syntax/table-constraint.gif" />
          259  +<p><b><a href="syntaxdiagrams.html#conflict-clause">conflict-clause:</a></b>
          260  +<button id='x891' onclick='hideorshow("x891","x892")'>show</button></p>
          261  + <blockquote id='x892' style='display:none;'>
          262  + <img alt="syntax diagram conflict-clause" src="images/syntax/conflict-clause.gif" />
          263  +</blockquote>
          264  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          265  +<button id='x893' onclick='hideorshow("x893","x894")'>show</button></p>
          266  + <blockquote id='x894' style='display:none;'>
          267  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          268  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          269  +<button id='x895' onclick='hideorshow("x895","x896")'>show</button></p>
          270  + <blockquote id='x896' style='display:none;'>
          271  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          272  +</blockquote>
          273  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          274  +<button id='x897' onclick='hideorshow("x897","x898")'>show</button></p>
          275  + <blockquote id='x898' style='display:none;'>
          276  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          277  +</blockquote>
          278  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          279  +<button id='x899' onclick='hideorshow("x899","x900")'>show</button></p>
          280  + <blockquote id='x900' style='display:none;'>
          281  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          282  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          283  +<button id='x901' onclick='hideorshow("x901","x902")'>show</button></p>
          284  + <blockquote id='x902' style='display:none;'>
          285  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          286  +</blockquote>
          287  +</blockquote>
          288  +</blockquote>
          289  +<p><b><a href="syntaxdiagrams.html#foreign-key-clause">foreign-key-clause:</a></b>
          290  +<button id='x903' onclick='hideorshow("x903","x904")'>show</button></p>
          291  + <blockquote id='x904' style='display:none;'>
          292  + <img alt="syntax diagram foreign-key-clause" src="images/syntax/foreign-key-clause.gif" />
          293  +</blockquote>
          294  +<p><b><a href="syntaxdiagrams.html#indexed-column">indexed-column:</a></b>
          295  +<button id='x905' onclick='hideorshow("x905","x906")'>show</button></p>
          296  + <blockquote id='x906' style='display:none;'>
          297  + <img alt="syntax diagram indexed-column" src="images/syntax/indexed-column.gif" />
          298  +</blockquote>
          299  +</blockquote>
          300  +</blockquote>
          301  +
          302  +
          303  +<p>The "CREATE TABLE" command is used to create a new table in an SQLite 
          304  +database. A CREATE TABLE command specifies the following attributes of the
          305  +new table:
          306  +
          307  +<ul>
          308  +  <li><p>The name of the new table.
          309  +
          310  +  <li><p> The database in which the new table is created. Tables may be 
          311  +      created in the main database, the temp database, or in any attached
          312  +      database.
          313  +
          314  +  <li><p> The name of each column in the table.
          315  +
          316  +  <li><p> The declared type of each column in the table.
          317  +
          318  +  <li><p> A default value or expression for each column in the table.
          319  +
          320  +  <li><p> A default collation sequence to use with each column.
          321  +
          322  +  <li><p> Optionally, a PRIMARY KEY for the table. Both single column and
          323  +       composite (multiple column) primary keys are supported.
          324  +
          325  +  <li><p> A set of SQL constraints for each table. SQLite supports UNIQUE, NOT
          326  +       NULL, CHECK and FOREIGN KEY constraints.
          327  +
          328  +  <li><p> Whether the table is a <a href="withoutrowid.html">WITHOUT ROWID</a> table.
          329  +</ul>
          330  +
          331  +<p>Every CREATE TABLE statement must specify a name for the new table.
          332  +  Table names that begin with "sqlite_" are reserved for internal use. It
          333  +  is an error to attempt to create a table with a name that starts with
          334  +  "sqlite_".
          335  +
          336  +<p> If a &lt;database-name&gt; is specified, it must be either "main", 
          337  +  "temp", or the name of an <a href="lang_attach.html">attached database</a>. In this case
          338  +  the new table is created in the named database. If the "TEMP" or "TEMPORARY"
          339  +  keyword occurs between the "CREATE" and "TABLE" then the new table is
          340  +  created in the temp database. It is an error to specify both a 
          341  +  &lt;database-name&gt; and the TEMP or TEMPORARY keyword, unless the
          342  +  &lt;database-name&gt; is "temp". If no database name is specified and the
          343  +  TEMP keyword is not present then the table is created in the main
          344  +  database.
          345  +
          346  +<p>
          347  +  It is usually an error to attempt to create a new table in a database that
          348  +  already contains a table, index or view of the same name. However, if the
          349  +  "IF NOT EXISTS" clause is specified as part of the CREATE TABLE statement and
          350  +  a table or view of the same name already exists, the CREATE TABLE command
          351  +  simply has no effect (and no error message is returned). An error is still
          352  +  returned if the table cannot be created because of an existing index, even 
          353  +  if the "IF NOT EXISTS" clause is specified.
          354  +
          355  +<p>It is not an error to create a table that has the same name as an 
          356  +  existing <a href="lang_createtrigger.html">trigger</a>.
          357  +
          358  +<p>Tables are removed using the <a href="lang_droptable.html">DROP TABLE</a> statement.  </p>
          359  +
          360  +<h3>CREATE TABLE ... AS SELECT Statements</h3>
          361  +
          362  +<p>A "CREATE TABLE ... AS SELECT" statement creates and populates a database
          363  +table based on the results of a SELECT statement. The table has the same
          364  +number of columns as the rows returned by the SELECT statement. The name of
          365  +each column is the same as the name of the corresponding column in the result
          366  +set of the SELECT statement. The declared type of each column is determined
          367  +by the <a href="datatype3.html#expraff">expression affinity</a> of the corresponding expression in the result set
          368  +of the SELECT statement, as follows:
          369  +</p>
          370  +
          371  +<center><table border=1>
          372  +  <tr><th>Expression Affinity   <th>Column Declared Type
          373  +  <tr><td>TEXT                  <td>"TEXT"
          374  +  <tr><td>NUMERIC               <td>"NUM"
          375  +  <tr><td>INTEGER               <td>"INT"
          376  +  <tr><td>REAL                  <td>"REAL"
          377  +  <tr><td>NONE                  <td>"" (empty string)
          378  +</table></center>
          379  +
          380  +<p>A table created using CREATE TABLE AS has no PRIMARY KEY and no
          381  +constraints of any kind. The default value of each column is NULL. The default
          382  +collation sequence for each column of the new table is BINARY.
          383  +
          384  +<p>Tables created using CREATE TABLE AS are initially populated with the
          385  +rows of data returned by the SELECT statement. Rows are assigned contiguously
          386  +ascending <a href="lang_createtable.html#rowid">rowid</a> values, starting with 1, in the <a href="lang_select.html#orderby">order</a> that they
          387  +are returned by the SELECT statement.
          388  +
          389  +<a name="tablecoldef"></a>
          390  +
          391  +<h3>Column Definitions</h3>
          392  +
          393  +<p>Unless it is a CREATE TABLE ... AS SELECT statement, a CREATE TABLE includes
          394  +one or more <a href="syntaxdiagrams.html#column-def">column definitions</a>, optionally followed by a list of
          395  +<a href="syntaxdiagrams.html#table-constraint">table constraints</a>.  Each column definition consists of the
          396  +name of the column, optionally followed by the declared type of the column,
          397  +then one or more optional <a href="syntaxdiagrams.html#column-constraint">column constraints</a>. Included in
          398  +the definition of "column constraints" for the purposes of the previous
          399  +statement are the COLLATE and DEFAULT clauses, even though these are not really
          400  +constraints in the sense that they do not restrict the data that the table may
          401  +contain. The other constraints - NOT NULL, CHECK, UNIQUE, PRIMARY KEY and
          402  +FOREIGN KEY constraints - impose restrictions on the tables data, and are are
          403  +described under <a href="lang_createtable.html#constraints">SQL Data Constraints</a> below.
          404  +
          405  +<p>Unlike most SQL databases, SQLite does not restrict the type of data that
          406  +may be inserted into a column based on the columns declared type. Instead,
          407  +SQLite uses <a href="datatype3.html">dynamic typing</a>. The declared type of a column is used to
          408  +determine the <a href="datatype3.html#affinity">affinity</a> of the column only.
          409  +
          410  +<p>The DEFAULT clause specifies a default value to use for the column if no
          411  +value is explicitly provided by the user when doing an <a href="lang_insert.html">INSERT</a>. If there
          412  +is no explicit DEFAULT clause attached to a column definition, then the 
          413  +default value of the column is NULL. An explicit DEFAULT clause may specify
          414  +that the default value is NULL, a string constant, a blob constant, a
          415  +signed-number, or any constant expression enclosed in parentheses. An explicit
          416  +default value may also be one of the special case-independent keywords
          417  +CURRENT_TIME, CURRENT_DATE or CURRENT_TIMESTAMP. For the purposes of the
          418  +DEFAULT clause, an expression is considered constant provided that it does
          419  +not contain any sub-queries or string constants enclosed in double quotes.
          420  +
          421  +<p>Each time a row is inserted into the table by an INSERT statement that 
          422  +does not provide explicit values for all table columns the values stored in
          423  +the new row are determined by their default values, as follows:
          424  +
          425  +<ul>
          426  +  <li><p>If the default value of the column is a constant NULL, text, blob or
          427  +    signed-number value, then that value is used directly in the new row.
          428  +
          429  +  <li><p>If the default value of a column is an expression in parentheses, then
          430  +    the expression is evaluated once for each row inserted and the results
          431  +    used in the new row.
          432  +
          433  +  <li><p>If the default value of a column is CURRENT_TIME, CURRENT_DATE or
          434  +    CURRENT_TIMESTAMP, then the value used in the new row is a text
          435  +    representation of the current UTC date and/or time. For CURRENT_TIME, the
          436  +    format of the value is "HH:MM:SS". For CURRENT_DATE, "YYYY-MM-DD". The
          437  +    format for CURRENT_TIMESTAMP is "YYYY-MM-DD HH:MM:SS".
          438  +</ul>
          439  +
          440  +<p>The COLLATE clause specifies the name of a <a href="datatype3.html#collation">collating sequence</a> to use as
          441  +the default collation sequence for the column. If no COLLATE clause is
          442  +specified, the default collation sequence is <a href="datatype3.html#collation">BINARY</a>.
          443  +
          444  +<p>The number of columns in a table is limited by the <a href="limits.html#max_column">SQLITE_MAX_COLUMN</a>
          445  +compile-time parameter. A single row of a table cannot store more than
          446  +<a href="limits.html#max_length">SQLITE_MAX_LENGTH</a> bytes of data. Both of these limits can be lowered at
          447  +runtime using the <a href="c3ref/limit.html">sqlite3_limit()</a> C/C++ interface.</p>
          448  +
          449  +<a name="constraints"></a>
          450  +
          451  +<h3>SQL Data Constraints</h3>
          452  +
          453  +<a name="primkeyconst"></a>
          454  +
          455  +<p>Each table in SQLite may have at most one <b>PRIMARY KEY</b>. If the
          456  +  keywords PRIMARY KEY are added to a column definition, then the primary key
          457  +  for the table consists of that single column. Or, if a PRIMARY KEY clause 
          458  +  is specified as a <a href="syntaxdiagrams.html#table-constraint">table-constraint</a>, then the primary key of the table
          459  +  consists of the list of columns specified as part of the PRIMARY KEY clause.
          460  +  An error is raised if more than one PRIMARY KEY clause appears in a
          461  +  CREATE TABLE statement.  The PRIMARY KEY is optional for ordinary tables
          462  +  but is required for <a href="withoutrowid.html">WITHOUT ROWID</a> tables.
          463  +
          464  +<p>If a table has a single column primary key and the declared type of that
          465  +  column is "INTEGER" and the table is not a <a href="withoutrowid.html">WITHOUT ROWID</a> table,
          466  +  then the column is known as an <a href="lang_createtable.html#rowid">INTEGER PRIMARY KEY</a>.
          467  +  See below for a description of the special properties and behaviors
          468  +  associated with an <a href="lang_createtable.html#rowid">INTEGER PRIMARY KEY</a>.
          469  +
          470  +<p>Each row in a table with a primary key must have a unique combination
          471  +  of values in its primary key columns. For the purposes of determining
          472  +  the uniqueness of primary key values, NULL values are considered distinct from
          473  +  all other values, including other NULLs. If an <a href="lang_insert.html">INSERT</a> or <a href="lang_update.html">UPDATE</a>
          474  +  statement attempts to modify the table content so that two or more rows
          475  +  feature identical primary key values, it is a constraint violation.
          476  +  According to the SQL standard, PRIMARY KEY should always imply NOT NULL.
          477  +  Unfortunately, due to a bug in some early versions, this is not the
          478  +  case in SQLite. Unless the column is an <a href="lang_createtable.html#rowid">INTEGER PRIMARY KEY</a> or
          479  +  the table is a <a href="withoutrowid.html">WITHOUT ROWID</a> table or the column is declared NOT NULL,
          480  +  SQLite allows NULL values in a PRIMARY KEY column.  SQLite could be fixed to
          481  +  conform to the standard, but doing so might break legacy applications.
          482  +  Hence, it has been decided to merely document the fact that SQLite
          483  +  allowing NULLs in most PRIMARY KEY columns.
          484  +
          485  +<a name="uniqueconst"></a>
          486  +
          487  +<p>A <b>UNIQUE</b> constraint is similar to a PRIMARY KEY constraint, except
          488  +  that a single table may have any number of UNIQUE constraints. For each
          489  +  UNIQUE constraint on the table, each row must contain a unique combination
          490  +  of values in the columns identified by the UNIQUE constraint. 
          491  +  For the purposes of UNIQUE constraints, NULL values
          492  +  are considered distinct from all other values, including other NULLs.
          493  +
          494  +<p>In most cases, UNIQUE and PRIMARY KEY
          495  +  constraints are implemented by creating a unique index in the database.
          496  +  (The exceptions are <a href="lang_createtable.html#rowid">INTEGER PRIMARY KEY</a> and PRIMARY KEYs on 
          497  +  <a href="withoutrowid.html">WITHOUT ROWID</a> tables.)
          498  +  Hence, the following schemas are logically equivalent:
          499  +
          500  +  <ol>
          501  +  <li><p>CREATE TABLE t1(a, b UNIQUE);
          502  +  <li><p>CREATE TABLE t1(a, b PRIMARY KEY);
          503  +  <li><p>CREATE TABLE t1(a, b);<br>
          504  +         CREATE UNIQUE INDEX t1b ON t1(b);
          505  +  </ol>
          506  +
          507  +<a name="ckconst"></a>
          508  +
          509  +<p>A <b>CHECK</b> constraint may be attached to a column definition or
          510  +  specified as a table constraint. In practice it makes no difference. Each
          511  +  time a new row is inserted into the table or an existing row is updated,
          512  +  the expression associated with each CHECK constraint is evaluated and
          513  +  cast to a NUMERIC value in the same way as a <a href="lang_expr.html#castexpr">CAST expression</a>. If the 
          514  +  result is zero (integer value 0 or real value 0.0), then a constraint
          515  +  violation has occurred. If the CHECK expression evaluates to NULL, or
          516  +  any other non-zero value, it is not a constraint violation.
          517  +  The expression of a CHECK constraint may not contain a subquery.
          518  +
          519  +<p>CHECK constraints have been supported since <a href="releaselog/3_3_0.html">version 3.3.0</a>. Prior to
          520  +  version 3.3.0, CHECK constraints were parsed but not enforced.
          521  +
          522  +<a name="notnullconst"></a>
          523  +
          524  +<p>A <b>NOT NULL</b> constraint may only be attached to a column definition,
          525  +  not specified as a table constraint.  Not surprisingly, a NOT NULL
          526  +  constraint dictates that the associated column may not contain a NULL value.
          527  +  Attempting to set the column value to NULL when inserting a new row or
          528  +  updating an existing one causes a constraint violation.
          529  +
          530  +<p>Exactly how a constraint violation is dealt with is determined by the
          531  +  <a href="lang_conflict.html">constraint conflict resolution algorithm</a>. Each 
          532  +  PRIMARY KEY, UNIQUE, NOT NULL and CHECK constraint has a default conflict
          533  +  resolution algorithm. PRIMARY KEY, UNIQUE and NOT NULL constraints may be
          534  +  explicitly assigned a default conflict resolution algorithm by including
          535  +  a <a href="syntaxdiagrams.html#conflict-clause">conflict-clause</a> in their definitions. Or, if a constraint definition
          536  +  does not include a <a href="syntaxdiagrams.html#conflict-clause">conflict-clause</a> or it is a CHECK constraint, the default
          537  +  conflict resolution algorithm is ABORT. Different constraints within the
          538  +  same table may have different default conflict resolution algorithms. See
          539  +  the section titled <a href="lang_conflict.html">ON CONFLICT</a> for additional information.
          540  +
          541  +<a name="rowid"></a>
          542  +
          543  +<h3>ROWIDs and the INTEGER PRIMARY KEY</h3>
          544  +
          545  +<p>Except for <a href="withoutrowid.html">WITHOUT ROWID</a> tables, all rows within SQLite tables
          546  +have a 64-bit signed integer key that uniquely identifies the row within its table.
          547  +This integer is usually
          548  +called the "rowid". The rowid value can be accessed using one of the special
          549  +case-independent names "rowid", "oid", or "_rowid_" in place of a column name.
          550  +If a table contains a user defined column named "rowid", "oid" or "_rowid_",
          551  +then that name always refers the explicitly declared column and cannot be used
          552  +to retrieve the integer rowid value.
          553  +
          554  +<p>The rowid (and "oid" and "_rowid_") is omitted in <a href="withoutrowid.html">WITHOUT ROWID</a> tables.
          555  +WITHOUT ROWID tables are only available in SQLite <a href="releaselog/3_8_2.html">version 3.8.2</a> and later.
          556  +A table that lacks the WITHOUT ROWID clause is called a "rowid table".
          557  +
          558  +<p>The data for rowid tables is stored as a B-Tree structure containing
          559  +one entry for each table row, using the rowid value as the key. This means that
          560  +retrieving or sorting records by rowid is fast. Searching for a record with a
          561  +specific rowid, or for all records with rowids within a specified range is
          562  +around twice as fast as a similar search made by specifying any other PRIMARY
          563  +KEY or indexed value.
          564  +
          565  +<p> With one exception noted below, if a rowid table has a primary key that consists
          566  +of a single column and the declared type of that column is "INTEGER" in any mixture of
          567  +upper and lower case, then the column becomes an alias for the rowid. Such a
          568  +column is usually referred to as an "integer primary key". A PRIMARY KEY column
          569  +only becomes an integer primary key if the declared type name is exactly
          570  +"INTEGER".  Other integer type names like "INT" or "BIGINT" or "SHORT INTEGER"
          571  +or "UNSIGNED INTEGER" causes the primary key column to behave as an ordinary
          572  +table column with integer <a href="datatype3.html#affinity">affinity</a> and a unique index, not as an alias for
          573  +the rowid.
          574  +
          575  +<p> The exception mentioned above is that if the declaration of a column with
          576  +declared type "INTEGER" includes an "PRIMARY KEY DESC" clause, it does not
          577  +become an alias for the rowid and is not classified as an integer primary key.
          578  +This quirk is not by design. It is due to a bug in early versions of SQLite.
          579  +But fixing the bug could result in backwards incompatibilities.
          580  +Hence, the original behavior has been retained (and documented) because
          581  +behavior in a corner case is far better than a compatibility break.  This means
          582  +that the following three table declarations all cause the column "x" to be an
          583  +alias for the rowid (an integer primary key):
          584  +
          585  +<ul>
          586  +<li><tt>CREATE TABLE t(x INTEGER PRIMARY KEY ASC, y, z);</tt>
          587  +<li><tt>CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x ASC));</tt>
          588  +<li><tt>CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x DESC));</tt>
          589  +</ul>
          590  +
          591  +<p>But the following declaration does not result in "x" being an alias for
          592  +the rowid:
          593  +<ul>
          594  +<li><tt>CREATE TABLE t(x INTEGER PRIMARY KEY DESC, y, z);</tt>
          595  +</ul>
          596  +
          597  +<p>Rowid values may be modified using an UPDATE statement in the same
          598  +way as any other column value can, either using one of the built-in aliases
          599  +("rowid", "oid" or "_rowid_") or by using an alias created by an integer
          600  +primary key. Similarly, an INSERT statement may provide a value to use as the
          601  +rowid for each row inserted. Unlike normal SQLite columns, an integer primary
          602  +key or rowid column must contain integer values. Integer primary key or rowid
          603  +columns are not able to hold floating point values, strings, BLOBs, or NULLs.
          604  +
          605  +<p>If an UPDATE statement attempts to set an integer primary key or rowid column
          606  +to a NULL or blob value, or to a string or real value that cannot be losslessly
          607  +converted to an integer, a "datatype mismatch" error occurs and the statement
          608  +is aborted. If an INSERT statement attempts to insert a blob value, or a string
          609  +or real value that cannot be losslessly converted to an integer into an
          610  +integer primary key or rowid column, a "datatype mismatch" error occurs and the
          611  +statement is aborted.
          612  +
          613  +<p>If an INSERT statement attempts to insert a NULL value into a rowid or
          614  +integer primary key column, the system chooses an integer value to use as the
          615  +rowid automatically. A detailed description of how this is done is provided
          616  +<a href="autoinc.html">separately</a>.</p>
          617  +
          618  +<p>The <a href="foreignkeys.html#parentchild">parent key</a> of a <a href="foreignkeys.html">foreign key constraint</a> is not allowed to
          619  +use the rowid.  The parent key must used named columns only.</p>
          620  +
          621  +

Changes to Doc/Extra/Core/lang_createtrigger.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>CREATE TABLE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">CREATE TRIGGER</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: CREATE TRIGGER</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    41    126       </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        CREATE TRIGGER</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">CREATE </font></b>[<b><font color="#2c2cf0">TEMP </font></b>
    55         -              <big>|</big><b><font color="#2c2cf0"> TEMPORARY</font></b>]<b><font color="#2c2cf0">
    56         -                TRIGGER </font></b><i><font color="#ff3434">trigger-name</font></i><b><font color="#2c2cf0">
    57         -                </font></b>[<b><font color="#2c2cf0"> BEFORE </font></b><big>|</big><b><font color="#2c2cf0">
    58         -                  AFTER </font></b>]<b><font color="#2c2cf0"><br />
    59         -                  </font></b><i><font color="#ff3434">database-event</font></i><b><font color="#2c2cf0">
    60         -                    ON </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    61         -                      color="#2c2cf0"> <big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    62         -              <i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0"><br />
    63         -              </font></b><i><font color="#ff3434">trigger-action</font></i><b><font color="#2c2cf0"></font></b></td>
    64         -          </tr>
    65         -        </table>
    66         -        <table cellpadding="10">
    67         -          <tr>
    68         -            <td align="right" width="1%" nowrap>
    69         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    70         -            <td>
    71         -              <b><font color="#2c2cf0">CREATE </font></b>[<b><font color="#2c2cf0">TEMP </font></b>
    72         -              <big>|</big><b><font color="#2c2cf0"> TEMPORARY</font></b>]<b><font color="#2c2cf0">
    73         -                TRIGGER </font></b><i><font color="#ff3434">trigger-name</font></i><b><font color="#2c2cf0">
    74         -                  INSTEAD OF<br />
    75         -                </font></b><i><font color="#ff3434">database-event</font></i><b><font color="#2c2cf0">
    76         -                  ON </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    77         -                    color="#2c2cf0"> <big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    78         -              <i><font color="#ff3434">view-name</font></i><b><font color="#2c2cf0"><br />
    79         -              </font></b><i><font color="#ff3434">trigger-action</font></i><b><font color="#2c2cf0"></font></b></td>
    80         -          </tr>
    81         -        </table>
    82         -        <table cellpadding="10">
    83         -          <tr>
    84         -            <td align="right" width="1%" nowrap>
    85         -              <i><font color="#ff3434">database-event</font></i> ::=</td>
    86         -            <td>
    87         -              <b><font color="#2c2cf0">DELETE </font></b><big>|</big><b><font color="#2c2cf0">
    88         -                <br />
    89         -                INSERT </font></b><big>|</big><b><font color="#2c2cf0">
    90         -                  <br />
    91         -                  UPDATE </font></b><big>|</big><b><font color="#2c2cf0">
    92         -                    <br />
    93         -                    UPDATE OF </font></b><i><font color="#ff3434">column-list</font></i><b><font color="#2c2cf0"></font></b></td>
    94         -          </tr>
    95         -        </table>
    96         -        <table cellpadding="10">
    97         -          <tr>
    98         -            <td align="right" width="1%" nowrap>
    99         -              <i><font color="#ff3434">trigger-action</font></i> ::=</td>
   100         -            <td>
   101         -              <b><font color="#2c2cf0"></font></b>[<b><font color="#2c2cf0"> FOR EACH ROW </font>
   102         -              </b><big>|</big><b><font color="#2c2cf0"> FOR EACH STATEMENT </font></b>]<b><font
   103         -                color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"> WHEN </font></b><i><font color="#ff3434">
   104         -                  expression</font></i><b><font color="#2c2cf0"> </font></b>]<b><font color="#2c2cf0">
   105         -                    <br />
   106         -                    BEGIN
   107         -                    <br />
   108         -                    &nbsp; &nbsp; </font></b><i><font color="#ff3434">trigger-step</font></i><b><font
   109         -                      color="#2c2cf0"> ; </font></b>[<b><font color="#2c2cf0"> </font></b><i><font color="#ff3434">
   110         -                        trigger-step</font></i><b><font color="#2c2cf0"> ; </font></b>]<b><font color="#2c2cf0"></font></b><big>*</big><b><font
   111         -                          color="#2c2cf0"><br />
   112         -                          END</font></b></td>
   113         -          </tr>
   114         -        </table>
   115         -        <table cellpadding="10">
   116         -          <tr>
   117         -            <td align="right" width="1%" nowrap>
   118         -              <i><font color="#ff3434">trigger-step</font></i> ::=</td>
   119         -            <td>
   120         -              <b><font color="#2c2cf0"></font></b><i><font color="#ff3434">update-statement</font></i><b><font
   121         -                color="#2c2cf0"> </font></b><big>|</big><b><font color="#2c2cf0"> </font></b><i><font
   122         -                  color="#ff3434">insert-statement</font></i><b><font color="#2c2cf0"> </font></b>
   123         -              <big>|</big><b><font color="#2c2cf0">
   124         -                <br />
   125         -              </font></b><i><font color="#ff3434">delete-statement</font></i><b><font color="#2c2cf0">
   126         -              </font></b><big>|</big><b><font color="#2c2cf0"> </font></b><i><font color="#ff3434">
   127         -                select-statement</font></i><b><font color="#2c2cf0"></font></b></td>
   128         -          </tr>
   129         -        </table>
   130         -      </p>
   131         -      <p>
   132         -        The CREATE TRIGGER statement is used to add triggers to the database schema. Triggers
   133         -        are database operations (the <i>trigger-action</i>) that are automatically performed
   134         -        when a specified database event (the <i>database-event</i>) occurs.
   135         -      </p>
   136         -      <p>
   137         -        A trigger may be specified to fire whenever a DELETE, INSERT or UPDATE of a particular
   138         -        database table occurs, or whenever an UPDATE of one or more specified columns of
   139         -        a table are updated.</p>
   140         -      <p>
   141         -        At this time SQLite supports only FOR EACH ROW triggers, not FOR EACH STATEMENT
   142         -        triggers. Hence explicitly specifying FOR EACH ROW is optional. FOR EACH ROW implies
   143         -        that the SQL statements specified as <i>trigger-steps</i> may be executed (depending
   144         -        on the WHEN clause) for each database row being inserted, updated or deleted by
   145         -        the statement causing the trigger to fire.</p>
   146         -      <p>
   147         -        Both the WHEN clause and the <i>trigger-steps</i> may access elements of the row
   148         -        being inserted, deleted or updated using references of the form "NEW.<i>column-name</i>"
   149         -        and "OLD.<i>column-name</i>", where <i>column-name</i> is the name of a column from the table that the trigger is associated with. OLD and NEW references may only be
   150         -        used in triggers on <i>trigger-event</i>s for which they are relevant, as follows:</p>
   151         -      <p>
   152         -        <table border="0" cellpadding="10">
   153         -          <tr>
   154         -            <td align="right" valign="top" width="120">
   155         -              <i>INSERT</i></td>
   156         -            <td valign="top">
   157         -              NEW references are valid</td>
   158         -          </tr>
   159         -          <tr>
   160         -            <td align="right" valign="top" width="120">
   161         -              <i>UPDATE</i></td>
   162         -            <td valign="top">
   163         -              NEW and OLD references are valid</td>
   164         -          </tr>
   165         -          <tr>
   166         -            <td align="right" valign="top" width="120">
   167         -              <i>DELETE</i></td>
   168         -            <td valign="top">
   169         -              OLD references are valid</td>
   170         -          </tr>
   171         -        </table>
   172         -      </p>
   173         -      <p>
   174         -      </p>
   175         -      <p>
   176         -        If a WHEN clause is supplied, the SQL statements specified as <i>trigger-steps</i>
   177         -        are only executed for
   178         -        rows for which the WHEN clause is true. If no WHEN clause
   179         -        is supplied, the SQL statements are executed for all rows.</p>
   180         -      <p>
   181         -        The specified <i>trigger-time</i> determines when the <i>trigger-steps</i> will
   182         -        be executed relative to the insertion, modification or removal of the associated
   183         -        row.</p>
   184         -      <p>
   185         -        An ON CONFLICT clause may be specified as part of an UPDATE or INSERT <i>trigger-step</i>.
   186         -        However if an ON CONFLICT clause is specified as part of the statement causing the
   187         -        trigger to fire, then this conflict handling policy is used instead.</p>
   188         -      <p>
   189         -        Triggers are automatically dropped when the table that they are associated with
   190         -        is dropped.</p>
   191         -      <p>
   192         -        Triggers may be created on views, as well as ordinary tables, by specifying INSTEAD
   193         -        OF in the CREATE TRIGGER statement. If one or more ON INSERT, ON DELETE or ON UPDATE
   194         -        triggers are defined on a view, then it is not an error to execute an INSERT, DELETE
   195         -        or UPDATE statement on the view, respectively. Thereafter, executing an INSERT,
   196         -        DELETE or UPDATE on the view causes the associated triggers to fire. The real tables
   197         -        underlying the view are not modified (except possibly explicitly, by a trigger program).</p>
   198         -      <p>
   199         -        <b>Example:</b></p>
   200         -      <p>
   201         -        Assuming that customer records are stored in the "customers" table, and that order
   202         -        records are stored in the "orders" table, the following trigger ensures that all
   203         -        associated orders are redirected when a customer changes his or her address:</p>
   204         -      <blockquote>
   205         -        <pre>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>CREATE TRIGGER</h2><p><b><a href="syntaxdiagrams.html#create-trigger-stmt">create-trigger-stmt:</a></b>
          132  +<button id='x907' onclick='hideorshow("x907","x908")'>hide</button></p>
          133  + <blockquote id='x908'>
          134  + <img alt="syntax diagram create-trigger-stmt" src="images/syntax/create-trigger-stmt.gif" />
          135  +<p><b><a href="syntaxdiagrams.html#delete-stmt">delete-stmt:</a></b>
          136  +<button id='x909' onclick='hideorshow("x909","x910")'>show</button></p>
          137  + <blockquote id='x910' style='display:none;'>
          138  + <img alt="syntax diagram delete-stmt" src="images/syntax/delete-stmt.gif" />
          139  +<p><b><a href="syntaxdiagrams.html#qualified-table-name">qualified-table-name:</a></b>
          140  +<button id='x911' onclick='hideorshow("x911","x912")'>show</button></p>
          141  + <blockquote id='x912' style='display:none;'>
          142  + <img alt="syntax diagram qualified-table-name" src="images/syntax/qualified-table-name.gif" />
          143  +</blockquote>
          144  +<p><b><a href="syntaxdiagrams.html#with-clause">with-clause:</a></b>
          145  +<button id='x913' onclick='hideorshow("x913","x914")'>show</button></p>
          146  + <blockquote id='x914' style='display:none;'>
          147  + <img alt="syntax diagram with-clause" src="images/syntax/with-clause.gif" />
          148  +<p><b><a href="syntaxdiagrams.html#cte-table-name">cte-table-name:</a></b>
          149  +<button id='x915' onclick='hideorshow("x915","x916")'>show</button></p>
          150  + <blockquote id='x916' style='display:none;'>
          151  + <img alt="syntax diagram cte-table-name" src="images/syntax/cte-table-name.gif" />
          152  +</blockquote>
          153  +</blockquote>
          154  +</blockquote>
          155  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          156  +<button id='x917' onclick='hideorshow("x917","x918")'>show</button></p>
          157  + <blockquote id='x918' style='display:none;'>
          158  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          159  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          160  +<button id='x919' onclick='hideorshow("x919","x920")'>show</button></p>
          161  + <blockquote id='x920' style='display:none;'>
          162  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          163  +</blockquote>
          164  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          165  +<button id='x921' onclick='hideorshow("x921","x922")'>show</button></p>
          166  + <blockquote id='x922' style='display:none;'>
          167  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          168  +</blockquote>
          169  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          170  +<button id='x923' onclick='hideorshow("x923","x924")'>show</button></p>
          171  + <blockquote id='x924' style='display:none;'>
          172  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          173  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          174  +<button id='x925' onclick='hideorshow("x925","x926")'>show</button></p>
          175  + <blockquote id='x926' style='display:none;'>
          176  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          177  +</blockquote>
          178  +</blockquote>
          179  +</blockquote>
          180  +<p><b><a href="syntaxdiagrams.html#insert-stmt">insert-stmt:</a></b>
          181  +<button id='x927' onclick='hideorshow("x927","x928")'>show</button></p>
          182  + <blockquote id='x928' style='display:none;'>
          183  + <img alt="syntax diagram insert-stmt" src="images/syntax/insert-stmt.gif" />
          184  +<p><b><a href="syntaxdiagrams.html#with-clause">with-clause:</a></b>
          185  +<button id='x929' onclick='hideorshow("x929","x930")'>show</button></p>
          186  + <blockquote id='x930' style='display:none;'>
          187  + <img alt="syntax diagram with-clause" src="images/syntax/with-clause.gif" />
          188  +<p><b><a href="syntaxdiagrams.html#cte-table-name">cte-table-name:</a></b>
          189  +<button id='x931' onclick='hideorshow("x931","x932")'>show</button></p>
          190  + <blockquote id='x932' style='display:none;'>
          191  + <img alt="syntax diagram cte-table-name" src="images/syntax/cte-table-name.gif" />
          192  +</blockquote>
          193  +</blockquote>
          194  +</blockquote>
          195  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          196  +<button id='x933' onclick='hideorshow("x933","x934")'>show</button></p>
          197  + <blockquote id='x934' style='display:none;'>
          198  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          199  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          200  +<button id='x935' onclick='hideorshow("x935","x936")'>show</button></p>
          201  + <blockquote id='x936' style='display:none;'>
          202  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          203  +</blockquote>
          204  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          205  +<button id='x937' onclick='hideorshow("x937","x938")'>show</button></p>
          206  + <blockquote id='x938' style='display:none;'>
          207  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          208  +</blockquote>
          209  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          210  +<button id='x939' onclick='hideorshow("x939","x940")'>show</button></p>
          211  + <blockquote id='x940' style='display:none;'>
          212  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          213  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          214  +<button id='x941' onclick='hideorshow("x941","x942")'>show</button></p>
          215  + <blockquote id='x942' style='display:none;'>
          216  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          217  +</blockquote>
          218  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          219  +<button id='x943' onclick='hideorshow("x943","x944")'>show</button></p>
          220  + <blockquote id='x944' style='display:none;'>
          221  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          222  +</blockquote>
          223  +</blockquote>
          224  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          225  +<button id='x945' onclick='hideorshow("x945","x946")'>show</button></p>
          226  + <blockquote id='x946' style='display:none;'>
          227  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          228  +</blockquote>
          229  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          230  +<button id='x947' onclick='hideorshow("x947","x948")'>show</button></p>
          231  + <blockquote id='x948' style='display:none;'>
          232  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          233  +</blockquote>
          234  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          235  +<button id='x949' onclick='hideorshow("x949","x950")'>show</button></p>
          236  + <blockquote id='x950' style='display:none;'>
          237  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          238  +</blockquote>
          239  +</blockquote>
          240  +<p><b><a href="syntaxdiagrams.html#update-stmt">update-stmt:</a></b>
          241  +<button id='x951' onclick='hideorshow("x951","x952")'>show</button></p>
          242  + <blockquote id='x952' style='display:none;'>
          243  + <img alt="syntax diagram update-stmt" src="images/syntax/update-stmt.gif" />
          244  +<p><b><a href="syntaxdiagrams.html#qualified-table-name">qualified-table-name:</a></b>
          245  +<button id='x953' onclick='hideorshow("x953","x954")'>show</button></p>
          246  + <blockquote id='x954' style='display:none;'>
          247  + <img alt="syntax diagram qualified-table-name" src="images/syntax/qualified-table-name.gif" />
          248  +</blockquote>
          249  +<p><b><a href="syntaxdiagrams.html#with-clause">with-clause:</a></b>
          250  +<button id='x955' onclick='hideorshow("x955","x956")'>show</button></p>
          251  + <blockquote id='x956' style='display:none;'>
          252  + <img alt="syntax diagram with-clause" src="images/syntax/with-clause.gif" />
          253  +<p><b><a href="syntaxdiagrams.html#cte-table-name">cte-table-name:</a></b>
          254  +<button id='x957' onclick='hideorshow("x957","x958")'>show</button></p>
          255  + <blockquote id='x958' style='display:none;'>
          256  + <img alt="syntax diagram cte-table-name" src="images/syntax/cte-table-name.gif" />
          257  +</blockquote>
          258  +</blockquote>
          259  +</blockquote>
          260  +</blockquote>
          261  +
          262  +
          263  +<p>The CREATE TRIGGER statement is used to add triggers to the 
          264  +database schema. Triggers are database operations 
          265  +that are automatically performed when a specified database event
          266  +occurs.  </p>
          267  +
          268  +<p>A trigger may be specified to fire whenever a <a href="lang_delete.html">DELETE</a>, <a href="lang_insert.html">INSERT</a>,
          269  +or <a href="lang_update.html">UPDATE</a> of a
          270  +particular database table occurs, or whenever an <a href="lang_update.html">UPDATE</a> occurs on
          271  +on one or more specified columns of a table.</p>
          272  +
          273  +<p>At this time SQLite supports only FOR EACH ROW triggers, not FOR EACH
          274  +STATEMENT triggers. Hence explicitly specifying FOR EACH ROW is optional.
          275  +FOR EACH ROW implies that the SQL statements specified in the trigger
          276  +may be executed (depending on the WHEN clause) for each database row being
          277  +inserted, updated or deleted by the statement causing the trigger to fire.</p>
          278  +
          279  +<p>Both the WHEN clause and the trigger actions may access elements of 
          280  +the row being inserted, deleted or updated using references of the form 
          281  +"NEW.<i>column-name</i>" and "OLD.<i>column-name</i>", where
          282  +<i>column-name</i> is the name of a column from the table that the trigger
          283  +is associated with. OLD and NEW references may only be used in triggers on
          284  +events for which they are relevant, as follows:</p>
          285  +
          286  +<table border=0 cellpadding=10>
          287  +<tr>
          288  +<td valign="top" align="right" width=120><i>INSERT</i></td>
          289  +<td valign="top">NEW references are valid</td>
          290  +</tr>
          291  +<tr>
          292  +<td valign="top" align="right" width=120><i>UPDATE</i></td>
          293  +<td valign="top">NEW and OLD references are valid</td>
          294  +</tr>
          295  +<tr>
          296  +<td valign="top" align="right" width=120><i>DELETE</i></td>
          297  +<td valign="top">OLD references are valid</td>
          298  +</tr>
          299  +</table>
          300  +</p>
          301  +
          302  +<p>If a WHEN clause is supplied, the SQL statements specified
          303  +are only executed for rows for which the WHEN
          304  +clause is true. If no WHEN clause is supplied, the SQL statements
          305  +are executed for all rows.</p>
          306  +
          307  +<p>The BEFORE or AFTER keyword determines when the trigger actions
          308  +will be executed relative to the insertion, modification or removal of the
          309  +associated row.</p>
          310  +
          311  +<p>An <a href="lang_conflict.html">ON CONFLICT</a> clause may be specified as part of an <a href="lang_update.html">UPDATE</a> or <a href="lang_insert.html">INSERT</a>
          312  +action within the body of the trigger.
          313  +However if an <a href="lang_conflict.html">ON CONFLICT</a> clause is specified as part of 
          314  +the statement causing the trigger to fire, then conflict handling
          315  +policy of the outer statement is used instead.</p>
          316  +
          317  +<p>Triggers are automatically <a href="lang_droptrigger.html">dropped</a>
          318  +when the table that they are 
          319  +associated with (the <i>table-name</i> table) is 
          320  +<a href="lang_droptable.html">dropped</a>.  However if the trigger actions reference
          321  +other tables, the trigger is not dropped or modified if those other
          322  +tables are <a href="lang_droptable.html">dropped</a> or <a href="lang_altertable.html">modified</a>.</p>
          323  +
          324  +<p>Triggers are removed using the <a href="lang_droptrigger.html">DROP TRIGGER</a> statement.</p>
          325  +
          326  +<h3>Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within
          327  +    Triggers</h3>
          328  +
          329  +<p>The <a href="lang_update.html">UPDATE</a>, <a href="lang_delete.html">DELETE</a>, and <a href="lang_insert.html">INSERT</a>
          330  +statements within triggers do not support
          331  +the full syntax for <a href="lang_update.html">UPDATE</a>, <a href="lang_delete.html">DELETE</a>, and <a href="lang_insert.html">INSERT</a> statements.  The following
          332  +restrictions apply:</p>
          333  +
          334  +<ul>
          335  +<li><p>
          336  +  The name of the table to be modified in an <a href="lang_update.html">UPDATE</a>, <a href="lang_delete.html">DELETE</a>, or <a href="lang_insert.html">INSERT</a>
          337  +  statement must be an unqualified table name.  In other words, one must
          338  +  use just "<i>tablename</i>" not "<i>database</i><b>.</b><i>tablename</i>"
          339  +  when specifying the table.  The table to be modified must exist in the
          340  +  same database as the table or view to which the trigger is attached.
          341  +  </p></li>
          342  +
          343  +<li><p>
          344  +  The "INSERT INTO <i>table</i> DEFAULT VALUES" form of the <a href="lang_insert.html">INSERT</a> statement
          345  +  is not supported.
          346  +  </p></li>
          347  +
          348  +<li><p>
          349  +  The INDEXED BY and NOT INDEXED clauses are not supported for <a href="lang_update.html">UPDATE</a> and
          350  +  <a href="lang_delete.html">DELETE</a> statements.
          351  +  </p></li>
          352  +
          353  +<li><p>
          354  +  The ORDER BY and LIMIT clauses on <a href="lang_update.html">UPDATE</a> and <a href="lang_delete.html">DELETE</a> statements are not
          355  +  supported.  ORDER BY and LIMIT are not normally supported for <a href="lang_update.html">UPDATE</a> or
          356  +  <a href="lang_delete.html">DELETE</a> in any context but can be enabled for top-level statements
          357  +  using the <a href="compile.html#enable_update_delete_limit">SQLITE_ENABLE_UPDATE_DELETE_LIMIT</a> compile-time option.  However,
          358  +  that compile-time option only applies to top-level <a href="lang_update.html">UPDATE</a> and <a href="lang_delete.html">DELETE</a>
          359  +  statements, not <a href="lang_update.html">UPDATE</a> and <a href="lang_delete.html">DELETE</a> statements within triggers.
          360  +  </p></li>
          361  +</ul>
          362  +
          363  +<a name="instead_of_trigger"></a>
          364  +
          365  +<h3>INSTEAD OF trigger</h3>
          366  +
          367  +<p>Triggers may be created on <a href="lang_createview.html">views</a>, as well as ordinary tables, by
          368  +specifying INSTEAD OF in the CREATE TRIGGER statement. 
          369  +If one or more ON INSERT, ON DELETE
          370  +or ON UPDATE triggers are defined on a view, then it is not an
          371  +error to execute an INSERT, DELETE or UPDATE statement on the view, 
          372  +respectively.  Instead,
          373  +executing an INSERT, DELETE or UPDATE on the view causes the associated
          374  +triggers to fire. The real tables underlying the view are not modified
          375  +(except possibly explicitly, by a trigger program).</p>
          376  +
          377  +<p>Note that the <a href="c3ref/changes.html">sqlite3_changes()</a> and <a href="c3ref/total_changes.html">sqlite3_total_changes()</a> interfaces
          378  +do not count INSTEAD OF trigger firings, but the
          379  +<a href="pragma.html#pragma_count_changes">count_changes pragma</a> does count INSTEAD OF trigger firing.</p>
          380  +
          381  +<h3>Examples</h3>
          382  +
          383  +<p>Assuming that customer records are stored in the "customers" table, and
          384  +that order records are stored in the "orders" table, the following trigger
          385  +ensures that all associated orders are redirected when a customer changes
          386  +his or her address:</p>
          387  +
          388  +<blockquote><pre>
   206    389   CREATE TRIGGER update_customer_address UPDATE OF address ON customers 
   207    390     BEGIN
   208    391       UPDATE orders SET address = new.address WHERE customer_name = old.name;
   209    392     END;
   210         -</pre>
   211         -      </blockquote>
   212         -      <p>
   213         -        With this trigger installed, executing the statement:</p>
   214         -      <blockquote>
   215         -        <pre>
          393  +</pre></blockquote>
          394  +
          395  +<p>With this trigger installed, executing the statement:</p>
          396  +
          397  +<blockquote><pre>
   216    398   UPDATE customers SET address = '1 Main St.' WHERE name = 'Jack Jones';
   217         -</pre>
   218         -      </blockquote>
   219         -      <p>
   220         -        causes the following to be automatically executed:</p>
   221         -      <blockquote>
   222         -        <pre>
          399  +</pre></blockquote>
          400  +
          401  +<p>causes the following to be automatically executed:</p>
          402  +
          403  +<blockquote><pre>
   223    404   UPDATE orders SET address = '1 Main St.' WHERE customer_name = 'Jack Jones';
   224         -</pre>
   225         -      </blockquote>
   226         -      <p>
   227         -        Note that currently, triggers may behave oddly when created on tables with INTEGER
   228         -        PRIMARY KEY fields. If a BEFORE trigger program modifies the INTEGER PRIMARY KEY
   229         -        field of a row that will be subsequently updated by the statement that causes the
   230         -        trigger to fire, then the update may not occur. The workaround is to declare the
   231         -        table with a PRIMARY KEY column instead of an INTEGER PRIMARY KEY column.</p>
   232         -      <p>
   233         -        A special SQL function RAISE() may be used within a trigger-program, with the following
   234         -        syntax</p>
   235         -      <p>
   236         -        <table cellpadding="10">
   237         -          <tr>
   238         -            <td align="right" width="1%" nowrap>
   239         -              <i><font color="#ff3434">raise-function</font></i> ::=</td>
   240         -            <td>
   241         -              <b><font color="#2c2cf0">RAISE <big>(</big> ABORT<big>,</big> </font></b><i><font
   242         -                color="#ff3434">error-message</font></i><b><font color="#2c2cf0"> <big>)</big> </font>
   243         -                </b><big>|</big><b><font color="#2c2cf0">
   244         -                  <br />
   245         -                  RAISE <big>(</big> FAIL<big>,</big> </font></b><i><font color="#ff3434">error-message</font></i><b><font
   246         -                    color="#2c2cf0"> <big>)</big> </font></b><big>|</big><b><font color="#2c2cf0">
   247         -                      <br />
   248         -                      RAISE <big>(</big> ROLLBACK<big>,</big> </font></b><i><font color="#ff3434">error-message</font></i><b><font
   249         -                        color="#2c2cf0"> <big>)</big> </font></b><big>|</big><b><font color="#2c2cf0">
   250         -                          <br />
   251         -                          RAISE <big>(</big> IGNORE <big>)</big></font></b></td>
   252         -          </tr>
   253         -        </table>
   254         -      </p>
   255         -      <p>
   256         -        When one of the first three forms is called during trigger-program execution, the
   257         -        specified ON CONFLICT processing is performed (either ABORT, FAIL or ROLLBACK) and
   258         -        the current query terminates. An error code of SQLITE_CONSTRAINT is returned to
   259         -        the user, along with the specified error message.</p>
   260         -      <p>
   261         -        When RAISE(IGNORE) is called, the remainder of the current trigger program, the
   262         -        statement that caused the trigger program to execute and any subsequent trigger
   263         -        programs that would of been executed are abandoned. No database changes are rolled
   264         -        back. If the statement that caused the trigger program to execute is itself part
   265         -        of a trigger program, then that trigger program resumes execution at the beginning
   266         -        of the next step.
   267         -      </p>
   268         -      <p>
   269         -        Triggers are removed using the <a href="lang_droptrigger.html">DROP TRIGGER</a>
   270         -        statement.</p>
   271         -      <p>
   272         -      <hr>
   273         -        &nbsp;</p>
   274         -      <div id="footer">
   275         -        <p>
   276         -          &nbsp;</p>
   277         -        <p>
   278         -        </p>
   279         -      </div>
   280         -    </div>
   281         -    </div>
   282         -  </body>
   283         -</html>
          405  +</pre></blockquote>
          406  +
          407  +<a name="undef_before"></a>
          408  +
          409  +<h3>Cautions On The Use Of BEFORE triggers</h3>
          410  +
          411  +<p>If a BEFORE UPDATE or BEFORE DELETE trigger modifies or deletes a row
          412  +that was to have been updated or deleted, then the result of the subsequent
          413  +update or delete operation is undefined.  Furthermore, if a BEFORE trigger
          414  +modifies or deletes a row, then it is undefined whether or not AFTER triggers
          415  +that would have otherwise run on those rows will in fact run.
          416  +</p>
          417  +
          418  +<p>The value of NEW.rowid is undefined in a BEFORE INSERT trigger in which
          419  +the rowid is not explicitly set to an integer.</p>
          420  +
          421  +<p>Because of the behaviors described above, programmers are encouraged to
          422  +prefer AFTER triggers over BEFORE triggers.</p>
          423  +
          424  +<h3>The RAISE() function</h3>
          425  +
          426  +<p>A special SQL function RAISE() may be used within a trigger-program,
          427  +with the following syntax</p> 
          428  +
          429  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b></p><blockquote>
          430  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif"></img>
          431  + </blockquote>
          432  +
          433  +
          434  +<p>When one of RAISE(ROLLBACK,...), RAISE(ABORT,...) or RAISE(FAIL,...)
          435  +is called during trigger-program
          436  +execution, the specified <a href="lang_conflict.html">ON CONFLICT</a> processing is performed
          437  +the current query terminates.
          438  +An error code of <a href="c3ref/c_abort.html">SQLITE_CONSTRAINT</a> is returned to the application,
          439  +along with the specified error message.</p>
          440  +
          441  +<p>When RAISE(IGNORE) is called, the remainder of the current trigger program,
          442  +the statement that caused the trigger program to execute and any subsequent
          443  +trigger programs that would have been executed are abandoned. No database
          444  +changes are rolled back.  If the statement that caused the trigger program
          445  +to execute is itself part of a trigger program, then that trigger program
          446  +resumes execution at the beginning of the next step.
          447  +</p>
          448  +
          449  +<a name="temptrig"></a>
          450  +
          451  +<h3>TEMP Triggers on Non-TEMP Tables</h3>
          452  +
          453  +<p>A trigger normally exists in the same database as the table named
          454  +after the "ON" keyword in the CREATE TRIGGER statement.  Except, it is
          455  +possible to create a TEMP TRIGGER on a table in another database.  
          456  +Such a trigger will only fire when changes
          457  +are made to the target table by the application that defined the trigger.
          458  +Other applications that modify the database will not be able to see the
          459  +TEMP trigger and hence cannot run the trigger.</p>
          460  +
          461  +<p>When defining a TEMP trigger on a non-TEMP table, it is important to
          462  +specify the database holding the non-TEMP table.  For example,
          463  +in the following statement, it is important to say "main.tab1" instead
          464  +of just "tab1":</p>
          465  +
          466  +<blockquote><pre>
          467  +CREATE TEMP TRIGGER ex1 AFTER INSERT ON <b>main.</b>tab1 BEGIN ...
          468  +</pre></blockquote>
          469  +
          470  +<p>Failure to specify the database name on the target table could result
          471  +in the TEMP trigger being reattached to a table with the same name in
          472  +another database whenever any schema change occurs.</p>
          473  +
          474  +

Changes to Doc/Extra/Core/lang_createview.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>CREATE VIEW</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">CREATE VIEW</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        CREATE VIEW</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">CREATE </font></b>[<b><font color="#2c2cf0">TEMP </font></b>
    55         -              <big>|</big><b><font color="#2c2cf0"> TEMPORARY</font></b>]<b><font color="#2c2cf0">
    56         -                VIEW </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    57         -                  color="#2c2cf0"><big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    58         -              <i><font color="#ff3434">view-name</font></i><b><font color="#2c2cf0"> AS </font></b>
    59         -              <i><font color="#ff3434">select-statement</font></i><b><font color="#2c2cf0"></font></b></td>
    60         -          </tr>
    61         -        </table>
    62         -      </p>
    63         -      <p>
    64         -        The CREATE VIEW command assigns a name to a pre-packaged <a href="lang_select.html">
    65         -          SELECT</a> statement. Once the view is created, it can be used in the FROM clause
    66         -        of another SELECT in place of a table name. 
    67         -      </p>
    68         -      <p>
    69         -        If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE" and "VIEW" then
    70         -        the view that is created is only visible to the process that opened the database
    71         -        and is automatically deleted when the database is closed.</p>
    72         -      <p>
    73         -        If a &lt;database-name&gt; is specified, then the view is created in the named database.
    74         -        It is an error to specify both a &lt;database-name&gt; and the TEMP keyword, unless
    75         -        the &lt;database-name&gt; is "temp". If no database name is specified, and the TEMP
    76         -        keyword is not present, the table is created in the main database.</p>
    77         -      <p>
    78         -        You cannot COPY, DELETE, INSERT or UPDATE a view. Views are read-only in SQLite.
    79         -        However, in many cases you can use a <a href="lang_createtrigger.html">TRIGGER</a>
    80         -        on the view to accomplish the same thing. Views are removed with the <a href="lang_dropview.html">
    81         -          DROP VIEW</a> command.</p>
    82         -      <p>
    83         -      <hr>
    84         -        &nbsp;</p>
    85         -      <div id="footer">
    86         -        <p>
    87         -          &nbsp;</p>
    88         -        <p>
    89         -        </p>
    90         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: CREATE VIEW</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    91    126       </div>
    92         -    </div>
    93         -  </body>
    94         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>CREATE VIEW</h2><p><b><a href="syntaxdiagrams.html#create-view-stmt">create-view-stmt:</a></b>
          132  +<button id='x959' onclick='hideorshow("x959","x960")'>hide</button></p>
          133  + <blockquote id='x960'>
          134  + <img alt="syntax diagram create-view-stmt" src="images/syntax/create-view-stmt.gif" />
          135  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          136  +<button id='x961' onclick='hideorshow("x961","x962")'>show</button></p>
          137  + <blockquote id='x962' style='display:none;'>
          138  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          139  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          140  +<button id='x963' onclick='hideorshow("x963","x964")'>show</button></p>
          141  + <blockquote id='x964' style='display:none;'>
          142  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          143  +</blockquote>
          144  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          145  +<button id='x965' onclick='hideorshow("x965","x966")'>show</button></p>
          146  + <blockquote id='x966' style='display:none;'>
          147  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          148  +</blockquote>
          149  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          150  +<button id='x967' onclick='hideorshow("x967","x968")'>show</button></p>
          151  + <blockquote id='x968' style='display:none;'>
          152  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          153  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          154  +<button id='x969' onclick='hideorshow("x969","x970")'>show</button></p>
          155  + <blockquote id='x970' style='display:none;'>
          156  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          157  +</blockquote>
          158  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          159  +<button id='x971' onclick='hideorshow("x971","x972")'>show</button></p>
          160  + <blockquote id='x972' style='display:none;'>
          161  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          162  +</blockquote>
          163  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          164  +<button id='x973' onclick='hideorshow("x973","x974")'>show</button></p>
          165  + <blockquote id='x974' style='display:none;'>
          166  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          167  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          168  +<button id='x975' onclick='hideorshow("x975","x976")'>show</button></p>
          169  + <blockquote id='x976' style='display:none;'>
          170  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          171  +</blockquote>
          172  +</blockquote>
          173  +</blockquote>
          174  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          175  +<button id='x977' onclick='hideorshow("x977","x978")'>show</button></p>
          176  + <blockquote id='x978' style='display:none;'>
          177  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          178  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          179  +<button id='x979' onclick='hideorshow("x979","x980")'>show</button></p>
          180  + <blockquote id='x980' style='display:none;'>
          181  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          182  +</blockquote>
          183  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          184  +<button id='x981' onclick='hideorshow("x981","x982")'>show</button></p>
          185  + <blockquote id='x982' style='display:none;'>
          186  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          187  +</blockquote>
          188  +</blockquote>
          189  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          190  +<button id='x983' onclick='hideorshow("x983","x984")'>show</button></p>
          191  + <blockquote id='x984' style='display:none;'>
          192  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          193  +</blockquote>
          194  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          195  +<button id='x985' onclick='hideorshow("x985","x986")'>show</button></p>
          196  + <blockquote id='x986' style='display:none;'>
          197  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          198  +</blockquote>
          199  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          200  +<button id='x987' onclick='hideorshow("x987","x988")'>show</button></p>
          201  + <blockquote id='x988' style='display:none;'>
          202  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          203  +</blockquote>
          204  +</blockquote>
          205  +</blockquote>
          206  +
          207  +
          208  +<p>The CREATE VIEW command assigns a name to a pre-packaged 
          209  +<a href="lang_select.html">SELECT</a> statement. 
          210  +Once the view is created, it can be used in the FROM clause
          211  +of another <a href="lang_select.html">SELECT</a> in place of a table name.
          212  +</p>
          213  +
          214  +<p>If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE"
          215  +and "VIEW" then the view that is created is only visible to the
          216  +process that opened the database and is automatically deleted when
          217  +the database is closed.</p>
          218  +
          219  +<p> If a &lt;database-name&gt; is specified, then the view is created in 
          220  +the named database. It is an error to specify both a &lt;database-name&gt;
          221  +and the TEMP keyword on a VIEW, unless the &lt;database-name&gt; is "temp".
          222  +If no database name is specified, and the TEMP keyword is not present,
          223  +the VIEW is created in the main database.</p>
          224  +
          225  +<p>You cannot <a href="lang_delete.html">DELETE</a>, <a href="lang_insert.html">INSERT</a>, or <a href="lang_update.html">UPDATE</a> a view.  Views are read-only 
          226  +in SQLite.  However, in many cases you can use an
          227  +<a href="lang_createtrigger.html#instead_of_trigger">INSTEAD OF trigger</a> on the view to accomplish 
          228  +the same thing.  Views are removed 
          229  +with the <a href="lang_dropview.html">DROP VIEW</a> command.</p>
          230  +
          231  +

Changes to Doc/Extra/Core/lang_createvtab.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>CREATE VIRTUAL TABLE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">CREATE VIRTUAL TABLE</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        CREATE VIRTUAL TABLE</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">CREATE VIRTUAL TABLE </font></b>[<b><font color="#2c2cf0"></font></b><i><font
    55         -                color="#ff3434">database-name</font></i><b><font color="#2c2cf0"> <big>.</big></font></b>]<b><font
    56         -                  color="#2c2cf0"> </font></b><i><font color="#ff3434">table-name</font></i><b><font
    57         -                    color="#2c2cf0"> USING </font></b><i><font color="#ff3434">module-name</font></i><b><font
    58         -                      color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"><big>(</big> </font></b>
    59         -              <i><font color="#ff3434">arguments</font></i><b><font color="#2c2cf0"> <big>)</big></font></b>]<b><font
    60         -                color="#2c2cf0"></font></b></td>
    61         -          </tr>
    62         -        </table>
    63         -      </p>
    64         -      <p>
    65         -        A virtual table is an interface to an external storage or computation engine that
    66         -        appears to be a table but does not actually store information in the database file.</p>
    67         -      <p>
    68         -        In general, you can do anything with a virtual table that can be done with an ordinary
    69         -        table, except that you cannot create triggers on a virtual table. Some virtual table
    70         -        implementations might impose additional restrictions. For example, many virtual
    71         -        tables are read-only.</p>
    72         -      <p>
    73         -        The &lt;module-name&gt; is the
    74         -        name of an object that implements the virtual table.
    75         -        The &lt;module-name&gt; must be registered with the SQLite database connection using
    76         -        <a href="capi3ref.html#sqlite3_create_module">sqlite3_create_module</a> prior to
    77         -        issuing the CREATE VIRTUAL TABLE statement. The module takes zero or more comma-separated
    78         -        arguments. The arguments can be just about any text as long as it has balanced parentheses.
    79         -        The argument syntax is sufficiently general that the arguments can be made to appear
    80         -        as column definitions in a traditional <a href="lang_createtable.html">CREATE TABLE</a>
    81         -        statement. SQLite passes the module arguments directly to the module without any
    82         -        interpretation. It is the responsibility of the module implementation to parse and
    83         -        interpret its own arguments.</p>
    84         -      <p>
    85         -        A virtual table is destroyed using the ordinary <a href="lang_droptable.html">DROP
    86         -          TABLE</a> statement. There is no DROP VIRTUAL TABLE statement.</p>
    87         -      <p>
    88         -      <hr>
    89         -        &nbsp;</p>
    90         -      <div id="footer">
    91         -        <p>
    92         -          &nbsp;</p>
    93         -        <p>
    94         -        </p>
    95         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: CREATE VIRTUAL TABLE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    96    126       </div>
    97         -    </div>
    98         -  </body>
    99         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>CREATE VIRTUAL TABLE</h2><p><b><a href="syntaxdiagrams.html#create-virtual-table-stmt">create-virtual-table-stmt:</a></b>
          132  +<button id='x989' onclick='hideorshow("x989","x990")'>hide</button></p>
          133  + <blockquote id='x990'>
          134  + <img alt="syntax diagram create-virtual-table-stmt" src="images/syntax/create-virtual-table-stmt.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>A <a href="vtab.html">virtual table</a> is an interface to an external storage or computation
          139  +engine that appears to be a table but does not actually store information
          140  +in the database file.</p>
          141  +
          142  +<p>In general, you can do anything with a <a href="vtab.html">virtual table</a> that can be done
          143  +with an ordinary table, except that you cannot create indices or triggers on a
          144  +virtual table.  Some virtual table implementations might impose additional
          145  +restrictions.  For example, many virtual tables are read-only.</p>
          146  +
          147  +<p>The &lt;module-name&gt; is the name of an object that implements
          148  +the virtual table.  The &lt;module-name&gt; must be registered with
          149  +the SQLite database connection using
          150  +<a href="c3ref/create_module.html">sqlite3_create_module()</a> or <a href="c3ref/create_module.html">sqlite3_create_module_v2()</a>
          151  +prior to issuing the CREATE VIRTUAL TABLE statement.
          152  +The module takes zero or more comma-separated arguments.
          153  +The arguments can be just about any text as long as it has balanced
          154  +parentheses.  The argument syntax is sufficiently general that the
          155  +arguments can be made to appear as <a href="lang_createtable.html#tablecoldef">column definitions</a> in a traditional
          156  +<a href="lang_createtable.html">CREATE TABLE</a> statement.  
          157  +SQLite passes the module arguments directly
          158  +to the <a href="vtab.html#xcreate">xCreate</a> and <a href="vtab.html#xconnect">xConnect</a> methods of the module implementation
          159  +without any interpretation.  It is the responsibility
          160  +of the module implementation to parse and interpret its own arguments.</p>
          161  +
          162  +<p>A virtual table is destroyed using the ordinary
          163  +<a href="lang_droptable.html">DROP TABLE</a> statement.  There is no
          164  +DROP VIRTUAL TABLE statement.</p>
          165  +
          166  +

Name change from Doc/Extra/Core/lang_datetime.html to Doc/Extra/Core/lang_datefunc.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>DateTime Functions</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">Date and Time Functions</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: Date And Time Functions</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    41    126       </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">Date and Time Functions</h1>
    45         -<p>Five date and time functions are available, as follows:
    46         -
    47         -<p><ol>
    48         -<li>date( <i>timestring</i>, <i>modifier</i>, <i>modifier</i>, ...)
    49         -<li>time( <i>timestring</i>, <i>modifier</i>, <i>modifier</i>, ...)
    50         -<li>datetime( <i>timestring</i>, <i>modifier</i>, <i>modifier</i>, ...)
    51         -<li>julianday( <i>timestring</i>, <i>modifier</i>, <i>modifier</i>, ...)
    52         -<li>strftime( <i>format</i>, <i>timestring</i>, <i>modifier</i>, <i>modifier</i>, ...)
    53         -</ol>
    54         -
    55         -<p>All five functions take a time string as an argument.  This
    56         -time string may be followed by zero or more modifiers.  The
    57         -<b>strftime()</b> function also takes a format string as its first
    58         -argument.
    59         -
    60         -<p>The <b>date()</b> function returns the date in this format: YYYY-MM-DD.
    61         -The <b>time()</b> function returns the time as HH:MM:SS.  The <b>datetime()</b>
    62         -function returns &quot;YYYY-MM-DD HH:MM:SS&quot;.  The <b>julianday()</b> function
    63         -returns the number of days since noon in Greenwich on November 24, 4714 B.C.
    64         -The julian day number is the preferred internal representation of
    65         -dates.  The <b>strftime()</b> routine returns the date formatted according
    66         -to the format string specified as the first argument.  The format string
    67         -supports most, but not all, of the more common substitutions found in
    68         -the strftime() function from the standard C library:
    69         -
    70         -<p><pre>
    71         -   %d  day of month
    72         -   %f  ** fractional seconds  SS.SSS
    73         -   %H  hour 00-24
    74         -   %j  day of year 001-366
    75         -   %J  ** Julian day number
    76         -   %m  month 01-12
    77         -   %M  minute 00-59
    78         -   %s  seconds since 1970-01-01
    79         -   %S  seconds 00-59
    80         -   %w  day of week 0-6  sunday==0
    81         -   %W  week of year 00-53
    82         -   %Y  year 0000-9999
    83         -   %%  %
    84         -</pre>
    85         -
    86         -<p>The %f and %J conversions are new.  Notice that all of the other four
    87         -functions could be expressed in terms of <b>strftime()</b>.
    88         -
    89         -<p><pre>
    90         -   date(...)      -&gt;  strftime(&quot;%Y-%m-%d&quot;, ...)
    91         -   time(...)      -&gt;  strftime(&quot;%H:%M:%S&quot;, ...)
    92         -   datetime(...)  -&gt;  strftime(&quot;%Y-%m-%d %H:%M:%S&quot;, ...)
    93         -   julianday(...) -&gt;  strftime(&quot;%J&quot;, ...)
    94         -</pre>
    95         -
    96         -<p>The only reasons for providing functions other than <b>strftime()</b> is for
    97         -convenience and for efficiency.
    98         -
    99         -<p><b>Time Strings</b>
   100         -
   101         -<p>A time string can be in any of the following formats:
   102         -
   103         -<p><ol>
   104         -<li>YYYY-MM-DD
   105         -<li>YYYY-MM-DD HH:MM
   106         -<li>YYYY-MM-DD HH:MM:SS
   107         -<li>YYYY-MM-DD HH:MM:SS.SSS
   108         -<li>YYYY-MM-DDTHH:MM
   109         -<li>YYYY-MM-DDTHH:MM:SS
   110         -<li>YYYY-MM-DDTHH:MM:SS.SSS
   111         -<li>HH:MM
   112         -<li>HH:MM:SS
   113         -<li>HH:MM:SS.SSS
   114         -<li>now
   115         -<li>DDDD.DDDD
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>Date And Time Functions</h2>
          132  +
          133  +<p>
          134  +SQLite supports five date and time functions as follows:
          135  +</p>
          136  +
          137  +<p>
          138  +<ol>
          139  +<li> <b>date(</b><i>timestring, modifier, modifier, ...</i><b>)</b> </li>
          140  +<li> <b>time(</b><i>timestring, modifier, modifier, ...</i><b>)</b> </li>
          141  +<li> <b>datetime(</b><i>timestring, modifier, modifier, ...</i><b>)</b> </li>
          142  +<li> <b>julianday(</b><i>timestring, modifier, modifier, ...</i><b>)</b> </li>
          143  +<li> <b>strftime(</b><i>format, timestring, modifier, modifier, ...</i><b>)</b> </li>
   116    144   </ol>
   117    145   
   118         -<p>In formats 5 through 7, the &quot;T&quot; is a literal character separating the date and the time, as required by the ISO-8601 standard. These formats are supported in SQLite 3.2.0 and later.
   119         -Formats 8 through 10 that specify only a time assume a date of 2000-01-01.
   120         -Format 11, the string 'now', is converted into the current date and time.
   121         -Universal Coordinated Time (UTC) is used.
   122         -Format 12 is the julian day number expressed as a floating point value.
   123         -
   124         -<p><b>Modifiers</b>
   125         -
   126         -<p>The time string can be followed by zero or more modifiers that alter the
   127         -date or alter the interpretation of the date.  The available modifiers
   128         -are as follows.
   129         -
   130         -<p><ol>
   131         -<li>NNN days
   132         -<li>NNN hours
   133         -<li>NNN minutes
   134         -<li>NNN.NNNN seconds
   135         -<li>NNN months  (see <a href="tktview?tn=551">#551</a>
   136         - and <a href="chngview?cn=1163">[1163]</a>
   137         -)
   138         -<li>NNN years  (see <a href="tktview?tn=551">#551</a>
   139         - and <a href="chngview?cn=1163">[1163]</a>
   140         -)
   141         -<li>start of month
   142         -<li>start of year
   143         -<li>start of week  (withdrawn -- will not be implemented)
   144         -<li>start of day
   145         -<li>weekday N  (see <a href="tktview?tn=551">#551</a>
   146         - and <a href="chngview?cn=1163">[1163]</a>
   147         -)
   148         -<li>unixepoch
   149         -<li>localtime
   150         -<li>utc
          146  +<p>
          147  +All five date and time functions take a time string as an argument. 
          148  +The time string is followed by zero or more modifiers. 
          149  +The strftime() function also takes a format string as its first argument.
          150  +</p>
          151  +
          152  +<p>
          153  +The date and time functions use a subset of
          154  +<a href="http://en.wikipedia.org/wiki/ISO_8601">IS0-8601</a> date and time
          155  +formats.
          156  +The date() function returns the date in this format: YYYY-MM-DD. 
          157  +The time() function returns the time as HH:MM:SS. 
          158  +The datetime() function returns "YYYY-MM-DD HH:MM:SS". 
          159  +The julianday() function returns the 
          160  +<a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> - the
          161  +number of days since noon in Greenwich on November 24, 4714 B.C. 
          162  +(<a href="http://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar">Proleptic Gregorian calendar</a>).
          163  +The strftime() routine returns the date formatted according to 
          164  +the format string specified as the first argument.
          165  +The format string supports the most common substitutions found in the 
          166  +<a href="http://opengroup.org/onlinepubs/007908799/xsh/strftime.html">strftime() function</a>
          167  +from the standard C library plus two new substitutions, %f and %J.
          168  +The following is a complete list of valid strftime() substitutions:
          169  +</p>
          170  +
          171  +<blockquote>
          172  +<table border="0" cellpadding="0" cellspacing="0">
          173  +<tr><td><td width="10"><td></tr>
          174  +
          175  +<tr><td> %d <td><td> day of month: 00
          176  +<tr><td> %f <td><td> fractional seconds: SS.SSS
          177  +<tr><td> %H <td><td> hour: 00-24 
          178  +<tr><td> %j <td><td> day of year: 001-366
          179  +<tr><td> %J <td><td> Julian day number
          180  +<tr><td> %m <td><td> month: 01-12
          181  +<tr><td> %M <td><td> minute: 00-59
          182  +<tr><td> %s <td><td> seconds since 1970-01-01
          183  +<tr><td> %S <td><td> seconds: 00-59
          184  +<tr><td> %w <td><td> day of week 0-6 with Sunday==0
          185  +<tr><td> %W <td><td> week of year: 00-53
          186  +<tr><td> %Y <td><td> year: 0000-9999
          187  +<tr><td> %% <td><td> %
          188  +</table>
          189  +</blockquote>
          190  +
          191  +<p>
          192  +Notice that all other date and time functions can be expressed
          193  +in terms of strftime():
          194  +</p>
          195  +
          196  +<blockquote>
          197  +<table border="0" cellpadding="0" cellspacing="0">
          198  +<tr><td><b>Function</b><td width="30"><td><b>Equivalent strftime()</b>
          199  +<tr><td>   date(...)      <td><td>  strftime('%Y-%m-%d', ...)
          200  +<tr><td>   time(...)      <td><td>  strftime('%H:%M:%S', ...)
          201  +<tr><td>   datetime(...)  <td><td>  strftime('%Y-%m-%d %H:%M:%S', ...)
          202  +<tr><td>   julianday(...) <td><td>  strftime('%J', ...)
          203  +</table>
          204  +</blockquote>
          205  +
          206  +<p>
          207  +The only reasons for providing functions other than strftime() is
          208  +for convenience and for efficiency.
          209  +</p>
          210  +
          211  +<h3>Time Strings</h3>
          212  +
          213  +<p>A time string can be in any of the following formats:</p>
          214  +
          215  +<ol>
          216  +<li> <i>YYYY-MM-DD</i>
          217  +<li> <i>YYYY-MM-DD HH:MM</i>
          218  +<li> <i>YYYY-MM-DD HH:MM:SS</i>
          219  +<li> <i>YYYY-MM-DD HH:MM:SS.SSS</i>
          220  +<li> <i>YYYY-MM-DD</i><b>T</b><i>HH:MM</i>
          221  +<li> <i>YYYY-MM-DD</i><b>T</b><i>HH:MM:SS</i>
          222  +<li> <i>YYYY-MM-DD</i><b>T</b><i>HH:MM:SS.SSS</i>
          223  +<li> <i>HH:MM</i>
          224  +<li> <i>HH:MM:SS</i>
          225  +<li> <i>HH:MM:SS.SSS</i>
          226  +<li> <b>now</b>
          227  +<li> <i>DDDDDDDDDD</i>
   151    228   </ol>
   152    229   
   153         -<p>The first six modifiers (1 through 6) simply add the specified amount
   154         -of time to the date specified by the preceding timestring.
   155         -
   156         -<p>The &quot;start of&quot; modifiers (7 through 10) shift the date backwards to
   157         -the beginning of the current month, year or day.
   158         -
   159         -<p>The &quot;weekday&quot; modifier advances the date forward to the next date where
   160         -the weekday number is N.  Sunday is 0, Monday is 1, and so forth.
   161         -
   162         -<p>The &quot;unixepoch&quot; modifier (12) only works if it immediately follows
   163         -a timestring in the DDDDDDDDDD format.  This modifier causes the DDDDDDDDDD
   164         -to be interpreted not as a julian day number as it normally would be, but
   165         -as the number of seconds since 1970.  This modifier allows unix-based times
   166         -to be converted to julian day numbers easily.
   167         -
   168         -<p>The &quot;localtime&quot; modifier (13) adjusts the previous time string so that it
   169         -displays the correct local time.  &quot;utc&quot; undoes this.
   170         -
   171         -<p><b>Examples</b>
   172         -
   173         -<p>Compute the current date.
   174         -
   175         -<p><pre>
   176         -  SELECT date('now');
   177         -</pre>
   178         -
   179         -<p>Compute the last day of the current month.
   180         -
   181         -<p><pre>
   182         -  SELECT date('now','start of month','+1 month','-1 day');
   183         -</pre>
   184         -
   185         -<p>Compute the date and time given a unix timestamp 1092941466.
   186         -
   187         -<p><pre>
   188         -  SELECT datetime(1092941466, 'unixepoch');
   189         -</pre>
   190         -
   191         -<p>Compute the date and time given a unix timestamp 1092941466, and compensate for your local timezone.
   192         -
   193         -<p><pre>
   194         -  SELECT datetime(1092941466, 'unixepoch', 'localtime');
   195         -</pre>
   196         -
   197         -<p>Compute the current unix timestamp.
   198         -
   199         -<p><pre>
   200         -  SELECT strftime('%s','now');
   201         -</pre>
   202         -
   203         -<p>Compute the number of days since the battle of Hastings.
   204         -
   205         -<p><pre>
   206         -  SELECT julianday('now') - julianday('1066-10-14','gregorian');
   207         -</pre>
   208         -
   209         -<p>Compute the number of seconds between two dates:
   210         -
   211         -<p><pre>
   212         -  SELECT julianday('now')*86400 - julianday('2004-01-01 02:34:56')*86400;
   213         -</pre>
   214         -
   215         -<p>Compute the date of the first Tuesday in October (January + 9) for the current
   216         -year.
   217         -
   218         -<p><pre>
   219         -  SELECT date('now','start of year','+9 months','weekday 2');
   220         -</pre>
   221         -
   222         -<p><b>Caveats And Bugs</b>
   223         -
   224         -<p>The computation of local time depends heavily on the whim of local
   225         -politicians and is thus difficult to get correct for all locales.  In
   226         -this implementation, the standard C library function localtime() is
   227         -used to assist in the calculation of local time.
   228         -Note that localtime() is not
   229         -threadsafe, so use of the &quot;localtime&quot; modifier is not threadsafe.
   230         -Also, the localtime() C function normally only works for years between
   231         -1970 and 2037.  For dates outside this range, SQLite attempts to
   232         -map the year into an equivalent year within this range, do the
   233         -calculation, then map the year back.
   234         -
   235         -<p><i>Please surround uses of localtime() with sqliteOsEnterMutex() and sqliteOsLeaveMutex() so threads
   236         -using SQLite are protected, at least!
   237         --- e</i>  It is so. --drh
   238         -
   239         -<p><i>[Consider instead, using localtime_r which is reentrant and may be used
   240         -*without* expensive mutex locking. Although non-standard it's available
   241         -on most Unixes --hauk]</i> But it is not available on windows, as far as I
   242         -am aware. --drh On windows localtime() is thread-safe if the MT C runtime is used. The MT runtime uses thread-local storage for the static variables, the kind functions use.--gr <i>[What about using localtime_r, and on systems where it
   243         -is unavailable defining it as sqliteOsEnterMutext() ; locatime() ; sqliteOsLeaveMutex()
   244         -so that non-windows systems get the maximum advantage, with almost zero
   245         -code impact?]</i> The autoconfigury and patch for localtime_r is here: <font color="#a0a0a0">&curren;</font><a href="http://www.sqlite.org/cvstrac/tktview?tn=1906">http://www.sqlite.org/cvstrac/tktview?tn=1906</a> . I'm curious why this obvious fix is not applied. gmtime() also suffers from this same threadsafety problem.
   246         -
   247         -<p>Date computations do not give correct results for dates before Julian
   248         -day number 0 (-4713-11-24 12:00:00).
   249         -
   250         -<p>All internal computations assume the Gregorian calendar system.
   251         -
   252         -<p><hr>
   253         -<i>An anonymous user adds:</i> <br>
   254         -
   255         -For my use I added new functions and functionalities to the date functions that
   256         -come with the sqlite 3.3.0 (can be used in older versions as well with small effort).
   257         -
   258         -<p>In main lines they are as follows:
   259         -
   260         -<p><ol>
   261         -<li>NNN days
   262         -<li>NNN hours
   263         -<li>NNN minutes
   264         -<li>NNN.NNNN seconds
   265         -<li>NNN months  (see <a href="tktview?tn=551">#551</a>
   266         - and <a href="chngview?cn=1163">[1163]</a>
   267         -)
   268         -<li>NNN years  (see <a href="tktview?tn=551">#551</a>
   269         - and <a href="chngview?cn=1163">[1163]</a>
   270         -)
   271         -<li>start of month
   272         -<li>start of year
   273         -<li>start of week  (!!! implemented)
   274         -<li>start of day
   275         -<li>weekday N  (see <a href="tktview?tn=551">#551</a>
   276         - and <a href="chngview?cn=1163">[1163]</a>
   277         -)
   278         -<li>unixepoch
   279         -<li>localtime
   280         -<li>utc
   281         -<li>julian  (not implemented as of 2004-01-05)
   282         -<li>gregorian  (not implemented as of 2004-01-05)
   283         -<li>start of minute
   284         -<li>start of hour
   285         -<li>end of minute
   286         -<li>end of hour
   287         -<li>end of day
   288         -<li>end of week
   289         -<li>end of month
   290         -<li>end of year
   291         -<li>group seconds by
   292         -<li>group minutes by
   293         -<li>group hours by
   294         -<li>group days by
   295         -<li>group weeks by
   296         -<li>group months by
   297         -<li>group years by
          230  +<p>
          231  +In formats 5 through 7, the "T" is a literal character separating 
          232  +the date and the time, as required by 
          233  +<a href="http://www.w3c.org/TR/NOTE-datetime">ISO-8601</a>. 
          234  +Formats 8 through 10 that specify only a time assume a date of 
          235  +2000-01-01. Format 11, the string 'now', is converted into the 
          236  +current date and time as obtained from the xCurrentTime method
          237  +of the <a href="c3ref/vfs.html">sqlite3_vfs</a> object in use.
          238  +The 'now' argument to date and time functions always returns exactly the
          239  +same value for multiple invocations within the same <a href="c3ref/step.html">sqlite3_step()</a> call.
          240  +<a href="http://en.wikipedia.org/wiki/Coordinated_Universal_Time">Universal Coordinated Time (UTC)</a> is used. 
          241  +Format 12 is the 
          242  +<a href="http://en.wikipedia.org/wiki/Julian_day">Julian day number</a>
          243  +expressed as a floating point value.
          244  +</p>
          245  +
          246  +<p>
          247  +Formats 2 through 10 may be optionally followed by a timezone indicator of the form
          248  +"<i>&#91;+-&#93;HH:MM</i>" or just "<i>Z</i>".  The date and time functions use UTC or "zulu"
          249  +time internally, and so the "Z" suffix is a no-op.  Any non-zero "HH:MM" suffix is
          250  +subtracted from the indicated date and time in order to compute zulu time.
          251  +For example, all of the following time strings are equivalent:
          252  +</p>
          253  +
          254  +<blockquote>
          255  +2013-10-07 08:23:19.120<br>
          256  +2013-10-07T08:23:19.120Z<br>
          257  +2013-10-07 08:23:19.120-04:00<br>
          258  +2456572.84952685
          259  +</blockquote>
          260  +
          261  +<p>
          262  +In formats 4, 7, and 10, the fractional seconds value SS.SSS can have
          263  +one or more digits following the decimal point.  Exactly three digits are
          264  +shown in the examples because only the first three digits are significant
          265  +to the result, but the input string can have fewer or more than three digits
          266  +and the date/time functions will still operate correctly.
          267  +Similarly, format 12 is shown with 10 significant digits, but the date/time
          268  +functions will really accept as many or as few digits as are necessary to
          269  +represent the Julian day number.
          270  +</p>
          271  +
          272  +<h3>Modifiers</h3>
          273  +
          274  +<p>The time string can be followed by zero or more modifiers that 
          275  +alter date and/or time. Each modifier
          276  +is a transformation that is applied to the time value to its left.
          277  +Modifiers are applied from left to right; order is important.
          278  +The available modifiers are as follows.</p>
          279  +
          280  +<ol>
          281  +<li> NNN days
          282  +<li> NNN hours
          283  +<li> NNN minutes
          284  +<li> NNN.NNNN seconds
          285  +<li> NNN months
          286  +<li> NNN years
          287  +<li> start of month
          288  +<li> start of year
          289  +<li> start of day
          290  +<li> weekday N
          291  +<li> unixepoch
          292  +<li> localtime
          293  +<li> utc 
   298    294   </ol>
   299    295   
   300         -<p>The &quot;start of&quot; modifiers (7 through 10 and 17 through 18) shift the date backwards to the beginning of the current minute, hour, week, month, year or day.
          296  +<p>The first six modifiers (1 through 6) 
          297  +simply add the specified amount of time to the date and time 
          298  +specified by the preceding timestring and modifiers.
          299  +Note that "&plusmn;NNN months" works by rendering the original date into
          300  +the YYYY-MM-DD format, adding the &plusmn;NNN to the MM month value, then
          301  +normalizing the result.  Thus, for example, the data 2001-03-31 modified
          302  +by '+1 month' initially yields 2001-04-31, but April only has 30 days
          303  +so the date is normalized to 2001-05-01.  A similar effect occurs when
          304  +the original date is February 29 of a leapyear and the modifier is
          305  +&plusmn;N years where N is not a multiple of four.</p>
          306  +
          307  +<p>The "start of" modifiers (7 through 9) shift the date backwards 
          308  +to the beginning of the current month, year or day.</p>
          309  +
          310  +<p>The "weekday" modifier advances the date forward to the next date 
          311  +where the weekday number is N. Sunday is 0, Monday is 1, and so forth.</p>
          312  +
          313  +<p>The "unixepoch" modifier (11) only works if it immediately follows 
          314  +a timestring in the DDDDDDDDDD format. 
          315  +This modifier causes the DDDDDDDDDD to be interpreted not 
          316  +as a Julian day number as it normally would be, but as
          317  +<a href="http://en.wikipedia.org/wiki/Unix_time">Unix Time</a> - the 
          318  +number of seconds since 1970.  If the "unixepoch" modifier does not
          319  +follow a timestring of the form DDDDDDDDDD which expresses the number
          320  +of seconds since 1970 or if other modifiers
          321  +separate the "unixepoch" modifier from prior DDDDDDDDDD then the
          322  +behavior is undefined.
          323  +Due to precision limitations imposed by the implementations use
          324  +of 64-bit integers, the "unixepoch" modifier only works for
          325  +dates between 0000-01-01 00:00:00 and 5352-11-01 10:52:47 (unix times
          326  +of -62167219200 through 10675199167).</p>
          327  +
          328  +<p>The "localtime" modifier (12) assumes the time string to its left is in
          329  +Universal Coordinated Time (UTC) and adjusts the time
          330  +string so that it displays localtime.  If "localtime"
          331  +follows a time that is not UTC, then the behavior is undefined.
          332  +The "utc" is the opposite of "localtime".  "utc" assumes that the string
          333  +to its left is in the local timezone and adjusts that string to be in UTC.
          334  +If the prior string is not in localtime, then the result of "utc" is
          335  +undefined.</p>
          336  +
          337  +<h3>Examples</h3>
          338  +
          339  +<p>Compute the current date.<p>
          340  +
          341  +<blockquote>SELECT date('now');</blockquote>
          342  +
          343  +<p>Compute the last day of the current month.</p>
          344  +
          345  +<blockquote>SELECT date('now','start of month','+1 month','-1 day');
          346  +</blockquote>
          347  +
          348  +<p>Compute the date and time given a unix timestamp 1092941466.</p>
          349  +
          350  +<blockquote>
          351  +    SELECT datetime(1092941466, 'unixepoch');
          352  +</blockquote>
          353  +
          354  +<p>Compute the date and time given a unix timestamp 1092941466, and 
          355  +compensate for your local timezone.</p>
          356  +
          357  +<blockquote>
          358  +  SELECT datetime(1092941466, 'unixepoch', 'localtime');
          359  +</blockquote>
          360  +
          361  +<p>Compute the current unix timestamp.</p>
          362  +
          363  +<blockquote>
          364  +  SELECT strftime('%s','now');
          365  +</blockquote>
          366  +
          367  +<p>Compute the number of days since the signing of the US Declaration
          368  +of Independence.</p>
          369  +
          370  +<blockquote>
          371  +  SELECT julianday('now') - julianday('1776-07-04');
          372  +</blockquote>
          373  +
          374  +<p>Compute the number of seconds since a particular moment in 2004:</p>
          375  +
          376  +<blockquote>
          377  +  SELECT strftime('%s','now') - strftime('%s','2004-01-01 02:34:56');
          378  +</blockquote>
          379  +
          380  +<p>
          381  +Compute the date of the first Tuesday in October
          382  +for the current year.
          383  +</p>
          384  +
          385  +<blockquote>
          386  +  SELECT date('now','start of year','+9 months','weekday 2');
          387  +</blockquote>
          388  +
          389  +<p>Compute the time since the unix epoch in seconds 
          390  +(like strftime('%s','now') except includes fractional part):</p>
          391  +
          392  +<blockquote>
          393  +  SELECT (julianday('now') - 2440587.5)*86400.0;
          394  +</blockquote>
          395  +
          396  +<h3>Caveats And Bugs</h3>
          397  +
          398  +<p>The computation of local time depends heavily on the whim 
          399  +of politicians and is thus difficult to get correct for 
          400  +all locales. In this implementation, the standard C library 
          401  +function localtime_r() is used to assist in the calculation of 
          402  +local time.  The 
          403  +localtime_r() C function normally only works for years
          404  +between 1970 and 2037. For dates outside this range, SQLite 
          405  +attempts to map the year into an equivalent year within 
          406  +this range, do the calculation, then map the year back.</p>
          407  +
   301    408   
   302         -<p>The &quot;end of&quot; modifiers (19 through 24) shift the date forwards to
   303         -the end of the current minute, hour, week, month, year or day.
          409  +<p>These functions only work for dates between 0000-01-01 00:00:00
          410  +and 9999-12-31 23:59:59 (julidan day numbers 1721059.5 through 5373484.5).
          411  +For dates outside that range, the results of these
          412  +functions are undefined.</p>
   304    413   
   305         -<p>The &quot;group * by&quot; modifiers (25 through 31) round the date to the closest backward multiple supplied, with some limitations, to the current seconds (1 through 30), minutes (1 through 30), hours (1 through 12), days (1 through 15), weeks (1 through 26), months (1 through 6), years (1 through 100), these limitations are due to dont complicate the calculations when a multiple can span beyound the unit modified.
          414  +<p>Non-Vista Windows platforms only support one set of DST rules. 
          415  +Vista only supports two. Therefore, on these platforms, 
          416  +historical DST calculations will be incorrect. 
          417  +For example, in the US, in 2007 the DST rules changed. 
          418  +Non-Vista Windows platforms apply the new 2007 DST rules 
          419  +to all previous years as well. Vista does somewhat better
          420  +getting results correct back to 1986, when the rules were also changed.</p>
   306    421   
   307         -<p>Ex:
   308         -
   309         -<p>SELECT datetime('2006-02-04 20:09:23','group hours by 3'); =&gt; '2006-02-04 18:00:00'
   310         -
   311         -<p>SELECT datetime('2006-02-05 20:09:23','group days by 3'); =&gt; '2006-02-04 00:00:00'
          422  +<p>All internal computations assume the 
          423  +<a href="http://en.wikipedia.org/wiki/Gregorian_calendar">Gregorian calendar</a>
          424  +system.  It is also assumed that every
          425  +day is exactly 86400 seconds in duration.</p>
   312    426   
   313         -<p>New functions &quot;week_number(date)&quot; returns the week number of the year on the supplied date parameter, &quot;datetime2seconds(datetime)&quot; return the number of seconds from the supplied datetime parameter.
   314         -      <hr>
   315         -      <div id="footer">
   316         -        <p>
   317         -          &nbsp;</p>
   318         -        <p>
   319         -        </p>
   320         -      </div>
   321         -    </div>
   322         -    </div>
   323         -  </body>
   324         -</html>
          427  +

Changes to Doc/Extra/Core/lang_delete.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>DELETE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">DELETE</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        DELETE</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">DELETE FROM </font></b>[<b><font color="#2c2cf0"></font></b><i><font
    55         -                color="#ff3434">database-name</font></i><b><font color="#2c2cf0"> <big>.</big></font></b>]<b><font
    56         -                  color="#2c2cf0"> </font></b><i><font color="#ff3434">table-name</font></i><b><font
    57         -                    color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0">WHERE </font></b><i><font color="#ff3434">
    58         -                      expr</font></i><b><font color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"></font></b></td>
    59         -          </tr>
    60         -        </table>
    61         -      </p>
    62         -      <p>
    63         -        The DELETE command is used to remove records from a table. The command consists
    64         -        of the "DELETE FROM" keywords followed by the
    65         -        name of the table from which records
    66         -        are to be removed.
    67         -      </p>
    68         -      <p>
    69         -        Without a WHERE clause, all rows of the table are removed. If a WHERE clause is
    70         -        supplied, then only those rows that match the expression are removed.</p>
    71         -      <p>
    72         -      <hr>
    73         -        &nbsp;</p>
    74         -      <div id="footer">
    75         -        <p>
    76         -          &nbsp;</p>
    77         -        <p>
    78         -        </p>
    79         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: DELETE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    80    126       </div>
    81         -    </div>
    82         -  </body>
    83         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>DELETE</h2><p><b><a href="syntaxdiagrams.html#delete-stmt">delete-stmt:</a></b>
          132  +<button id='x991' onclick='hideorshow("x991","x992")'>hide</button></p>
          133  + <blockquote id='x992'>
          134  + <img alt="syntax diagram delete-stmt" src="images/syntax/delete-stmt.gif" />
          135  +<p><b><a href="syntaxdiagrams.html#expr">expr:</a></b>
          136  +<button id='x993' onclick='hideorshow("x993","x994")'>show</button></p>
          137  + <blockquote id='x994' style='display:none;'>
          138  + <img alt="syntax diagram expr" src="images/syntax/expr.gif" />
          139  +<p><b><a href="syntaxdiagrams.html#literal-value">literal-value:</a></b>
          140  +<button id='x995' onclick='hideorshow("x995","x996")'>show</button></p>
          141  + <blockquote id='x996' style='display:none;'>
          142  + <img alt="syntax diagram literal-value" src="images/syntax/literal-value.gif" />
          143  +</blockquote>
          144  +<p><b><a href="syntaxdiagrams.html#raise-function">raise-function:</a></b>
          145  +<button id='x997' onclick='hideorshow("x997","x998")'>show</button></p>
          146  + <blockquote id='x998' style='display:none;'>
          147  + <img alt="syntax diagram raise-function" src="images/syntax/raise-function.gif" />
          148  +</blockquote>
          149  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          150  +<button id='x999' onclick='hideorshow("x999","x1000")'>show</button></p>
          151  + <blockquote id='x1000' style='display:none;'>
          152  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          153  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          154  +<button id='x1001' onclick='hideorshow("x1001","x1002")'>show</button></p>
          155  + <blockquote id='x1002' style='display:none;'>
          156  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          157  +</blockquote>
          158  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          159  +<button id='x1003' onclick='hideorshow("x1003","x1004")'>show</button></p>
          160  + <blockquote id='x1004' style='display:none;'>
          161  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          162  +</blockquote>
          163  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          164  +<button id='x1005' onclick='hideorshow("x1005","x1006")'>show</button></p>
          165  + <blockquote id='x1006' style='display:none;'>
          166  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          167  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          168  +<button id='x1007' onclick='hideorshow("x1007","x1008")'>show</button></p>
          169  + <blockquote id='x1008' style='display:none;'>
          170  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          171  +</blockquote>
          172  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          173  +<button id='x1009' onclick='hideorshow("x1009","x1010")'>show</button></p>
          174  + <blockquote id='x1010' style='display:none;'>
          175  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          176  +</blockquote>
          177  +</blockquote>
          178  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          179  +<button id='x1011' onclick='hideorshow("x1011","x1012")'>show</button></p>
          180  + <blockquote id='x1012' style='display:none;'>
          181  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          182  +</blockquote>
          183  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          184  +<button id='x1013' onclick='hideorshow("x1013","x1014")'>show</button></p>
          185  + <blockquote id='x1014' style='display:none;'>
          186  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          187  +</blockquote>
          188  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          189  +<button id='x1015' onclick='hideorshow("x1015","x1016")'>show</button></p>
          190  + <blockquote id='x1016' style='display:none;'>
          191  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          192  +</blockquote>
          193  +</blockquote>
          194  +<p><b><a href="syntaxdiagrams.html#type-name">type-name:</a></b>
          195  +<button id='x1017' onclick='hideorshow("x1017","x1018")'>show</button></p>
          196  + <blockquote id='x1018' style='display:none;'>
          197  + <img alt="syntax diagram type-name" src="images/syntax/type-name.gif" />
          198  +<p><b><a href="syntaxdiagrams.html#signed-number">signed-number:</a></b>
          199  +<button id='x1019' onclick='hideorshow("x1019","x1020")'>show</button></p>
          200  + <blockquote id='x1020' style='display:none;'>
          201  + <img alt="syntax diagram signed-number" src="images/syntax/signed-number.gif" />
          202  +</blockquote>
          203  +</blockquote>
          204  +</blockquote>
          205  +<p><b><a href="syntaxdiagrams.html#qualified-table-name">qualified-table-name:</a></b>
          206  +<button id='x1021' onclick='hideorshow("x1021","x1022")'>show</button></p>
          207  + <blockquote id='x1022' style='display:none;'>
          208  + <img alt="syntax diagram qualified-table-name" src="images/syntax/qualified-table-name.gif" />
          209  +</blockquote>
          210  +<p><b><a href="syntaxdiagrams.html#with-clause">with-clause:</a></b>
          211  +<button id='x1023' onclick='hideorshow("x1023","x1024")'>show</button></p>
          212  + <blockquote id='x1024' style='display:none;'>
          213  + <img alt="syntax diagram with-clause" src="images/syntax/with-clause.gif" />
          214  +<p><b><a href="syntaxdiagrams.html#cte-table-name">cte-table-name:</a></b>
          215  +<button id='x1025' onclick='hideorshow("x1025","x1026")'>show</button></p>
          216  + <blockquote id='x1026' style='display:none;'>
          217  + <img alt="syntax diagram cte-table-name" src="images/syntax/cte-table-name.gif" />
          218  +</blockquote>
          219  +<p><b><a href="syntaxdiagrams.html#select-stmt">select-stmt:</a></b>
          220  +<button id='x1027' onclick='hideorshow("x1027","x1028")'>show</button></p>
          221  + <blockquote id='x1028' style='display:none;'>
          222  + <img alt="syntax diagram select-stmt" src="images/syntax/select-stmt.gif" />
          223  +<p><b><a href="syntaxdiagrams.html#common-table-expression">common-table-expression:</a></b>
          224  +<button id='x1029' onclick='hideorshow("x1029","x1030")'>show</button></p>
          225  + <blockquote id='x1030' style='display:none;'>
          226  + <img alt="syntax diagram common-table-expression" src="images/syntax/common-table-expression.gif" />
          227  +</blockquote>
          228  +<p><b><a href="syntaxdiagrams.html#compound-operator">compound-operator:</a></b>
          229  +<button id='x1031' onclick='hideorshow("x1031","x1032")'>show</button></p>
          230  + <blockquote id='x1032' style='display:none;'>
          231  + <img alt="syntax diagram compound-operator" src="images/syntax/compound-operator.gif" />
          232  +</blockquote>
          233  +<p><b><a href="syntaxdiagrams.html#join-clause">join-clause:</a></b>
          234  +<button id='x1033' onclick='hideorshow("x1033","x1034")'>show</button></p>
          235  + <blockquote id='x1034' style='display:none;'>
          236  + <img alt="syntax diagram join-clause" src="images/syntax/join-clause.gif" />
          237  +<p><b><a href="syntaxdiagrams.html#join-constraint">join-constraint:</a></b>
          238  +<button id='x1035' onclick='hideorshow("x1035","x1036")'>show</button></p>
          239  + <blockquote id='x1036' style='display:none;'>
          240  + <img alt="syntax diagram join-constraint" src="images/syntax/join-constraint.gif" />
          241  +</blockquote>
          242  +<p><b><a href="syntaxdiagrams.html#join-operator">join-operator:</a></b>
          243  +<button id='x1037' onclick='hideorshow("x1037","x1038")'>show</button></p>
          244  + <blockquote id='x1038' style='display:none;'>
          245  + <img alt="syntax diagram join-operator" src="images/syntax/join-operator.gif" />
          246  +</blockquote>
          247  +</blockquote>
          248  +<p><b><a href="syntaxdiagrams.html#ordering-term">ordering-term:</a></b>
          249  +<button id='x1039' onclick='hideorshow("x1039","x1040")'>show</button></p>
          250  + <blockquote id='x1040' style='display:none;'>
          251  + <img alt="syntax diagram ordering-term" src="images/syntax/ordering-term.gif" />
          252  +</blockquote>
          253  +<p><b><a href="syntaxdiagrams.html#result-column">result-column:</a></b>
          254  +<button id='x1041' onclick='hideorshow("x1041","x1042")'>show</button></p>
          255  + <blockquote id='x1042' style='display:none;'>
          256  + <img alt="syntax diagram result-column" src="images/syntax/result-column.gif" />
          257  +</blockquote>
          258  +<p><b><a href="syntaxdiagrams.html#table-or-subquery">table-or-subquery:</a></b>
          259  +<button id='x1043' onclick='hideorshow("x1043","x1044")'>show</button></p>
          260  + <blockquote id='x1044' style='display:none;'>
          261  + <img alt="syntax diagram table-or-subquery" src="images/syntax/table-or-subquery.gif" />
          262  +</blockquote>
          263  +</blockquote>
          264  +</blockquote>
          265  +</blockquote>
          266  +
          267  +
          268  +<p>The DELETE command removes records from the table identified by the
          269  +   <i>qualified-table-name</i>. 
          270  +
          271  +<p>If the WHERE clause is not present, all records in the table are deleted.
          272  +   If a WHERE clause is supplied, then only those rows for which the
          273  +   result of evaluating the WHERE clause as a <a href="lang_expr.html#booleanexpr">boolean expression is true</a> are deleted.
          274  +
          275  +<h3>Restrictions on DELETE Statements Within CREATE TRIGGER</h3>
          276  +
          277  +<p>The following restrictions apply to DELETE statements that occur within the
          278  +   body of a <a href="lang_createtrigger.html">CREATE TRIGGER</a> statement:
          279  +
          280  +<ul>
          281  +  <li><p>The <i>table-name</i> specified as part of a DELETE statement within
          282  +    a trigger body must be unqualified.  In other words, the
          283  +    <i>database-name</i><b>.</b> prefix on the table name is not allowed 
          284  +    within triggers. If the table to which the trigger is attached is
          285  +    not in the temp database, then DELETE statements within the trigger
          286  +    body must operate on tables within the same database as it. If the table
          287  +    to which the trigger is attached is in the TEMP database, then the
          288  +    unqualified name of the table being deleted is resolved in the same way as
          289  +    it is for a top-level statement (by searching first the TEMP database, then
          290  +    the main database, then any other databases in the order they were
          291  +    attached).
          292  +    
          293  +  <li><p>The INDEXED BY and NOT INDEXED clauses are not allowed on DELETE
          294  +    statements within triggers.</p>
          295  +
          296  +  <li><p>The LIMIT and ORDER BY clauses (described below) are unsupported for
          297  +    DELETE statements within triggers.</p>
          298  +</ul>
          299  +
          300  +<h3>Optional LIMIT and ORDER BY clauses</h3>
          301  +
          302  +<p>If SQLite is compiled with the <a href="compile.html#enable_update_delete_limit">SQLITE_ENABLE_UPDATE_DELETE_LIMIT</a>
          303  +compile-time option, then the syntax of the DELETE statement is
          304  +extended by the addition of optional ORDER BY and LIMIT clauses:</p>
          305  +
          306  +<p><b><a href="syntaxdiagrams.html#delete-stmt-limited">delete-stmt-limited:</a></b></p><blockquote>
          307  + <img alt="syntax diagram delete-stmt-limited" src="images/syntax/delete-stmt-limited.gif"></img>
          308  + </blockquote>
          309  +
          310  +
          311  +<p>If a DELETE statement has a LIMIT clause, the maximum number of rows that
          312  +will be deleted is found by evaluating the accompanying expression and casting
          313  +it to an integer value. If the result of the evaluating the LIMIT clause
          314  +cannot be losslessly converted to an integer value, it is an error. A 
          315  +negative LIMIT value is interpreted as "no limit". If the DELETE statement 
          316  +also has an OFFSET clause, then it is similarly evaluated and cast to an
          317  +integer value. Again, it is an error if the value cannot be losslessly
          318  +converted to an integer. If there is no OFFSET clause, or the calculated
          319  +integer value is negative, the effective OFFSET value is zero.
          320  +
          321  +<p>If the DELETE statement has an ORDER BY clause, then all rows that would 
          322  +be deleted in the absence of the LIMIT clause are sorted according to the 
          323  +ORDER BY. The first <i>M</i> rows, where <i>M</i> is the value found by
          324  +evaluating the OFFSET clause expression, are skipped, and the following 
          325  +<i>N</i>, where <i>N</i> is the value of the LIMIT expression, are deleted.
          326  +If there are less than <i>N</i> rows remaining after taking the OFFSET clause
          327  +into account, or if the LIMIT clause evaluated to a negative value, then all
          328  +remaining rows are deleted.
          329  +
          330  +<p>If the DELETE statement has no ORDER BY clause, then all rows that
          331  +would be deleted in the absence of the LIMIT clause are assembled in an
          332  +arbitrary order before applying the LIMIT and OFFSET clauses to determine 
          333  +the subset that are actually deleted.
          334  +
          335  +<p>The ORDER BY clause on a DELETE statement is used only to determine which
          336  +rows fall within the LIMIT. The order in which rows are deleted is arbitrary
          337  +and is not influenced by the ORDER BY clause.
          338  +
          339  +<a name="truncateopt"></a>
          340  +
          341  +<h3>The Truncate Optimization</h3>
          342  +
          343  +<p>When the WHERE is omitted from a DELETE statement and the table
          344  +being deleted has no triggers,
          345  +SQLite uses an optimization to erase the entire table content
          346  +without having to visit each row of the table individually.
          347  +This "truncate" optimization makes the delete run much faster.
          348  +Prior to SQLite <a href="releaselog/3_6_5.html">version 3.6.5</a>, the truncate optimization
          349  +also meant that the <a href="c3ref/changes.html">sqlite3_changes()</a> and
          350  +<a href="c3ref/total_changes.html">sqlite3_total_changes()</a> interfaces
          351  +and the <a href="pragma.html#pragma_count_changes">count_changes pragma</a>
          352  +will not actually return the number of deleted rows.  
          353  +That problem has been fixed as of <a href="releaselog/3_6_5.html">version 3.6.5</a>.
          354  +
          355  +<p>The truncate optimization can be permanently disabled for all queries
          356  +by recompiling
          357  +SQLite with the <a href="compile.html#omit_truncate_optimization">SQLITE_OMIT_TRUNCATE_OPTIMIZATION</a> compile-time switch.</p>
          358  +
          359  +<p>The truncate optimization can also be disabled at runtime using
          360  +the <a href="c3ref/set_authorizer.html">sqlite3_set_authorizer()</a> interface.  If an authorizer callback
          361  +returns <a href="c3ref/c_deny.html">SQLITE_IGNORE</a> for an <a href="c3ref/c_alter_table.html">SQLITE_DELETE</a> action code, then
          362  +the DELETE operation will proceed but the truncate optimization will
          363  +be bypassed and rows will be deleted one by one.</p>
          364  +
          365  +

Changes to Doc/Extra/Core/lang_detach.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>DETACH</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">DETACH</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: DETACH DATABASE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    41    126       </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        DETACH</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">DETACH </font></b>[<b><font color="#2c2cf0">DATABASE</font></b>]<b><font
    55         -                color="#2c2cf0"> </font></b><i><font color="#ff3434">database-name</font></i><b><font
    56         -                  color="#2c2cf0"></font></b></td>
    57         -          </tr>
    58         -        </table>
    59         -      </p>
    60         -      <p>
    61         -        This statement detaches an additional database connection previously attached using
    62         -        the <a href="lang_attach.html">ATTACH DATABASE</a> statement. It is possible to have the same database file attached multiple times using different names, and detaching
    63         -        one connection to a file will leave the others intact.</p>
    64         -      <p>
    65         -        This statement will fail if SQLite is in the middle of a transaction.</p>
    66         -      <p>
    67         -      <hr>
    68         -        &nbsp;</p>
    69         -      <div id="footer">
    70         -        <p>
    71         -          &nbsp;</p>
    72         -        <p>
    73         -        </p>
    74         -      </div>
    75         -    </div>
    76         -    </div>
    77         -  </body>
    78         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>DETACH DATABASE</h2><p><b><a href="syntaxdiagrams.html#detach-stmt">detach-stmt:</a></b>
          132  +<button id='x1045' onclick='hideorshow("x1045","x1046")'>hide</button></p>
          133  + <blockquote id='x1046'>
          134  + <img alt="syntax diagram detach-stmt" src="images/syntax/detach-stmt.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>This statement detaches an additional database connection previously 
          139  +attached using the <a href="lang_attach.html">ATTACH</a> statement.  
          140  +When not in <a href="sharedcache.html">shared cache mode</a>, 
          141  +it is possible to have the same database file attached multiple times using 
          142  +different names, and detaching one connection to a file will leave the 
          143  +others intact.</p>
          144  +In <a href="sharedcache.html">shared cache mode</a>, attempting to attach the same database file more
          145  +than once results in an error.
          146  +
          147  +<p>This statement will fail if SQLite is in the middle of a transaction.</p>
          148  +
          149  +
          150  +

Changes to Doc/Extra/Core/lang_dropindex.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>DROP INDEX</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">DROP INDEX</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        DROP INDEX</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">DROP INDEX </font></b>[<b><font color="#2c2cf0">IF EXISTS</font></b>]<b><font
    55         -                color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    56         -                  color="#2c2cf0"> <big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    57         -              <i><font color="#ff3434">index-name</font></i><b><font color="#2c2cf0"></font></b></td>
    58         -          </tr>
    59         -        </table>
    60         -      </p>
    61         -      <p>
    62         -        The DROP INDEX statement removes an index added with the <a href="lang_createindex.html">
    63         -          CREATE INDEX</a> statement. The index named is completely removed from the disk.
    64         -        The only way to recover the index is to reenter the appropriate CREATE INDEX command.</p>
    65         -      <p>
    66         -        The DROP INDEX statement does not reduce the size of the database file in the default
    67         -        mode. Empty space in the database is retained for later INSERTs. To remove free
    68         -        space in the database, use the <a href="lang_vacuum.html">
    69         -          VACUUM</a> command. If
    70         -        AUTOVACUUM mode is enabled for a database then space will be freed automatically by DROP INDEX.</p>
    71         -      <p>
    72         -      <hr>
    73         -        &nbsp;</p>
    74         -      <div id="footer">
    75         -        <p>
    76         -          &nbsp;</p>
    77         -        <p>
    78         -        </p>
    79         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: DROP INDEX</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    80    126       </div>
    81         -    </div>
    82         -  </body>
    83         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>DROP INDEX</h2><p><b><a href="syntaxdiagrams.html#drop-index-stmt">drop-index-stmt:</a></b>
          132  +<button id='x1047' onclick='hideorshow("x1047","x1048")'>hide</button></p>
          133  + <blockquote id='x1048'>
          134  + <img alt="syntax diagram drop-index-stmt" src="images/syntax/drop-index-stmt.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>The DROP INDEX statement removes an index added
          139  +with the <a href="lang_createindex.html">CREATE INDEX</a> statement.  The index is completely removed from
          140  +the disk.  The only way to recover the index is to reenter the
          141  +appropriate <a href="lang_createindex.html">CREATE INDEX</a> command.</p>
          142  +
          143  +

Changes to Doc/Extra/Core/lang_droptable.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>DROP TABLE</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">DROP TABLE</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        DROP TABLE</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">DROP TABLE </font></b>[<b><font color="#2c2cf0">IF EXISTS</font></b>]<b><font
    55         -                color="#2c2cf0"> </font></b>[<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
    56         -                  color="#2c2cf0"><big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
    57         -              <i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0"></font></b></td>
    58         -          </tr>
    59         -        </table>
    60         -      </p>
    61         -      <p>
    62         -        The DROP TABLE statement removes a table added with the <a href="#createtable">CREATE TABLE</a> statement. The
    63         -        name specified is the table name. It is completely removed
    64         -        from the database schema and the disk file. The table can not be recovered. All
    65         -        indices associated with the table are also deleted.</p>
    66         -      <p>
    67         -        The DROP TABLE statement does not reduce the size of the database file in the default
    68         -        mode. Empty space in the database is retained for later INSERTs. To remove free
    69         -        space in the database, use the <a href="lang_vacuum.html">
    70         -          VACUUM</a> command. If
    71         -        AUTOVACUUM mode is enabled for a database then space will be freed automatically by DROP TABLE.</p>
    72         -      <p>
    73         -        The optional IF EXISTS clause suppresses the error that would normally result if the table does not exist.</p>
    74         -      <p>
    75         -      <hr>
    76         -        &nbsp;</p>
    77         -      <div id="footer">
    78         -        <p>
    79         -          &nbsp;</p>
    80         -        <p>
    81         -        </p>
    82         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: DROP TABLE</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    83    126       </div>
    84         -    </div>
    85         -  </body>
    86         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>DROP TABLE</h2><p><b><a href="syntaxdiagrams.html#drop-table-stmt">drop-table-stmt:</a></b>
          132  +<button id='x1049' onclick='hideorshow("x1049","x1050")'>hide</button></p>
          133  + <blockquote id='x1050'>
          134  + <img alt="syntax diagram drop-table-stmt" src="images/syntax/drop-table-stmt.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>The DROP TABLE statement removes a table added with the
          139  +<a href="lang_createtable.html">CREATE TABLE</a> statement.  The name specified is the
          140  +table name.  The dropped table is completely removed from the database 
          141  +schema and the disk file.  The table can not be recovered.  
          142  +All indices and triggers
          143  +associated with the table are also deleted.</p>
          144  +
          145  +<p>The optional IF EXISTS clause suppresses the error that would normally
          146  +result if the table does not exist.</p>
          147  +
          148  +<p>If <a href="foreignkeys.html">foreign key constraints</a> are enabled, a DROP TABLE command performs an
          149  +implicit <a href="lang_delete.html">DELETE FROM &lt;tbl&gt;</a> command before removing the
          150  +table from the database schema. Any triggers attached to the table are
          151  +dropped from the database schema before the implicit DELETE FROM &lt;tbl&gt; 
          152  +is executed, so this cannot cause any triggers to fire. By contrast, an
          153  +implicit DELETE FROM &lt;tbl&gt; does cause any configured
          154  +<a href="foreignkeys.html#fk_actions">foreign key actions</a> to take place. 
          155  +If the implicit DELETE FROM &lt;tbl&gt; executed
          156  +as part of a DROP TABLE command violates any immediate foreign key constraints,
          157  +an error is returned and the table is not dropped. If 
          158  +the implicit DELETE FROM &lt;tbl&gt; causes any 
          159  +deferred foreign key constraints to be violated, and the violations still
          160  +exist when the transaction is committed, an error is returned at the time
          161  +of commit.
          162  +
          163  +

Changes to Doc/Extra/Core/lang_droptrigger.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>DROP TRIGGER</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">DROP TRIGGER</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: DROP TRIGGER</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    41    126       </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        DROP TRIGGER</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">DROP TRIGGER </font></b>[<b><font color="#2c2cf0"></font></b><i><font
    55         -                color="#ff3434">database-name</font></i><b><font color="#2c2cf0"> <big>.</big></font></b>]<b><font
    56         -                  color="#2c2cf0"> </font></b><i><font color="#ff3434">trigger-name</font></i><b><font
    57         -                    color="#2c2cf0"></font></b></td>
    58         -          </tr>
    59         -        </table>
    60         -      </p>
    61         -      <p>
    62         -        The DROP TRIGGER statement removes a trigger created by the <a href="lang_createtrigger.html">
    63         -          CREATE TRIGGER</a> statement. The trigger is deleted from the database schema.
    64         -        Note that triggers are automatically dropped when the associated table is dropped.</p>
    65         -      <p>
    66         -      <hr>
    67         -        &nbsp;</p>
    68         -      <div id="footer">
    69         -        <p>
    70         -          &nbsp;</p>
    71         -        <p>
    72         -        </p>
    73         -      </div>
    74         -    </div>
    75         -    </div>
    76         -  </body>
    77         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>DROP TRIGGER</h2><p><b><a href="syntaxdiagrams.html#drop-trigger-stmt">drop-trigger-stmt:</a></b>
          132  +<button id='x1051' onclick='hideorshow("x1051","x1052")'>hide</button></p>
          133  + <blockquote id='x1052'>
          134  + <img alt="syntax diagram drop-trigger-stmt" src="images/syntax/drop-trigger-stmt.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>The DROP TRIGGER statement removes a trigger created by the 
          139  +<a href="lang_createtrigger.html">CREATE TRIGGER</a> statement. Once removed, the trigger definition is no
          140  +longer present in the sqlite_master (or sqlite_temp_master) table and is
          141  +not fired by any subsequent INSERT, UPDATE or DELETE statements.
          142  +
          143  +<p>Note that triggers are automatically dropped when the associated table is
          144  +dropped.
          145  +
          146  +

Changes to Doc/Extra/Core/lang_dropview.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>DROP VIEW</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">DROP VIEW</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: DROP VIEW</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    41    126       </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        DROP VIEW</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-command</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">DROP VIEW </font></b><i><font color="#ff3434">view-name</font></i><b><font
    55         -                color="#2c2cf0"></font></b></td>
    56         -          </tr>
    57         -        </table>
    58         -      </p>
    59         -      <p>
    60         -        The DROP VIEW statement removes a view created by the <a href="#createview">CREATE VIEW</a> statement. The
    61         -        name specified is the view name. It is removed from the
    62         -        database schema, but no actual data
    63         -        in the underlying base tables is modified.</p>
    64         -      <p>
    65         -      <hr>
    66         -        &nbsp;</p>
    67         -      <div id="footer">
    68         -        <p>
    69         -          &nbsp;</p>
    70         -        <p>
    71         -        </p>
    72         -      </div>
    73         -    </div>
    74         -    </div>
    75         -  </body>
    76         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>DROP VIEW</h2><p><b><a href="syntaxdiagrams.html#drop-view-stmt">drop-view-stmt:</a></b>
          132  +<button id='x1053' onclick='hideorshow("x1053","x1054")'>hide</button></p>
          133  + <blockquote id='x1054'>
          134  + <img alt="syntax diagram drop-view-stmt" src="images/syntax/drop-view-stmt.gif" />
          135  +</blockquote>
          136  +
          137  +
          138  +<p>The DROP VIEW statement removes a view created by the <a href="lang_createview.html">CREATE VIEW</a> 
          139  +  statement. The view definition is removed from the database schema, but 
          140  +  no actual data in the underlying base tables is modified.
          141  +
          142  +<p>The view to drop is identified by the view-name and optional 
          143  +  database-name specified as part of the DROP VIEW statement. This 
          144  +  reference is resolved using the standard procedure for <a href="lang_naming.html">object resolution</a>.
          145  +
          146  +<p>
          147  +  If the specified view cannot be found and the IF EXISTS clause is not 
          148  +  present, it is an error. If the specified view cannot be found and an IF
          149  +  EXISTS clause is present in the DROP VIEW statement, then the statement
          150  +  is a no-op.
          151  +
          152  +
          153  +

Changes to Doc/Extra/Core/lang_explain.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>EXPLAIN</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -  </head>
     7         -  <body>
     8         -    <div id="header">
     9         -      <table width="100%" id="topTable">
    10         -        <tr id="headerTableRow1">
    11         -          <td align="left">
    12         -            <span id="runningHeaderText">EXPLAIN</span>&nbsp;</td>
    13         -        </tr>
    14         -        <tr id="headerTableRow2">
    15         -          <td align="left">
    16         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    17         -          </td>
    18         -        </tr>
    19         -        <tr id="headerTableRow3" style="display:none">
    20         -          <td>
    21         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    22         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    23         -          </td>
    24         -        </tr>
    25         -     </table>
    26         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    27         -        <tr>
    28         -          <td>
    29         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    30         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    31         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    32         -							Collapse All
    33         -						</label>
    34         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    35         -							Expand All
    36         -						</label>
    37         -            </span>
    38         -          </td>
    39         -        </tr>
    40         -      </table>
    41         -    </div>
    42         -    <div id="mainSection">
    43         -    <div id="mainBody">
    44         -      <h1 class="heading">
    45         -        SQL As Understood By SQLite</h1>
    46         -      <h4>
    47         -        EXPLAIN</h4>
    48         -      <p>
    49         -        <table cellpadding="10">
    50         -          <tr>
    51         -            <td align="right" width="1%" nowrap>
    52         -              <i><font color="#ff3434">sql-statement</font></i> ::=</td>
    53         -            <td>
    54         -              <b><font color="#2c2cf0">EXPLAIN </font></b><i><font color="#ff3434">sql-statement</font></i><b><font
    55         -                color="#2c2cf0"></font></b></td>
    56         -          </tr>
    57         -        </table>
    58         -      </p>
    59         -      <p>
    60         -        The EXPLAIN command modifier is a non-standard extension. The idea comes from a similar command found in PostgreSQL, but the operation is completely different.</p>
    61         -      <p>
    62         -        If the EXPLAIN keyword appears before any
    63         -          other SQLite SQL command then instead
    64         -        of actually executing the command, the SQLite library will report back the sequence
    65         -        of virtual machine instructions it would have used to execute the command had the
    66         -        EXPLAIN keyword not been present. For additional information about virtual machine
    67         -        instructions see the <a href="http://www.sqlite.org/arch.html">architecture description</a>
    68         -        or the documentation on <a href="http://www.sqlite.org/opcode.html">available opcodes</a>
    69         -        for the virtual machine.</p>
    70         -      <p>
    71         -        &nbsp;</p>
    72         -      <hr>
    73         -      <div id="footer">
    74         -        <p>
    75         -          &nbsp;</p>
    76         -        <p>
    77         -        </p>
    78         -      </div>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: EXPLAIN</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    79    126       </div>
    80         -    </div>
    81         -  </body>
    82         -</html>
          127  +  </table>
          128  +
          129  +<div class=startsearch></div>
          130  +  
          131  +<h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>EXPLAIN</h2><p><b><a href="syntaxdiagrams.html#sql-stmt">sql-stmt:</a></b></p><blockquote>
          132  + <img alt="syntax diagram sql-stmt" src="images/syntax/sql-stmt.gif"></img>
          133  + </blockquote>
          134  +
          135  +
          136  +<p>An SQL statement can be preceded by the keyword "EXPLAIN" or
          137  +by the phrase "EXPLAIN QUERY PLAN".  Either modification causes the
          138  +SQL statement to behave as a query and to return information about
          139  +how the SQL statement would have operated if the EXPLAIN keyword or
          140  +phrase had been omitted.</p>
          141  +
          142  +<p>The output from EXPLAIN and EXPLAIN QUERY PLAN is intended for
          143  +interactive analysis and troubleshooting only.  The details of the 
          144  +output format are subject to change from one release of SQLite to the next.
          145  +Applications should not use EXPLAIN or EXPLAIN QUERY PLAN since
          146  +their exact behavior is variable and only partially documented.</p>
          147  +
          148  +<p>When the EXPLAIN keyword appears by itself it causes the statement
          149  +to behave as a query that returns the sequence of 
          150  +<a href="opcode.html">virtual machine instructions</a> it would have used to execute the command had
          151  +the EXPLAIN keyword not been present. When the EXPLAIN QUERY PLAN phrase
          152  +appears, the statement returns high-level information regarding the query
          153  +plan that would have been used.
          154  +
          155  +The EXPLAIN QUERY PLAN command is described in 
          156  +<a href="eqp.html">more detail here</a>.
          157  +
          158  +

Changes to Doc/Extra/Core/lang_expr.html.

     1         -<html dir="LTR" xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:ndoc="urn:ndoc-preprocess">
     2         -  <head>
     3         -    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
     4         -    <title>expression</title>
     5         -    <link rel="stylesheet" type="text/css" href="../Include/ndoc.css" />
     6         -    <style type="text/css">
     7         -      .style1
     8         -      {
     9         -        height: 70px;
    10         -      }
    11         -    </style>
    12         -  </head>
    13         -  <body>
    14         -    <div id="header">
    15         -      <table width="100%" id="topTable">
    16         -        <tr id="headerTableRow1">
    17         -          <td align="left">
    18         -            <span id="runningHeaderText">expression</span>&nbsp;</td>
    19         -        </tr>
    20         -        <tr id="headerTableRow2">
    21         -          <td align="left">
    22         -            <span id="nsrTitle">SQLite Language Reference Documentation</span>
    23         -          </td>
    24         -        </tr>
    25         -        <tr id="headerTableRow3" style="display:none">
    26         -          <td>
    27         -            <a id="seeAlsoSectionLink" href="#seeAlsoToggle" onclick="OpenSection(seeAlsoToggle)">See Also</a>
    28         -            <a id="exampleSectionLink" href="#codeExampleToggle" onclick="OpenSection(codeExampleToggle)">Example</a>
    29         -          </td>
    30         -        </tr>
    31         -     </table>
    32         -      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0" style="display:none">
    33         -        <tr>
    34         -          <td>
    35         -            <span onclick="ExpandCollapseAll(toggleAllImage)" style="cursor:default;" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0">
    36         -              <img ID="toggleAllImage" class="toggleAll" src="collall.gif" />
    37         -              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">
    38         -							Collapse All
    39         -						</label>
    40         -              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">
    41         -							Expand All
    42         -						</label>
    43         -            </span>
    44         -          </td>
    45         -        </tr>
    46         -      </table>
            1  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
            2  +<html><head>
            3  +<meta http-equiv="content-type" content="text/html; charset=UTF-8">
            4  +<title>SQLite Query Language: expression</title>
            5  +<style type="text/css">
            6  +body {
            7  +    margin: auto;
            8  +    font-family: Verdana, sans-serif;
            9  +    padding: 8px 1%;
           10  +}
           11  +
           12  +a { color: #044a64 }
           13  +a:visited { color: #734559 }
           14  +
           15  +.logo { position:absolute; margin:3px; }
           16  +.tagline {
           17  +  float:right;
           18  +  text-align:right;
           19  +  font-style:italic;
           20  +  width:300px;
           21  +  margin:12px;
           22  +  margin-top:58px;
           23  +}
           24  +
           25  +.menubar {
           26  +  clear: both;
           27  +  border-radius: 8px;
           28  +  background: #044a64;
           29  +  padding: 0px;
           30  +  margin: 0px;
           31  +  cell-spacing: 0px;
           32  +}    
           33  +.toolbar {
           34  +  text-align: center;
           35  +  line-height: 1.6em;
           36  +  margin: 0;
           37  +  padding: 0px 8px;
           38  +}
           39  +.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
           40  +.toolbar a:visited { color: white; }
           41  +.toolbar a:hover { color: #044a64; background: white; }
           42  +
           43  +.content    { margin: 5%; }
           44  +.content dt { font-weight:bold; }
           45  +.content dd { margin-bottom: 25px; margin-left:20%; }
           46  +.content ul { padding:0px; padding-left: 15px; margin:0px; }
           47  +
           48  +/* Things for "fancyformat" documents start here. */
           49  +.fancy img+p {font-style:italic}
           50  +.fancy .codeblock i { color: darkblue; }
           51  +.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
           52  +.fancy h2 { margin-left: 10px }
           53  +.fancy h3 { margin-left: 20px }
           54  +.fancy h4 { margin-left: 30px }
           55  +.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
           56  +.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
           57  +.fancy #toc a        { color: darkblue ; text-decoration: none }
           58  +.fancy .todo         { color: #AA3333 ; font-style : italic }
           59  +.fancy .todo:before  { content: 'TODO:' }
           60  +.fancy p.todo        { border: solid #AA3333 1px; padding: 1ex }
           61  +.fancy img { display:block; }
           62  +.fancy :link:hover, .fancy :visited:hover { background: wheat }
           63  +.fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
           64  +.fancy li p { margin: 1em 0 }
           65  +/* End of "fancyformat" specific rules. */
           66  +
           67  +</style>
           68  +  
           69  +</head>
           70  +<body>
           71  +<div><!-- container div to satisfy validator -->
           72  +
           73  +<a href="index.html">
           74  +<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
           75  + border="0"></a>
           76  +<div><!-- IE hack to prevent disappearing logo--></div>
           77  +<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
           78  +
           79  +<table width=100% class="menubar"><tr>
           80  +  <td width=100%>
           81  +  <div class="toolbar">
           82  +    <a href="about.html">About</a>
           83  +    <a href="sitemap.html">Sitemap</a>
           84  +    <a href="docs.html">Documentation</a>
           85  +    <a href="download.html">Download</a>
           86  +    <a href="copyright.html">License</a>
           87  +    <a href="news.html">News</a>
           88  +    <a href="support.html">Support</a>
           89  +  </div>
           90  +<script>
           91  +  gMsg = "Search SQLite Docs..."
           92  +  function entersearch() {
           93  +    var q = document.getElementById("q");
           94  +    if( q.value == gMsg ) { q.value = "" }
           95  +    q.style.color = "black"
           96  +    q.style.fontStyle = "normal"
           97  +  }
           98  +  function leavesearch() {
           99  +    var q = document.getElementById("q");
          100  +    if( q.value == "" ) { 
          101  +      q.value = gMsg
          102  +      q.style.color = "#044a64"
          103  +      q.style.fontStyle = "italic"
          104  +    }
          105  +  }
          106  +  function hideorshow(btn,obj){
          107  +    var x = document.getElementById(obj);
          108  +    var b = document.getElementById(btn);
          109  +    if( x.style.display!='none' ){
          110  +      x.style.display = 'none';
          111  +      b.innerHTML='show';
          112  +    }else{
          113  +      x.style.display = '';
          114  +      b.innerHTML='hide';
          115  +    }
          116  +    return false;
          117  +  }
          118  +</script>
          119  +<td>
          120  +    <div style="padding:0 1em 0px 0;white-space:nowrap">
          121  +    <form name=f method="GET" action="http://www.sqlite.org/search">
          122  +      <input id=q name=q type=text
          123  +       onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
          124  +      <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
          125  +    </form>
    47    126       </div>
    48         -    <div id="mainSection">
    49         -    <div id="mainBody">
    50         -      <h1 class="heading">
    51         -        SQL As Understood By SQLite</h1>
    52         -      <h4>
    53         -        expression</h4>
    54         -      <p>
    55         -        <table cellpadding="10">
    56         -          <tr>
    57         -            <td align="right" width="1%" nowrap>
    58         -              <i><font color="#ff3434">expr</font></i> ::=</td>
    59         -            <td>
    60         -              <b><font color="#2c2cf0"></font></b><i><font color="#ff3434">expr</font></i><b><font
    61         -                color="#2c2cf0"> </font></b><i><font color="#ff3434">binary-op</font></i><b><font
    62         -                  color="#2c2cf0"> </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0">
    63         -                  </font></b><big>|</big><b><font color="#2c2cf0"><br />
    64         -                  </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font>
    65         -                  </b>[<b><font color="#2c2cf0">NOT</font></b>]<b><font color="#2c2cf0"> </font></b>
    66         -              <i><font color="#ff3434">like-op</font></i><b><font color="#2c2cf0"> </font></b>
    67         -              <i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font></b>[<b><font
    68         -                color="#2c2cf0">ESCAPE </font></b><i><font color="#ff3434">expr</font></i><b><font
    69         -                  color="#2c2cf0"></font></b>]<b><font color="#2c2cf0"> </font></b><big>|</big><b><font
    70         -                    color="#2c2cf0"><br />
    71         -                  </font></b><i><font color="#ff3434">unary-op</font></i><b><font color="#2c2cf0"> </font>
    72         -                  </b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font></b>
    73         -              <big>|</big><b><font color="#2c2cf0"><br />
    74         -                <big>(</big> </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0">
    75         -                  <big>)</big> </font></b><big>|</big><b><font color="#2c2cf0"><br />
    76         -                  </font></b><i><font color="#ff3434">column-name</font></i><b><font color="#2c2cf0">
    77         -                  </font></b><big>|</big><b><font color="#2c2cf0"><br />
    78         -                  </font></b><i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0">
    79         -                    <big>.</big> </font></b><i><font color="#ff3434">column-name</font></i><b><font color="#2c2cf0">
    80         -                    </font></b><big>|</big><b><font color="#2c2cf0"><br />
    81         -                    </font></b><i><font color="#ff3434">database-name</font></i><b><font color="#2c2cf0">
    82         -                      <big>.</big> </font></b><i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0">
    83         -                        <big>.</big> </font></b><i><font color="#ff3434">column-name</font></i><b><font color="#2c2cf0">
    84         -                        </font></b><big>|</big><b><font color="#2c2cf0"><br />
    85         -                        </font></b><i><font color="#ff3434">literal-value</font></i><b><font color="#2c2cf0">
    86         -                        </font></b><big>|</big><b><font color="#2c2cf0"><br />
    87         -                        </font></b><i><font color="#ff3434">parameter</font></i><b><font color="#2c2cf0">
    88         -                        </font></b><big>|</big><b><font color="#2c2cf0"><br />
    89         -                        </font></b><i><font color="#ff3434">function-name</font></i><b><font color="#2c2cf0">
    90         -                          <big>(</big> </font></b><i><font color="#ff3434">expr-list</font></i><b><font color="#2c2cf0">
    91         -                          </font></b><big>|</big><b><font color="#2c2cf0"> <big>*</big> <big>)</big> </font>
    92         -                          </b><big>|</big><b><font color="#2c2cf0"><br />
    93         -                          </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> ISNULL
    94         -                          </font></b><big>|</big><b><font color="#2c2cf0"><br />
    95         -                          </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> NOTNULL
    96         -                          </font></b><big>|</big><b><font color="#2c2cf0"><br />
    97         -                          </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font>
    98         -                          </b>[<b><font color="#2c2cf0">NOT</font></b>]<b><font color="#2c2cf0"> BETWEEN </font>
    99         -                          </b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> AND </font></b>
   100         -              <i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font></b><big>
   101         -                |</big><b><font color="#2c2cf0"><br />
   102         -                </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font>
   103         -                </b>[<b><font color="#2c2cf0">NOT</font></b>]<b><font color="#2c2cf0"> IN <big>(</big>
   104         -                </font></b><i><font color="#ff3434">value-list</font></i><b><font color="#2c2cf0">
   105         -                  <big>)</big> </font></b><big>|</big><b><font color="#2c2cf0"><br />
   106         -                  </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font>
   107         -                  </b>[<b><font color="#2c2cf0">NOT</font></b>]<b><font color="#2c2cf0"> IN <big>(</big>
   108         -                  </font></b><i><font color="#ff3434">select-statement</font></i><b><font color="#2c2cf0">
   109         -                    <big>)</big> </font></b><big>|</big><b><font color="#2c2cf0"><br />
   110         -                    </font></b><i><font color="#ff3434">expr</font></i><b><font color="#2c2cf0"> </font>
   111         -                    </b>[<b><font color="#2c2cf0">NOT</font></b>]<b><font color="#2c2cf0"> IN </font></b>
   112         -              [<b><font color="#2c2cf0"></font></b><i><font color="#ff3434">database-name</font></i><b><font
   113         -                color="#2c2cf0"> <big>.</big></font></b>]<b><font color="#2c2cf0"> </font></b>
   114         -              <i><font color="#ff3434">table-name</font></i><b><font color="#2c2cf0"> </font></b>
   115         -              <big>|</big><b><font color="#2c2cf0"><br />
   116         -              </font></b>[<b><font color="#2c2cf0">EXISTS</font></b>]<b><font color="#2c2cf0"> <big>