-C Fix\sa\scouple\sof\sgcc\swarnings.\s(CVS\s1615)
-D 2004-06-18T06:02:35
+C Fix\stypos\sand\sminor\serrors\sin\slang.tcl.\s(CVS\s1616)
+D 2004-06-18T11:25:21
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
F www/fileformat.tcl f71a06a0d533c7df408539c64113b4adeaf29764
F www/formatchng.tcl d1dfecedfb25e122ab513a1e0948b15cb4f0be46
F www/index.tcl 9783a8370bf16dfc20e81f1cf14489f95408353e
-F www/lang.tcl 608a3504fe59699699ca6faf3f7142e067a9f383
+F www/lang.tcl 5193e27d5ab92ffa98427ef0fcc55d7a7c0e3ac3
F www/lockingv3.tcl afcd22f0f063989cff2f4d57bbc38d719b4c6e75
F www/mingw.tcl d96b451568c5d28545fefe0c80bee3431c73f69c
F www/nulls.tcl f31330db8c978e675f5cd263067b32b822effa6f
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
F www/version3.tcl f9a4c1a12864e129f6717d22313be01d5657e3aa
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P 39a415eaa65964742e40b7ea4d471fa04007c6c9
-R 1f87c66183bcd20f5c4dd0f1294ea301
+P 960f55f3ecbef4581c8cb7be860023ba10de4e96
+R a54f9360f1d233838325028d874d84d6
U danielk1977
-Z a8b87d949b3bcf0bc23b2b09209c47b5
+Z dca5f137789ab1a1b476735e27fe6318
#
# Run this Tcl script to generate the sqlite.html file.
#
-set rcsid {$Id: lang.tcl,v 1.69 2004/06/17 19:04:17 drh Exp $}
+set rcsid {$Id: lang.tcl,v 1.70 2004/06/18 11:25:21 danielk1977 Exp $}
source common.tcl
header {Query Language Understood by SQLite}
puts {
<p>You can read from and write to an attached database and you
can modify the schema of the attached database. This is a new
feature of SQLite version 3.0. In SQLite 2.8, schema changes
-to attached databases were not allows.</p>
+to attached databases were not allowed.</p>
<p>You cannot create a new table with the same name as a table in
an attached database, but you can attach a database which contains
are read from the <b>sqlite_master</b> table and used to regenerate
SQLite's internal representation of the index layout.</p>
-<p>Indexes cannot be added on tables in attached databases.
-Indexes are removed with the <a href="#dropindex">DROP INDEX</a>
+<p>Indexes are removed with the <a href="#dropindex">DROP INDEX</a>
command.</p>
}
[, <constraint>]*
)
} {sql-command} {
-CREATE [TEMP | TEMPORARY] TABLE <table-name> AS <select-statement>
+CREATE [TEMP | TEMPORARY] TABLE [<database-name>.] <table-name> AS <select-statement>
} {column-def} {
<name> [<type>] [[CONSTRAINT <name>] <column-constraint>]*
} {type} {
are also temporary. Temporary tables and indices are stored in a
separate file distinct from the main database file.</p>
+<p> If a <database-name> is specified, then the table is created in
+the named database. It is an error to specify both a <database-name>
+and the TEMP keyword, unless the <database-name> is "temp". If no
+database name is specified, and the TEMP keyword is not present,
+the table is created in the main database.</p>
+
<p>The optional conflict-clause following each constraint
allows the specification of an alternative default
constraint conflict resolution algorithm for that constraint.
</p>
<p>Tables are removed using the <a href="#droptable">DROP TABLE</a>
-statement. Non-temporary tables in an attached database cannot be
-dropped.</p>
+statement. </p>
}
Section {CREATE VIEW} {createview}
Syntax {sql-command} {
-CREATE [TEMP | TEMPORARY] VIEW <view-name> AS <select-statement>
+CREATE [TEMP | TEMPORARY] VIEW [<database-name>.] <view-name> AS <select-statement>
}
puts {
of another SELECT in place of a table name.
</p>
+<p>If the "TEMP" or "TEMPORARY" keyword occurs in between "CREATE"
+and "TABLE" then the table that is created is only visible to the
+process that opened the database and is automatically deleted when
+the database is closed.</p>
+
+<p> If a <database-name> is specified, then the view is created in
+the named database. It is an error to specify both a <database-name>
+and the TEMP keyword, unless the <database-name> is "temp". If no
+database name is specified, and the TEMP keyword is not present,
+the table is created in the main database.</p>
+
<p>You cannot COPY, DELETE, INSERT or UPDATE a view. Views are read-only
in SQLite. However, in many cases you can use a <a href="#trigger">
TRIGGER</a> on the view to accomplish the same thing. Views are removed
Section {DROP TABLE} droptable
Syntax {sql-command} {
-DROP TABLE <table-name>
+DROP TABLE [<database-name>.] <table-name>
}
puts {
part of standard SQL and therefore might not be familiar.</p>
<p>The syntax for the ON CONFLICT clause is as shown above for
-the CREATE TABLE, CREATE INDEX, and BEGIN TRANSACTION commands.
-For the COPY, INSERT, and UPDATE commands, the keywords
-"ON CONFLICT" are replaced by "OR", to make the syntax seem more
-natural. But the meaning of the clause is the same either way.</p>
+the CREATE TABLE and CREATE INDEX commands. For the COPY, INSERT, and
+UPDATE commands, the keywords "ON CONFLICT" are replaced by "OR", to make
+the syntax seem more natural. But the meaning of the clause is the same
+either way.</p>
<p>The ON CONFLICT clause specifies an algorithm used to resolve
constraint conflicts. There are five choices: ROLLBACK, ABORT,
statisfy a constraint, it does not invoke delete triggers on those
rows. But that may change in a future release.</p>
-</dd>
-</dl>
-
-<p>
-The conflict resolution algorithm can be specified in three places,
-in order from lowest to highest precedence:
-</p>
-
-<ol>
-<li><p>
-On individual constraints within a CREATE TABLE or CREATE INDEX
-statement.
-</p></li>
-
-<li><p>
-On a BEGIN TRANSACTION command.
-</p></li>
-
-<li><p>
-In the OR clause of a COPY, INSERT, or UPDATE command.
-</p></li>
-</ol>
-
<p>The algorithm specified in the OR clause of a COPY, INSERT, or UPDATE
-overrides any algorithm specified on the BEGIN TRANSACTION command and
-the algorithm specified on the BEGIN TRANSACTION command overrides the
-algorithm specified in the a CREATE TABLE or CREATE INDEX.
+overrides any algorithm specified in a CREATE TABLE or CREATE INDEX.
If no algorithm is specified anywhere, the ABORT algorithm is used.</p>
}
which slows down disk access to the database contents.
The VACUUM command cleans
-the database by copying its contents to a temporary database file and
+the main database by copying its contents to a temporary database file and
reloading the original database file from the copy. This eliminates
free pages, aligns table data to be contiguous, and otherwise cleans
-up the database file structure.</p>
+up the database file structure. It is not possible to perform the same
+process on an attached database file.</p>
<p>This command will fail if there is an active transaction. This
command has no effect on an in-memory database.</p>