| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 4 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 |
<link href="sqlite.css" rel="stylesheet"> |
| 6 |
<title>SQLite Keywords</title> |
| 7 |
<!-- path= --> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
<div class=nosearch> |
| 11 |
<a href="index.html"> |
| 12 |
<img class="logo" src="images/sqlite370_banner.svg" alt="SQLite" border="0"> |
| 13 |
</a> |
| 14 |
<div><!-- IE hack to prevent disappearing logo --></div> |
| 15 |
<div class="tagline desktoponly"> |
| 16 |
Small. Fast. Reliable.<br>Choose any three. |
| 17 |
</div> |
| 18 |
<div class="menu mainmenu"> |
| 19 |
<ul> |
| 20 |
<li><a href="index.html">Home</a> |
| 21 |
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a> |
| 22 |
<li class='wideonly'><a href='about.html'>About</a> |
| 23 |
<li class='desktoponly'><a href="docs.html">Documentation</a> |
| 24 |
<li class='desktoponly'><a href="download.html">Download</a> |
| 25 |
<li class='wideonly'><a href='copyright.html'>License</a> |
| 26 |
<li class='desktoponly'><a href="support.html">Support</a> |
| 27 |
<li class='desktoponly'><a href="prosupport.html">Purchase</a> |
| 28 |
<li class='search' id='search_menubutton'> |
| 29 |
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a> |
| 30 |
</ul> |
| 31 |
</div> |
| 32 |
<div class="menu submenu" id="submenu"> |
| 33 |
<ul> |
| 34 |
<li><a href='about.html'>About</a> |
| 35 |
<li><a href='docs.html'>Documentation</a> |
| 36 |
<li><a href='download.html'>Download</a> |
| 37 |
<li><a href='support.html'>Support</a> |
| 38 |
<li><a href='prosupport.html'>Purchase</a> |
| 39 |
</ul> |
| 40 |
</div> |
| 41 |
<div class="searchmenu" id="searchmenu"> |
| 42 |
<form method="GET" action="search"> |
| 43 |
<select name="s" id="searchtype"> |
| 44 |
<option value="d">Search Documentation</option> |
| 45 |
<option value="c">Search Changelog</option> |
| 46 |
</select> |
| 47 |
<input type="text" name="q" id="searchbox" value=""> |
| 48 |
<input type="submit" value="Go"> |
| 49 |
</form> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<script> |
| 53 |
function toggle_div(nm) { |
| 54 |
var w = document.getElementById(nm); |
| 55 |
if( w.style.display=="block" ){ |
| 56 |
w.style.display = "none"; |
| 57 |
}else{ |
| 58 |
w.style.display = "block"; |
| 59 |
} |
| 60 |
} |
| 61 |
function toggle_search() { |
| 62 |
var w = document.getElementById("searchmenu"); |
| 63 |
if( w.style.display=="block" ){ |
| 64 |
w.style.display = "none"; |
| 65 |
} else { |
| 66 |
w.style.display = "block"; |
| 67 |
setTimeout(function(){ |
| 68 |
document.getElementById("searchbox").focus() |
| 69 |
}, 30); |
| 70 |
} |
| 71 |
} |
| 72 |
function div_off(nm){document.getElementById(nm).style.display="none";} |
| 73 |
window.onbeforeunload = function(e){div_off("submenu");} |
| 74 |
/* Disable the Search feature if we are not operating from CGI, since */ |
| 75 |
/* Search is accomplished using CGI and will not work without it. */ |
| 76 |
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){ |
| 77 |
document.getElementById("search_menubutton").style.display = "none"; |
| 78 |
} |
| 79 |
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */ |
| 80 |
function hideorshow(btn,obj){ |
| 81 |
var x = document.getElementById(obj); |
| 82 |
var b = document.getElementById(btn); |
| 83 |
if( x.style.display!='none' ){ |
| 84 |
x.style.display = 'none'; |
| 85 |
b.innerHTML='show'; |
| 86 |
}else{ |
| 87 |
x.style.display = ''; |
| 88 |
b.innerHTML='hide'; |
| 89 |
} |
| 90 |
return false; |
| 91 |
} |
| 92 |
var antiRobot = 0; |
| 93 |
function antiRobotGo(){ |
| 94 |
if( antiRobot!=3 ) return; |
| 95 |
antiRobot = 7; |
| 96 |
var j = document.getElementById("mtimelink"); |
| 97 |
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 98 |
} |
| 99 |
function antiRobotDefense(){ |
| 100 |
document.body.onmousedown=function(){ |
| 101 |
antiRobot |= 2; |
| 102 |
antiRobotGo(); |
| 103 |
document.body.onmousedown=null; |
| 104 |
} |
| 105 |
document.body.onmousemove=function(){ |
| 106 |
antiRobot |= 2; |
| 107 |
antiRobotGo(); |
| 108 |
document.body.onmousemove=null; |
| 109 |
} |
| 110 |
setTimeout(function(){ |
| 111 |
antiRobot |= 1; |
| 112 |
antiRobotGo(); |
| 113 |
}, 100) |
| 114 |
antiRobotGo(); |
| 115 |
} |
| 116 |
antiRobotDefense(); |
| 117 |
</script> |
| 118 |
<div class=fancy> |
| 119 |
<div class=nosearch> |
| 120 |
<div class="fancy_title"> |
| 121 |
SQLite Keywords |
| 122 |
</div> |
| 123 |
</div> |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
<p>The SQL standard specifies a large number of keywords which may not |
| 130 |
be used as the names of tables, indices, columns, databases, user-defined |
| 131 |
functions, collations, virtual table modules, or any other named object. |
| 132 |
The list of keywords is so long that few people can remember them all. |
| 133 |
For most SQL code, your safest bet is to never use any English language |
| 134 |
word as the name of a user-defined object.</p> |
| 135 |
|
| 136 |
<p>If you want to use a keyword as a name, you need to quote it. There |
| 137 |
are four ways of quoting keywords in SQLite:</p> |
| 138 |
|
| 139 |
<p> |
| 140 |
</p><blockquote> |
| 141 |
<table> |
| 142 |
<tr> <td valign="top"><b>'keyword'</b></td><td width="20"></td> |
| 143 |
<td>A keyword in single quotes is a string literal.</td></tr> |
| 144 |
|
| 145 |
<tr> <td valign="top"><b>"keyword"</b></td><td></td> |
| 146 |
<td>A keyword in double-quotes is an identifier.</td></tr> |
| 147 |
|
| 148 |
<tr> <td valign="top"><b>[keyword]</b></td><td></td> |
| 149 |
<td>A keyword enclosed in square brackets is |
| 150 |
an identifier. This is not standard SQL. This quoting mechanism |
| 151 |
is used by MS Access and SQL Server and is included in SQLite for |
| 152 |
compatibility.</td></tr> |
| 153 |
|
| 154 |
<tr> <td valign="top"><b>`keyword`</b></td><td></td> |
| 155 |
<td>A keyword enclosed in grave accents (ASCII code 96) is |
| 156 |
an identifier. This is not standard SQL. This quoting mechanism |
| 157 |
is used by MySQL and is included in SQLite for |
| 158 |
compatibility.</td></tr> |
| 159 |
</table> |
| 160 |
</blockquote> |
| 161 |
|
| 162 |
|
| 163 |
<p>For resilience when confronted with historical SQL statements, SQLite |
| 164 |
will sometimes bend the quoting rules above:</p> |
| 165 |
|
| 166 |
<ul> |
| 167 |
<li><p>If a keyword in single |
| 168 |
quotes (ex: <b>'key'</b> or <b>'glob'</b>) is used in a context where |
| 169 |
an identifier is allowed but where a string literal is not allowed, then |
| 170 |
the token is understood to be an identifier instead of a string literal. |
| 171 |
</p></li> |
| 172 |
|
| 173 |
<li><p>If a keyword in double |
| 174 |
quotes (ex: <b>"key"</b> or <b>"glob"</b>) is used in a context where |
| 175 |
it cannot be resolved to an identifier but where a string literal |
| 176 |
is allowed, then the token is understood to be a string literal instead |
| 177 |
of an identifier.</p></li> |
| 178 |
</ul> |
| 179 |
|
| 180 |
<p>Programmers are cautioned not to use the two exceptions described in |
| 181 |
the previous bullets. We emphasize that they exist only so that old |
| 182 |
and ill-formed SQL statements will run correctly. Future versions of |
| 183 |
SQLite might raise errors instead of accepting the malformed |
| 184 |
statements covered by the exceptions above.</p> |
| 185 |
|
| 186 |
<p> |
| 187 |
SQLite adds new keywords from time to time when it takes on new features. |
| 188 |
So to prevent your code from being broken by future enhancements, you should |
| 189 |
normally quote any identifier that is an English language word, even if |
| 190 |
you do not have to. |
| 191 |
</p> |
| 192 |
|
| 193 |
<p> |
| 194 |
The list below shows all possible keywords used by any build of |
| 195 |
SQLite regardless of <a href="compile.html">compile-time options</a>. |
| 196 |
Most reasonable configurations use most or all of these keywords, |
| 197 |
but some keywords may be omitted when SQL language features are |
| 198 |
disabled. |
| 199 |
Applications can use the |
| 200 |
<a href="c3ref/keyword_check.html">sqlite3_keyword_count()</a>, <a href="c3ref/keyword_check.html">sqlite3_keyword_name()</a>, and |
| 201 |
<a href="c3ref/keyword_check.html">sqlite3_keyword_check()</a> interfaces to determine the keywords |
| 202 |
recognized by SQLite at run-time. |
| 203 |
Regardless of the compile-time configuration, any identifier that is not on |
| 204 |
the following 147-element |
| 205 |
|
| 206 |
list is not a keyword to the SQL parser in SQLite: |
| 207 |
</p> |
| 208 |
|
| 209 |
<div class="columns" style="columns:11em auto;"> |
| 210 |
<ul style="padding-top:0;"> |
| 211 |
<li>ABORT</li> |
| 212 |
<li>ACTION</li> |
| 213 |
<li>ADD</li> |
| 214 |
<li>AFTER</li> |
| 215 |
<li>ALL</li> |
| 216 |
<li>ALTER</li> |
| 217 |
<li>ALWAYS</li> |
| 218 |
<li>ANALYZE</li> |
| 219 |
<li>AND</li> |
| 220 |
<li>AS</li> |
| 221 |
<li>ASC</li> |
| 222 |
<li>ATTACH</li> |
| 223 |
<li>AUTOINCREMENT</li> |
| 224 |
<li>BEFORE</li> |
| 225 |
<li>BEGIN</li> |
| 226 |
<li>BETWEEN</li> |
| 227 |
<li>BY</li> |
| 228 |
<li>CASCADE</li> |
| 229 |
<li>CASE</li> |
| 230 |
<li>CAST</li> |
| 231 |
<li>CHECK</li> |
| 232 |
<li>COLLATE</li> |
| 233 |
<li>COLUMN</li> |
| 234 |
<li>COMMIT</li> |
| 235 |
<li>CONFLICT</li> |
| 236 |
<li>CONSTRAINT</li> |
| 237 |
<li>CREATE</li> |
| 238 |
<li>CROSS</li> |
| 239 |
<li>CURRENT</li> |
| 240 |
<li>CURRENT_DATE</li> |
| 241 |
<li>CURRENT_TIME</li> |
| 242 |
<li>CURRENT_TIMESTAMP</li> |
| 243 |
<li>DATABASE</li> |
| 244 |
<li>DEFAULT</li> |
| 245 |
<li>DEFERRABLE</li> |
| 246 |
<li>DEFERRED</li> |
| 247 |
<li>DELETE</li> |
| 248 |
<li>DESC</li> |
| 249 |
<li>DETACH</li> |
| 250 |
<li>DISTINCT</li> |
| 251 |
<li>DO</li> |
| 252 |
<li>DROP</li> |
| 253 |
<li>EACH</li> |
| 254 |
<li>ELSE</li> |
| 255 |
<li>END</li> |
| 256 |
<li>ESCAPE</li> |
| 257 |
<li>EXCEPT</li> |
| 258 |
<li>EXCLUDE</li> |
| 259 |
<li>EXCLUSIVE</li> |
| 260 |
<li>EXISTS</li> |
| 261 |
<li>EXPLAIN</li> |
| 262 |
<li>FAIL</li> |
| 263 |
<li>FILTER</li> |
| 264 |
<li>FIRST</li> |
| 265 |
<li>FOLLOWING</li> |
| 266 |
<li>FOR</li> |
| 267 |
<li>FOREIGN</li> |
| 268 |
<li>FROM</li> |
| 269 |
<li>FULL</li> |
| 270 |
<li>GENERATED</li> |
| 271 |
<li>GLOB</li> |
| 272 |
<li>GROUP</li> |
| 273 |
<li>GROUPS</li> |
| 274 |
<li>HAVING</li> |
| 275 |
<li>IF</li> |
| 276 |
<li>IGNORE</li> |
| 277 |
<li>IMMEDIATE</li> |
| 278 |
<li>IN</li> |
| 279 |
<li>INDEX</li> |
| 280 |
<li>INDEXED</li> |
| 281 |
<li>INITIALLY</li> |
| 282 |
<li>INNER</li> |
| 283 |
<li>INSERT</li> |
| 284 |
<li>INSTEAD</li> |
| 285 |
<li>INTERSECT</li> |
| 286 |
<li>INTO</li> |
| 287 |
<li>IS</li> |
| 288 |
<li>ISNULL</li> |
| 289 |
<li>JOIN</li> |
| 290 |
<li>KEY</li> |
| 291 |
<li>LAST</li> |
| 292 |
<li>LEFT</li> |
| 293 |
<li>LIKE</li> |
| 294 |
<li>LIMIT</li> |
| 295 |
<li>MATCH</li> |
| 296 |
<li>MATERIALIZED</li> |
| 297 |
<li>NATURAL</li> |
| 298 |
<li>NO</li> |
| 299 |
<li>NOT</li> |
| 300 |
<li>NOTHING</li> |
| 301 |
<li>NOTNULL</li> |
| 302 |
<li>NULL</li> |
| 303 |
<li>NULLS</li> |
| 304 |
<li>OF</li> |
| 305 |
<li>OFFSET</li> |
| 306 |
<li>ON</li> |
| 307 |
<li>OR</li> |
| 308 |
<li>ORDER</li> |
| 309 |
<li>OTHERS</li> |
| 310 |
<li>OUTER</li> |
| 311 |
<li>OVER</li> |
| 312 |
<li>PARTITION</li> |
| 313 |
<li>PLAN</li> |
| 314 |
<li>PRAGMA</li> |
| 315 |
<li>PRECEDING</li> |
| 316 |
<li>PRIMARY</li> |
| 317 |
<li>QUERY</li> |
| 318 |
<li>RAISE</li> |
| 319 |
<li>RANGE</li> |
| 320 |
<li>RECURSIVE</li> |
| 321 |
<li>REFERENCES</li> |
| 322 |
<li>REGEXP</li> |
| 323 |
<li>REINDEX</li> |
| 324 |
<li>RELEASE</li> |
| 325 |
<li>RENAME</li> |
| 326 |
<li>REPLACE</li> |
| 327 |
<li>RESTRICT</li> |
| 328 |
<li>RETURNING</li> |
| 329 |
<li>RIGHT</li> |
| 330 |
<li>ROLLBACK</li> |
| 331 |
<li>ROW</li> |
| 332 |
<li>ROWS</li> |
| 333 |
<li>SAVEPOINT</li> |
| 334 |
<li>SELECT</li> |
| 335 |
<li>SET</li> |
| 336 |
<li>TABLE</li> |
| 337 |
<li>TEMP</li> |
| 338 |
<li>TEMPORARY</li> |
| 339 |
<li>THEN</li> |
| 340 |
<li>TIES</li> |
| 341 |
<li>TO</li> |
| 342 |
<li>TRANSACTION</li> |
| 343 |
<li>TRIGGER</li> |
| 344 |
<li>UNBOUNDED</li> |
| 345 |
<li>UNION</li> |
| 346 |
<li>UNIQUE</li> |
| 347 |
<li>UPDATE</li> |
| 348 |
<li>USING</li> |
| 349 |
<li>VACUUM</li> |
| 350 |
<li>VALUES</li> |
| 351 |
<li>VIEW</li> |
| 352 |
<li>VIRTUAL</li> |
| 353 |
<li>WHEN</li> |
| 354 |
<li>WHERE</li> |
| 355 |
<li>WINDOW</li> |
| 356 |
<li>WITH</li> |
| 357 |
<li>WITHOUT</li> |
| 358 |
</ul></div> |
| 359 |
|
| 360 |
</ul></div><p align="center"><small><i>This page was last updated on 2022-11-26 14:56:19Z </small></i></p> |
| 361 |
|