mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
:-) (CVS 88)
FossilOrigin-Name: 3252269e9005fe3f31f285506430e33d1031da88
This commit is contained in:
183
www/lang.tcl
183
www/lang.tcl
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Run this Tcl script to generate the sqlite.html file.
|
||||
#
|
||||
set rcsid {$Id: lang.tcl,v 1.2 2000/06/09 01:58:37 drh Exp $}
|
||||
set rcsid {$Id: lang.tcl,v 1.3 2000/06/09 03:47:19 drh Exp $}
|
||||
|
||||
puts {<html>
|
||||
<head>
|
||||
@ -46,6 +46,8 @@ foreach {section} [lsort -index 0 -dictionary {
|
||||
{UPDATE update}
|
||||
{SELECT select}
|
||||
{COPY copy}
|
||||
{EXPLAIN explain}
|
||||
{expressions expr}
|
||||
}] {
|
||||
puts "<li><a href=\"#[lindex $section 1]\">[lindex $section 0]</a></li>"
|
||||
}
|
||||
@ -67,7 +69,9 @@ proc Syntax {args} {
|
||||
regsub -all {[]|[*?]} $body {</font></b>&<b><font color="#2c2cf0">} body
|
||||
regsub -all "\n" [string trim $body] "<br>\n" body
|
||||
regsub -all "\n *" $body "\n\\ \\ \\ \\ " body
|
||||
regsub -all {[|,*()]} $body {<big>&</big>} body
|
||||
regsub -all {[|,.*()]} $body {<big>&</big>} body
|
||||
regsub -all { = } $body { <big>=</big> } body
|
||||
regsub -all {STAR} $body {<big>*</big>} body
|
||||
puts "<td><b><font color=\"#2c2cf0\">$body</font></b></td></tr>"
|
||||
}
|
||||
puts {</table>}
|
||||
@ -85,6 +89,41 @@ proc Example {text} {
|
||||
puts "<blockquote><pre>$text</pre></blockquote>"
|
||||
}
|
||||
|
||||
Section COPY copy
|
||||
|
||||
Syntax {sql-statement} {
|
||||
COPY <table-name> FROM <string>
|
||||
}
|
||||
|
||||
Section {CREATE INDEX} createindex
|
||||
|
||||
Syntax {sql-statement} {
|
||||
CREATE INDEX <index-name>
|
||||
ON <table-name> ( <column-name> [, <column-name>]* )
|
||||
} {column-name} {
|
||||
<name> [ ASC | DESC ]
|
||||
}
|
||||
|
||||
puts {
|
||||
<p>The CREATE INDEX command consists of the keywords "CREATE INDEX" followed
|
||||
by the name of the new index, the keyword "ON" the name of a previously
|
||||
created table that is to be indexed, and a parenthesized list of names of
|
||||
columns in the table that are used for the index key.
|
||||
Each column name can be followed by one of the "ASC" or "DESC" keywords
|
||||
to indicate sort order, but since GDBM does not implement ordered keys,
|
||||
these keywords are ignored.</p>
|
||||
|
||||
<p>There are no arbitrary limits on the number of indices that can be
|
||||
attached to a single table, nor on the number of columns in an index.</p>
|
||||
|
||||
<p>The exact text
|
||||
of each CREATE INDEX statement is stored in the <b>sqlite_master</b>
|
||||
table. Everytime the database is opened, all CREATE INDEX statements
|
||||
are read from the <b>sqlite_master</b> table and used to regenerate
|
||||
SQLite's internal representation of the index layout.</p>
|
||||
}
|
||||
|
||||
|
||||
Section {CREATE TABLE} {createtable}
|
||||
|
||||
Syntax {sql-command} {
|
||||
@ -140,34 +179,28 @@ are read from the <b>sqlite_master</b> table and used to regenerate
|
||||
SQLite's internal representation of the table layout.</p>
|
||||
}
|
||||
|
||||
Section {CREATE INDEX} createindex
|
||||
Section DELETE delete
|
||||
|
||||
Syntax {sql-statement} {
|
||||
CREATE INDEX <index-name>
|
||||
ON <table-name> ( <column-name> [, <column-name>]* )
|
||||
} {column-name} {
|
||||
<name> [ ASC | DESC ]
|
||||
DELETE FROM <table-name> [WHERE <expression>]
|
||||
}
|
||||
|
||||
puts {
|
||||
<p>The CREATE INDEX command consists of the keywords "CREATE INDEX" followed
|
||||
by the name of the new index, the keyword "ON" the name of a previously
|
||||
created table that is to be indexed, and a parenthesized list of names of
|
||||
columns in the table that are used for the index key.
|
||||
Each column name can be followed by one of the "ASC" or "DESC" keywords
|
||||
to indicate sort order, but since GDBM does not implement ordered keys,
|
||||
these keywords are ignored.</p>
|
||||
|
||||
<p>There are no arbitrary limits on the number of indices that can be
|
||||
attached to a single table, nor on the number of columns in an index.</p>
|
||||
|
||||
<p>The exact text
|
||||
of each CREATE INDEX statement is stored in the <b>sqlite_master</b>
|
||||
table. Everytime the database is opened, all CREATE INDEX statements
|
||||
are read from the <b>sqlite_master</b> table and used to regenerate
|
||||
SQLite's internal representation of the index layout.</p>
|
||||
<p></p>
|
||||
}
|
||||
|
||||
Section {DROP INDEX} dropindex
|
||||
|
||||
Syntax {sql-command} {
|
||||
DROP INDEX <index-name>
|
||||
}
|
||||
|
||||
puts {
|
||||
<p>The DROP INDEX statement consists of the keywords "DROP INDEX" followed
|
||||
by the name of the index. The index named is completely removed from
|
||||
the disk. The only way to recover the index is to reenter the
|
||||
appropriate CREATE INDEX command.</p>
|
||||
}
|
||||
|
||||
Section {DROP TABLE} droptable
|
||||
|
||||
@ -181,17 +214,92 @@ by the name of the table. The table named is completely removed from
|
||||
the disk. The table can not be recovered. All indices associated with
|
||||
the table are also reversibly deleted.</p>}
|
||||
|
||||
Section {DROP INDEX} dropindex
|
||||
Section EXPLAIN explain
|
||||
|
||||
Syntax {sql-command} {
|
||||
DROP INDEX <index-name>
|
||||
Syntax {sql-statement} {
|
||||
EXPLAIN <sql-statement>
|
||||
}
|
||||
|
||||
Section expression expr
|
||||
|
||||
Syntax {expression} {
|
||||
<expression> <binary-op> <expression> |
|
||||
<expression> <like-op> <expression> |
|
||||
<unary-op> <expression> |
|
||||
( <expression> ) |
|
||||
<column-name> |
|
||||
<table-name> . <column-name> |
|
||||
<literal-value> |
|
||||
<function-name> ( <expr-list> | STAR ) |
|
||||
<expression> ISNULL |
|
||||
<expression> NOTNULL |
|
||||
<expression> BETWEEN <expression> AND <expression> |
|
||||
<expression> IN ( <value-list> ) |
|
||||
<expression> IN ( <select> ) |
|
||||
( <select> )
|
||||
} {like-op} {
|
||||
LIKE | GLOB | NOT LIKE | NOT GLOB
|
||||
}
|
||||
|
||||
Section INSERT insert
|
||||
|
||||
Syntax {sql-statement} {
|
||||
INSERT INTO <table-name> [( <column-list> )] VALUES ( <value-list> ) |
|
||||
INSERT INTO <table-name> [( <column-list> )] <select-statement>
|
||||
}
|
||||
|
||||
puts {
|
||||
<p>The DROP INDEX statement consists of the keywords "DROP INDEX" followed
|
||||
by the name of the index. The index named is completely removed from
|
||||
the disk. The only way to recover the index is to reenter the
|
||||
appropriate CREATE INDEX command.</p>
|
||||
<p>The INSERT statement comes in two basic forms. The first form
|
||||
(with the "VALUES" keyword) creates a single new row in an existing table.
|
||||
If no column-list is specified then the number of values must
|
||||
be the same as the number of columns in the table. If a column-list
|
||||
is specified, then the number of values must match the number of
|
||||
specified columns. Columns of the table that do not appear in the
|
||||
column list are fill with the default value, or with NULL if not
|
||||
default value is specified.
|
||||
</p>
|
||||
|
||||
<p>The second form of the INSERT statement takes it data from a
|
||||
SELECT statement. The number of columns in the result of the
|
||||
SELECT must exactly match the number of columns in the table if
|
||||
no column list is specified, or it must match the number of columns
|
||||
name in the column list. A new entry is made in the table
|
||||
for every row of the SELECT result. The SELECT may be simple
|
||||
or compound. If the SELECT statement has an ORDER BY clause,
|
||||
the ORDER BY is ignored.</p>
|
||||
}
|
||||
|
||||
Section SELECT select
|
||||
|
||||
Syntax {sql-statement} {
|
||||
SELECT <result> FROM <table-list>
|
||||
[WHERE <expression>]
|
||||
[GROUP BY <expr-list>]
|
||||
[HAVING <expression>]
|
||||
[<compound-op> <select>]*
|
||||
[ORDER BY <sort-expr-list>]
|
||||
} {result} {
|
||||
STAR | <expresssion> [, <expression>]*
|
||||
} {table-list} {
|
||||
<table-name> [, <table-name>]*
|
||||
} {sort-expr-list} {
|
||||
<expr> [<sort-order>] [, <expr> [<sort-order>]]*
|
||||
} {sort-order} {
|
||||
ASC | DESC
|
||||
} {compound_op} {
|
||||
UNION | UNION ALL | INTERSECT | EXCEPT
|
||||
}
|
||||
|
||||
Section UPDATE update
|
||||
|
||||
Syntax {sql-statement} {
|
||||
UPDATE <table-name> SET <assignment> [, <assignment>] [WHERE <expression>]
|
||||
} {assignment} {
|
||||
<column-name> = <expression>
|
||||
}
|
||||
|
||||
puts {
|
||||
<p>
|
||||
}
|
||||
|
||||
Section VACUUM vacuum
|
||||
@ -214,21 +322,8 @@ the underlying GDBM file much smaller and will help queries to
|
||||
run much faster.</p>
|
||||
}
|
||||
|
||||
Section INSERT insert
|
||||
|
||||
Syntax {sql-statement} {
|
||||
INSERT INTO <table-name> [( <column-list> )] VALUES ( <value-list> ) |
|
||||
INSERT INTO <table-name> [( <column-list> )] <select-statement>
|
||||
}
|
||||
|
||||
puts {
|
||||
<p>The INSERT statement comes in two basic forms. The first form
|
||||
(with the "VALUES" keyword) creates a single new row in an existing table.
|
||||
If no column-list is specified then the number of values must
|
||||
be the same as the number of columns in the table. If a column-list
|
||||
is specified, then the number of values must match the number of
|
||||
specified columns
|
||||
</p>
|
||||
<p></p>
|
||||
}
|
||||
|
||||
puts {
|
||||
|
Reference in New Issue
Block a user