PageRenderTime 39ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/sqlite-src-3071300/sqlite-doc-3071300/lang_keywords.html

#
HTML | 323 lines | 297 code | 26 blank | 0 comment | 0 complexity | 8aa48d9d1856d8a1c23ced5171a95ff0 MD5 | raw file
  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: SQLite Keywords</title>
  5. <style type="text/css">
  6. body {
  7. margin: auto;
  8. font-family: Verdana, sans-serif;
  9. padding: 8px 1%;
  10. }
  11. a { color: #044a64 }
  12. a:visited { color: #734559 }
  13. .logo { position:absolute; margin:3px; }
  14. .tagline {
  15. float:right;
  16. text-align:right;
  17. font-style:italic;
  18. width:300px;
  19. margin:12px;
  20. margin-top:58px;
  21. }
  22. .toolbar {
  23. text-align: center;
  24. line-height: 1.6em;
  25. margin: 0;
  26. padding: 0px 8px;
  27. }
  28. .toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
  29. .toolbar a:visited { color: white; }
  30. .toolbar a:hover { color: #044a64; background: white; }
  31. .content { margin: 5%; }
  32. .content dt { font-weight:bold; }
  33. .content dd { margin-bottom: 25px; margin-left:20%; }
  34. .content ul { padding:0px; padding-left: 15px; margin:0px; }
  35. /* rounded corners */
  36. .se { background: url(images/se.gif) 100% 100% no-repeat #044a64}
  37. .sw { background: url(images/sw.gif) 0% 100% no-repeat }
  38. .ne { background: url(images/ne.gif) 100% 0% no-repeat }
  39. .nw { background: url(images/nw.gif) 0% 0% no-repeat }
  40. /* Things for "fancyformat" documents start here. */
  41. .fancy img+p {font-style:italic}
  42. .fancy .codeblock i { color: darkblue; }
  43. .fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
  44. .fancy h2 { margin-left: 10px }
  45. .fancy h3 { margin-left: 20px }
  46. .fancy h4 { margin-left: 30px }
  47. .fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
  48. .fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
  49. .fancy #toc a { color: darkblue ; text-decoration: none }
  50. .fancy .todo { color: #AA3333 ; font-style : italic }
  51. .fancy .todo:before { content: 'TODO:' }
  52. .fancy p.todo { border: solid #AA3333 1px; padding: 1ex }
  53. .fancy img { display:block; }
  54. .fancy :link:hover, .fancy :visited:hover { background: wheat }
  55. .fancy p,.fancy ul,.fancy ol { margin: 1em 5ex }
  56. .fancy li p { margin: 1em 0 }
  57. /* End of "fancyformat" specific rules. */
  58. </style>
  59. </head>
  60. <body>
  61. <div><!-- container div to satisfy validator -->
  62. <a href="index.html">
  63. <img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
  64. border="0"></a>
  65. <div><!-- IE hack to prevent disappearing logo--></div>
  66. <div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
  67. <table width=100% style="clear:both"><tr><td>
  68. <div class="se"><div class="sw"><div class="ne"><div class="nw">
  69. <table width=100% style="padding:0;margin:0;cell-spacing:0"><tr>
  70. <td width=100%>
  71. <div class="toolbar">
  72. <a href="about.html">About</a>
  73. <a href="sitemap.html">Sitemap</a>
  74. <a href="docs.html">Documentation</a>
  75. <a href="download.html">Download</a>
  76. <a href="copyright.html">License</a>
  77. <a href="news.html">News</a>
  78. <a href="support.html">Support</a>
  79. </div>
  80. <script>
  81. gMsg = "Search SQLite Docs..."
  82. function entersearch() {
  83. var q = document.getElementById("q");
  84. if( q.value == gMsg ) { q.value = "" }
  85. q.style.color = "black"
  86. q.style.fontStyle = "normal"
  87. }
  88. function leavesearch() {
  89. var q = document.getElementById("q");
  90. if( q.value == "" ) {
  91. q.value = gMsg
  92. q.style.color = "#044a64"
  93. q.style.fontStyle = "italic"
  94. }
  95. }
  96. </script>
  97. <td>
  98. <div style="padding:0 1em 0px 0;white-space:nowrap">
  99. <form name=f method="GET" action="http://www.sqlite.org/search">
  100. <input id=q name=q type=text
  101. 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...">
  102. <input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
  103. </form>
  104. </div>
  105. </table>
  106. </div></div></div></div>
  107. </td></tr></table>
  108. <div class=startsearch></div>
  109. <h1 align="center">SQL As Understood By SQLite</h1><p><a href="lang.html">[Top]</a></p><h2>SQLite Keywords</h2></DIV>
  110. <p>The SQL standard specifies a huge number of keywords which may not
  111. be used as the names of tables, indices, columns, databases, user-defined
  112. functions, collations, virtual table modules, or any other named object.
  113. The list of keywords is so long that few people can remember them all.
  114. For most SQL code, your safest bet is to never use any English language
  115. word as the name of a user-defined object.</p>
  116. <p>If you want to use a keyword as a name, you need to quote it. There
  117. are four ways of quoting keywords in SQLite:</p>
  118. <p>
  119. <blockquote>
  120. <table>
  121. <tr> <td valign="top"><b>'keyword'</b></td><td width="20"></td>
  122. <td>A keyword in single quotes is a string literal.</td></tr>
  123. <tr> <td valign="top"><b>"keyword"</b></td><td></td>
  124. <td>A keyword in double-quotes is an identifier.</td></tr>
  125. <tr> <td valign="top"><b>&#91;keyword&#93;</b></td><td></td>
  126. <td>A keyword enclosed in square brackets is
  127. an identifier. This is not standard SQL. This quoting mechanism
  128. is used by MS Access and SQL Server and is included in SQLite for
  129. compatibility.</td></tr>
  130. <tr> <td valign="top"><b>&#96;keyword&#96;</b></td><td></td>
  131. <td>A keyword enclosed in grave accents (ASCII code 96) is
  132. an identifier. This is not standard SQL. This quoting mechanism
  133. is used by MySQL and is included in SQLite for
  134. compatibility.</td></tr>
  135. </table>
  136. </blockquote>
  137. </p>
  138. <p>For resilience when confronted with historical SQL statements, SQLite
  139. will sometimes bend the quoting rules above:</p>
  140. <ul>
  141. <li><p>If a keyword in single
  142. quotes (ex: <b>'key'</b> or <b>'glob'</b>) is used in a context where
  143. an identifier is allowed but where a string literal is not allowed, then
  144. the token is understood to be an identifier instead of a string literal.
  145. </p></li>
  146. <li><p>If a keyword in double
  147. quotes (ex: <b>"key"</b> or <b>"glob"</b>) is used in a context where
  148. it cannot be resolved to an identifier but where a string literal
  149. is allowed, then the token is understood to be a string literal instead
  150. of an identifier.</p></li>
  151. </ul>
  152. <p>Programmers are cautioned not to use the two exceptions described in
  153. the previous bullets. We emphasize that they exist only so that old
  154. and ill-formed SQL statements will run correctly. Future versions of
  155. SQLite might change to raise errors instead of accepting the malformed
  156. statements covered by the exceptions above.</p>
  157. <p>
  158. SQLite adds new keywords from time to time when it takes on new features.
  159. So to prevent your code from being broken by future enhancements, you should
  160. normally quote any identifier that is an English language word, even if
  161. you do not have to.
  162. </p>
  163. <p>
  164. The list below shows all possible keywords used by any build of
  165. SQLite regardless of <a href="compile.html">compile-time options</a>.
  166. Most reasonable configurations use most or all of these keywords,
  167. but some keywords may be omitted when SQL language features are
  168. disabled.
  169. Regardless of the compile-time configuration, any identifier that is not on
  170. the following 121 element
  171. list is not a keyword to the SQL parser in SQLite:
  172. </p>
  173. <blockquote>
  174. <table width="100%"><tr>
  175. <td align="left" valign="top" width="20%">
  176. ABORT<br>
  177. ACTION<br>
  178. ADD<br>
  179. AFTER<br>
  180. ALL<br>
  181. ALTER<br>
  182. ANALYZE<br>
  183. AND<br>
  184. AS<br>
  185. ASC<br>
  186. ATTACH<br>
  187. AUTOINCREMENT<br>
  188. BEFORE<br>
  189. BEGIN<br>
  190. BETWEEN<br>
  191. BY<br>
  192. CASCADE<br>
  193. CASE<br>
  194. CAST<br>
  195. CHECK<br>
  196. COLLATE<br>
  197. COLUMN<br>
  198. COMMIT<br>
  199. CONFLICT<br>
  200. CONSTRAINT<br>
  201. </td><td valign="top" align="left" width="20%">CREATE<br>
  202. CROSS<br>
  203. CURRENT_DATE<br>
  204. CURRENT_TIME<br>
  205. CURRENT_TIMESTAMP<br>
  206. DATABASE<br>
  207. DEFAULT<br>
  208. DEFERRABLE<br>
  209. DEFERRED<br>
  210. DELETE<br>
  211. DESC<br>
  212. DETACH<br>
  213. DISTINCT<br>
  214. DROP<br>
  215. EACH<br>
  216. ELSE<br>
  217. END<br>
  218. ESCAPE<br>
  219. EXCEPT<br>
  220. EXCLUSIVE<br>
  221. EXISTS<br>
  222. EXPLAIN<br>
  223. FAIL<br>
  224. FOR<br>
  225. FOREIGN<br>
  226. </td><td valign="top" align="left" width="20%">FROM<br>
  227. FULL<br>
  228. GLOB<br>
  229. GROUP<br>
  230. HAVING<br>
  231. IF<br>
  232. IGNORE<br>
  233. IMMEDIATE<br>
  234. IN<br>
  235. INDEX<br>
  236. INDEXED<br>
  237. INITIALLY<br>
  238. INNER<br>
  239. INSERT<br>
  240. INSTEAD<br>
  241. INTERSECT<br>
  242. INTO<br>
  243. IS<br>
  244. ISNULL<br>
  245. JOIN<br>
  246. KEY<br>
  247. LEFT<br>
  248. LIKE<br>
  249. LIMIT<br>
  250. MATCH<br>
  251. </td><td valign="top" align="left" width="20%">NATURAL<br>
  252. NO<br>
  253. NOT<br>
  254. NOTNULL<br>
  255. NULL<br>
  256. OF<br>
  257. OFFSET<br>
  258. ON<br>
  259. OR<br>
  260. ORDER<br>
  261. OUTER<br>
  262. PLAN<br>
  263. PRAGMA<br>
  264. PRIMARY<br>
  265. QUERY<br>
  266. RAISE<br>
  267. REFERENCES<br>
  268. REGEXP<br>
  269. REINDEX<br>
  270. RELEASE<br>
  271. RENAME<br>
  272. REPLACE<br>
  273. RESTRICT<br>
  274. RIGHT<br>
  275. ROLLBACK<br>
  276. </td><td valign="top" align="left" width="20%">ROW<br>
  277. SAVEPOINT<br>
  278. SELECT<br>
  279. SET<br>
  280. TABLE<br>
  281. TEMP<br>
  282. TEMPORARY<br>
  283. THEN<br>
  284. TO<br>
  285. TRANSACTION<br>
  286. TRIGGER<br>
  287. UNION<br>
  288. UNIQUE<br>
  289. UPDATE<br>
  290. USING<br>
  291. VACUUM<br>
  292. VALUES<br>
  293. VIEW<br>
  294. VIRTUAL<br>
  295. WHEN<br>
  296. WHERE<br>
  297. </td></tr></table></blockquote>