2
0

lang_createview.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html><head>
  3. <title>SQLite Query Language: CREATE VIEW</title>
  4. <style type="text/css">
  5. body {
  6. margin: auto;
  7. font-family: Verdana, sans-serif;
  8. padding: 8px 1%;
  9. }
  10. a { color: #45735f }
  11. a:visited { color: #734559 }
  12. .logo { position:absolute; margin:3px; }
  13. .tagline {
  14. float:right;
  15. text-align:right;
  16. font-style:italic;
  17. width:240px;
  18. margin:12px;
  19. margin-top:58px;
  20. }
  21. .toolbar {
  22. font-variant: small-caps;
  23. text-align: center;
  24. line-height: 1.6em;
  25. margin: 0;
  26. padding:1px 8px;
  27. }
  28. .toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
  29. .toolbar a:visited { color: white; }
  30. .toolbar a:hover { color: #80a796; 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.png) 100% 100% no-repeat #80a796}
  37. .sw { background: url(images/sw.png) 0% 100% no-repeat }
  38. .ne { background: url(images/ne.png) 100% 0% no-repeat }
  39. .nw { background: url(images/nw.png) 0% 0% no-repeat }
  40. </style>
  41. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  42. </head>
  43. <body>
  44. <div><!-- container div to satisfy validator -->
  45. <a href="lang.html">
  46. <h2 align="center">SQL As Understood By SQLite</h2></a><h1>CREATE VIEW</h1><h4><a href="syntaxdiagrams.html#create-view-stmt">create-view-stmt:</a></h4><blockquote> <img alt="syntax diagram create-view-stmt" src="images/syntax/create-view-stmt.gif"></img> </blockquote>
  47. <p>The CREATE VIEW command assigns a name to a pre-packaged
  48. <a href="lang_select.html">SELECT</a>
  49. statement. Once the view is created, it can be used in the FROM clause
  50. of another <a href="lang_select.html">SELECT</a> in place of a table name.
  51. </p>
  52. <p>If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE"
  53. and "VIEW" then the view that is created is only visible to the
  54. process that opened the database and is automatically deleted when
  55. the database is closed.</p>
  56. <p> If a &lt;database-name&gt; is specified, then the view is created in
  57. the named database. It is an error to specify both a &lt;database-name&gt;
  58. and the TEMP keyword, unless the &lt;database-name&gt; is "temp". If no
  59. database name is specified, and the TEMP keyword is not present,
  60. the table is created in the main database.</p>
  61. <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
  62. in SQLite. However, in many cases you can use an
  63. <a href="lang_createtrigger.html#instead_of_trigger">INSTEAD OF trigger</a> on the view to accomplish
  64. the same thing. Views are removed
  65. with the <a href="lang_dropview.html">DROP VIEW</a> command.</p>