Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2a1545d7
提交
2a1545d7
authored
10月 18, 2009
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
HTML railroad diagrams
上级
11095888
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
691 行增加
和
463 行删除
+691
-463
help.csv
h2/src/docsrc/help/help.csv
+249
-277
datatypes.html
h2/src/docsrc/html/datatypes.html
+23
-1
faq.html
h2/src/docsrc/html/faq.html
+1
-1
fragments.html
h2/src/docsrc/html/fragments.html
+13
-2
functions.html
h2/src/docsrc/html/functions.html
+109
-4
grammar.html
h2/src/docsrc/html/grammar.html
+84
-0
stylesheet.css
h2/src/docsrc/html/stylesheet.css
+23
-0
stylesheetPdf.css
h2/src/docsrc/html/stylesheetPdf.css
+22
-0
help.csv
h2/src/main/org/h2/res/help.csv
+147
-164
PageParser.java
h2/src/main/org/h2/server/web/PageParser.java
+2
-2
GenerateDoc.java
h2/src/tools/org/h2/build/doc/GenerateDoc.java
+15
-8
WebSite.java
h2/src/tools/org/h2/build/doc/WebSite.java
+3
-4
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
2a1545d7
...
@@ -196,74 +196,46 @@ This command commits an open transaction.
...
@@ -196,74 +196,46 @@ This command commits an open transaction.
ALTER TABLE TEST ADD CONSTRAINT NAME_UNIQUE UNIQUE(NAME)
ALTER TABLE TEST ADD CONSTRAINT NAME_UNIQUE UNIQUE(NAME)
"
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN","
"Commands (DDL)","ALTER TABLE ALTER","
ALTER TABLE tableName ALTER COLUMN columnName dataType
ALTER TABLE tableName ALTER COLUMN columnName
[ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ]
{ { dataType [ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] }
| { RENAME TO name }
| { RESTART WITH long }
| { SELECTIVITY int }
| { SET DEFAULT expression }
| { SET NULL }
| { SET NOT NULL } }
","
","
Changes the data type of a column.
Changes the data type of a column, rename a column,
The operation fails if the data can not be converted.
change the identity value, or change the selectivity.
This command commits an open transaction.
","
ALTER TABLE TEST ALTER COLUMN NAME CLOB
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN RENAME","
Changing the data type fails if the data can not be converted.
ALTER TABLE tableName ALTER COLUMN columnName RENAME TO name
","
Renames a column.
This command commits an open transaction.
","
ALTER TABLE TEST ALTER COLUMN NAME RENAME TO TEXT
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN RESTART","
RESTART changes the next value of an auto increment column.
ALTER TABLE tableName ALTER COLUMN columnName RESTART WITH long
The column must already be an auto increment column.
","
For RESTART, the same transactional rules as for ALTER SEQUENCE apply.
Changes the next value of an auto increment column. The column must already be
an auto increment column. The same transactional rules as for ALTER SEQUENCE
apply.
","
ALTER TABLE TEST ALTER COLUMN ID RESTART WITH 10000
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN SELECTIVITY","
SELECTIVITY sets the selectivity (1-100) for a column.
ALTER TABLE tableName ALTER COLUMN columnName SELECTIVITY int
Setting the selectivity to 0 means the default value.
","
Selectivity is used by the cost based optimizer to calculate the estimated cost of an index.
Sets the selectivity (1-100) for a column. Setting the selectivity to 0 means
Selectivity 100 means values are unique, 10 means every distinct value appears 10 times on average.
the default value. Selectivity is used by the cost based optimizer to calculate
the estimated cost of an index. Selectivity 100 means values are unique, 10
means every distinct value appears 10 times on average.
This command commits an open transaction.
","
ALTER TABLE TEST ALTER COLUMN NAME SELECTIVITY 100
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET DEFAULT","
SET DEFAULT changes the default value of a column.
ALTER TABLE tableName ALTER COLUMN columnName SET DEFAULT expression
","
Changes the default value of a column.
This command commits an open transaction.
","
ALTER TABLE TEST ALTER COLUMN NAME SET DEFAULT ''
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET NOT NULL","
ALTER TABLE tableName ALTER COLUMN columnName SET NOT NULL
","
Sets a column to not allow NULL. Rows may not contains NULL in this column.
This command commits an open transaction.
","
ALTER TABLE TEST ALTER COLUMN NAME SET NOT NULL
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET NULL","
SET NULL sets a column to allow NULL. The row may not be part of a primary key or
ALTER TABLE tableName ALTER COLUMN columnName SET NULL
","
Sets a column to allow NULL. The row may not be part of a primary key or
multi-column hash index. Single column indexes on this column are dropped.
multi-column hash index. Single column indexes on this column are dropped.
SET NOT NULL sets a column to not allow NULL. Rows may not contains NULL in this column.
This command commits an open transaction.
This command commits an open transaction.
","
","
ALTER TABLE TEST ALTER COLUMN NAME SET NULL
ALTER TABLE TEST ALTER COLUMN NAME CLOB;
ALTER TABLE TEST ALTER COLUMN NAME RENAME TO TEXT;
ALTER TABLE TEST ALTER COLUMN ID RESTART WITH 10000;
ALTER TABLE TEST ALTER COLUMN NAME SELECTIVITY 100;
ALTER TABLE TEST ALTER COLUMN NAME SET DEFAULT '';
ALTER TABLE TEST ALTER COLUMN NAME SET NOT NULL;
ALTER TABLE TEST ALTER COLUMN NAME SET NULL;
"
"
"Commands (DDL)","ALTER TABLE DROP COLUMN","
"Commands (DDL)","ALTER TABLE DROP COLUMN","
...
@@ -1394,81 +1366,73 @@ Admin rights are required to execute this command.
...
@@ -1394,81 +1366,73 @@ Admin rights are required to execute this command.
SHUTDOWN
SHUTDOWN
"
"
"Other Grammar","
Comment
s","
"Other Grammar","
Alia
s","
-- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
name
","
","
Comments can be used anywhere in a command and are ignored by the database. Line
An alias is a name that is only valid in the context of the statement.
comments end with a newline. Block comments cannot be nested, but can be
multiple lines long.
","
","
// This is a comment
A
"
"
"Other Grammar","
Order
","
"Other Grammar","
And Condition
","
{ int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST }
]
condition [ { AND condition } [...]
]
","
","
Sorts the result by the given column number, or by an expression. If the
Value or condition.
expression is a single parameter, then the value is interpreted as a column
number. Negative column numbers reverse the sort order.
","
","
NAME DESC NULLS LAST
ID=1 AND NAME='Hi'
"
"
"Other Grammar","Constraint","
"Other Grammar","Array","
[ constraintNameDefinition ] {
( expression [,...] )
CHECK expression | UNIQUE ( columnName [,...] )
| referentialConstraint }
| PRIMARY KEY [ HASH ] ( columnName [,...] )
","
","
Defines a constraint. The check condition must evaluate to true or to NULL (to
An array of values.
prevent NULL, use NOT NULL).
","
","
PRIMARY KEY(ID, NAME
)
(1, 2
)
"
"
"Other Grammar","
Constraint Name Definitio
n","
"Other Grammar","
Boolea
n","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
TRUE | FALSE
","
","
Defines a constraint nam
e.
A boolean valu
e.
","
","
CONSTRAINT CONST_ID
TRUE
"
"
"Other Grammar","Referential Constraint","
"Other Grammar","Bytes","
FOREIGN KEY ( columnName [,...] )
X'hex'
REFERENCES [ refTableName ] [ ( refColumnName [,...] ) ]
[ ON DELETE { CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL } } ]
[ ON UPDATE { CASCADE | SET { DEFAULT | NULL } } ]
","
","
Defines a referential constraint. If the table name is not specified, then the
A binary value. The hex value is not case sensitive.
same table is referenced. As this database does not support deferred checking,
RESTRICT and NO ACTION will both throw an exception if the constraint is
violated. If the referenced columns are not specified, then the primary key
columns are used. The required indexes are automatically created if required.
","
","
FOREIGN KEY(ID) REFERENCES TEST(ID)
X'01FF'
"
"
"Other Grammar","Table Expression","
"Other Grammar","Case","
{ [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
CASE expression { WHEN expression THEN expression } [...]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
[ ELSE expression ] END
JOIN tableExpression [ ON expression ] ]
","
","
Joins a table. The join expression is not supported for cross and natural joins.
Returns the first expression where the value is equal to the test expression. If
A natural join is an inner join, where the condition is automatically on the
no else part is specified, return NULL.
columns with the same name.
","
","
TEST AS T LEFT JOIN TEST AS T1 ON T.ID = T1.I
D
CASE CNT WHEN 0 THEN 'No' WHEN 1 THEN 'One' ELSE 'Some' EN
D
"
"
"Other Grammar","Index Column","
"Other Grammar","Case When","
columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
CASE { WHEN expression THEN expression} [...]
[ ELSE expression ] END
","
","
Indexes this column in ascending or descending order. Usually it is not required
Returns the first expression where the condition is true. If no else part is
to specify the order; however doing so will speed up large queries that order
specified, return NULL.
the column in the same way.
","
","
NAME
CASE WHEN CNT<10 THEN 'Low' ELSE 'High' END
"
"Other Grammar","Cipher","
{ AES | XTEA }
","
Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds). The AES
algorithm is about half as fast as XTEA.
","
AES
"
"
"Other Grammar","Column Definition","
"Other Grammar","Column Definition","
...
@@ -1486,20 +1450,22 @@ CREATE TABLE(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT '');
...
@@ -1486,20 +1450,22 @@ CREATE TABLE(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT '');
CREATE TABLE(ID BIGINT IDENTITY);
CREATE TABLE(ID BIGINT IDENTITY);
"
"
"Other Grammar","
Expression
","
"Other Grammar","
Comments
","
andCondition [ { OR andCondition } [...] ]
-- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
","
","
Value or condition.
Comments can be used anywhere in a command and are ignored by the database. Line
comments end with a newline. Block comments cannot be nested, but can be
multiple lines long.
","
","
ID=1 OR NAME='Hi'
// This is a comment
"
"
"Other Grammar","
And Condition
","
"Other Grammar","
Compare
","
condition [ { AND condition } [...] ]
<> | <= | >= | = | < | > | !=
","
","
Value or condition
.
Comparison operator. The operator != is the same as <>
.
","
","
ID=1 AND NAME='Hi'
<>
"
"
"Other Grammar","Condition","
"Other Grammar","Condition","
...
@@ -1532,164 +1498,130 @@ See Java Matcher.find for details.
...
@@ -1532,164 +1498,130 @@ See Java Matcher.find for details.
LIKE 'Jo%'
LIKE 'Jo%'
"
"
"Other Grammar","Compare","
"Other Grammar","Constraint","
<> | <= | >= | = | < | > | !=
[ constraintNameDefinition ] {
","
CHECK expression | UNIQUE ( columnName [,...] )
Comparison operator. The operator != is the same as <>.
| referentialConstraint }
","
| PRIMARY KEY [ HASH ] ( columnName [,...] )
<>
"
"Other Grammar","Operand","
summand [ { || summand } [...] ]
","
A value or a concatenation of values.
","
'Hi' || ' Eva'
"
"Other Grammar","Summand","
factor [ { { + | - } factor } [...] ]
","
A value or a numeric sum.
","
ID + 20
"
"Other Grammar","Factor","
term [ { { * | / } term } [...] ]
","
","
A value or a numeric factor.
Defines a constraint. The check condition must evaluate to true or to NULL (to
prevent NULL, use NOT NULL).
","
","
ID * 10
PRIMARY KEY(ID, NAME)
"
"
"Other Grammar","Term","
"Other Grammar","Constraint Name Definition","
value
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
| columnName
| ?[ int ]
| NEXT VALUE FOR sequenceName
| function
| { - | + } term
| ( expression )
| select
| case
| caseWhen
| tableAlias.columnName
","
","
A value. Parameters can be indexed, for example ?1 meaning the first parameter
.
Defines a constraint name
.
","
","
'Hello'
CONSTRAINT CONST_ID
"
"
"Other Grammar","Value","
"Other Grammar","Csv Options","
string | dollarQuotedString | hexNumber | int | long | decimal | double
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]]
| date | time | timestamp | boolean | bytes | array | null
","
","
A value of any data type, or null
.
Optional parameters for CSVREAD and CSVWRITE
.
","
","
10
CALL CSVWRITE('test2.csv', 'SELECT * FROM TEST', 'UTF-8', '|');
"
"
"Other Grammar","Case","
"Other Grammar","Data Type","
CASE expression { WHEN expression THEN expression } [...]
intType | booleanType | tinyintType | smallintType | bigintType | identityType
[ ELSE expression ] END
| decimalType | doubleType | realType | dateType | timeType | timestampType
| binaryType | otherType | varcharType | varcharIgnorecaseType | charType
| blobType | clobType | uuidType | arrayType
","
","
Returns the first expression where the value is equal to the test expression. If
A data type definition.
no else part is specified, return NULL.
","
","
CASE CNT WHEN 0 THEN 'No' WHEN 1 THEN 'One' ELSE 'Some' END
INT
"
"
"Other Grammar","Case When","
"Other Grammar","Date","
CASE { WHEN expression THEN expression} [...]
DATE 'yyyy-MM-dd'
[ ELSE expression ] END
","
","
Returns the first expression where the condition is true. If no else part is
A date literal. The limitations are the same as for the Java data type
specified, return NULL.
java.sql.Date, but for compatibility with other databases the suggested minimum
and maximum years are 0001 and 9999.
","
","
CASE WHEN CNT<10 THEN 'Low' ELSE 'High' END
DATE '2004-12-31'
"
"
"Other Grammar","
Csv Options
","
"Other Grammar","
Decimal
","
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]
]
[ + | - ] number [ . number
]
","
","
Optional parameters for CSVREAD and CSVWRITE
.
Number with fixed precision and scale
.
","
","
CALL CSVWRITE('test2.csv', 'SELECT * FROM TEST', 'UTF-8', '|');
-1600.05
"
"
"Other Grammar","
Cipher
","
"Other Grammar","
Digit
","
{ AES | XTEA }
0-9
","
","
Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds). The AES
A digit.
algorithm is about half as fast as XTEA.
","
","
AES
0
"
"
"Other Grammar","
Select Expression
","
"Other Grammar","
Dollar Quoted String
","
* | expression [ [ AS ] columnAlias ] | tableAlias.*
$$anythingExceptTwoDollarSigns$$
","
","
An expression in a SELECT statement.
A string starts and ends with two dollar signs. Two dollar signs are not allowed
within the text. A whitespace is required before the first set of dollar signs.
No escaping is required within the text.
","
","
ID AS VALUE
$$John's car$$
"
"
"Other Grammar","Data Type","
"Other Grammar","Double","
intType | booleanType | tinyintType | smallintType | bigintType | identityType
[ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
| decimalType | doubleType | realType | dateType | timeType | timestampType
| binaryType | otherType | varcharType | varcharIgnorecaseType | charType
| blobType | clobType | uuidType | arrayType
","
","
A data type definition
.
The limitations are the same as for the Java data type Double
.
","
","
INT
-1.4e-10
"
"
"Other Grammar","
Name
","
"Other Grammar","
Expression
","
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
andCondition [ { OR andCondition } [...] ]
","
","
Names are not case sensitive. There is no maximum name length
.
Value or condition
.
","
","
TEST
ID=1 OR NAME='Hi'
"
"
"Other Grammar","
Alias
","
"Other Grammar","
Factor
","
name
term [ { { * | / } term } [...] ]
","
","
A
n alias is a name that is only valid in the context of the statement
.
A
value or a numeric factor
.
","
","
A
ID * 10
"
"
"Other Grammar","
Quoted Name
","
"Other Grammar","
Hex
","
""anythingExceptDoubleQuote""
{ { digit | a-f | A-F } { digit | a-f | A-F } } [...]
","
","
Quoted names are case sensitive, and can contain spaces. There is no maximum
The hexadecimal representation of a number or of bytes. Two characters are one
name length. Two double quotes can be used to create a single double quote
byte.
inside an identifier.
","
","
""FirstName""
cafe
"
"
"Other Grammar","
String
","
"Other Grammar","
Hex Number
","
'anythingExceptSingleQuote'
[ + | - ] 0x hex
","
","
A string starts and ends with a single quote. Two single quotes can be used to
A number written in hexadecimal notation.
create a single quote inside a string.
","
","
'John''s car'
0xff
"
"
"Other Grammar","
Dollar Quoted String
","
"Other Grammar","
Index Column
","
$$anythingExceptTwoDollarSigns$$
columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
","
","
A string starts and ends with two dollar signs. Two dollar signs are not allow
ed
Indexes this column in ascending or descending order. Usually it is not requir
ed
within the text. A whitespace is required before the first set of dollar signs.
to specify the order; however doing so will speed up large queries that order
No escaping is required within the text
.
the column in the same way
.
","
","
$$John's car$$
NAME
"
"
"Other Grammar","Int","
"Other Grammar","Int","
...
@@ -1708,28 +1640,20 @@ Long numbers are between -9223372036854775808 and 9223372036854775807.
...
@@ -1708,28 +1640,20 @@ Long numbers are between -9223372036854775808 and 9223372036854775807.
100000
100000
"
"
"Other Grammar","Hex Number","
"Other Grammar","Name","
[ + | - ] 0x hex
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
","
A number written in hexadecimal notation.
","
0xff
"
"Other Grammar","Decimal","
[ + | - ] number [ . number ]
","
","
N
umber with fixed precision and scale
.
N
ames are not case sensitive. There is no maximum name length
.
","
","
-1600.05
TEST
"
"
"Other Grammar","
Double
","
"Other Grammar","
Null
","
[ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
NULL
","
","
The limitations are the same as for the Java data type Double
.
NULL is a value without data type and means 'unknown value'
.
","
","
-1.4e-10
NULL
"
"
"Other Grammar","Number","
"Other Grammar","Number","
...
@@ -1740,81 +1664,129 @@ The maximum length of the number depends on the data type used.
...
@@ -1740,81 +1664,129 @@ The maximum length of the number depends on the data type used.
100
100
"
"
"Other Grammar","
Date
","
"Other Grammar","
Operand
","
DATE 'yyyy-MM-dd'
summand [ { || summand } [...] ]
","
","
A date literal. The limitations are the same as for the Java data type
A value or a concatenation of values.
java.sql.Date, but for compatibility with other databases the suggested minimum
and maximum years are 0001 and 9999.
","
","
DATE '2004-12-31
'
'Hi' || ' Eva
'
"
"
"Other Grammar","
Time
","
"Other Grammar","
Order
","
TIME 'hh:mm:ss'
{ int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
","
","
A time literal.
Sorts the result by the given column number, or by an expression. If the
expression is a single parameter, then the value is interpreted as a column
number. Negative column numbers reverse the sort order.
","
","
TIME '23:59:59'
NAME DESC NULLS LAST
"
"
"Other Grammar","
Timestamp
","
"Other Grammar","
Quoted Name
","
TIMESTAMP 'yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]'
""anythingExceptDoubleQuote""
","
","
A timestamp literal. The limitations are the same as for the Java data type
Quoted names are case sensitive, and can contain spaces. There is no maximum
java.sql.Timestamp, but for compatibility with other databases the suggested
name length. Two double quotes can be used to create a single double quote
minimum and maximum years are 0001 and 9999
.
inside an identifier
.
","
","
TIMESTAMP '2005-12-31 23:59:59'
""FirstName""
"
"
"Other Grammar","Boolean","
"Other Grammar","Referential Constraint","
TRUE | FALSE
FOREIGN KEY ( columnName [,...] )
REFERENCES [ refTableName ] [ ( refColumnName [,...] ) ]
[ ON DELETE { CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL } } ]
[ ON UPDATE { CASCADE | SET { DEFAULT | NULL } } ]
","
","
A boolean value.
Defines a referential constraint. If the table name is not specified, then the
same table is referenced. As this database does not support deferred checking,
RESTRICT and NO ACTION will both throw an exception if the constraint is
violated. If the referenced columns are not specified, then the primary key
columns are used. The required indexes are automatically created if required.
","
","
TRUE
FOREIGN KEY(ID) REFERENCES TEST(ID)
"
"
"Other Grammar","
Bytes
","
"Other Grammar","
Select Expression
","
X'hex'
* | expression [ [ AS ] columnAlias ] | tableAlias.*
","
","
A
binary value. The hex value is not case sensitive
.
A
n expression in a SELECT statement
.
","
","
X'01FF'
ID AS VALUE
"
"
"Other Grammar","
Array
","
"Other Grammar","
String
","
( expression [,...] )
'anythingExceptSingleQuote'
","
","
An array of values.
A string starts and ends with a single quote. Two single quotes can be used to
create a single quote inside a string.
","
","
(1, 2)
'John''s car'
"
"
"Other Grammar","
Null
","
"Other Grammar","
Summand
","
NULL
factor [ { { + | - } factor } [...] ]
","
","
NULL is a value without data type and means 'unknown value'
.
A value or a numeric sum
.
","
","
NULL
ID + 20
"
"
"Other Grammar","Hex","
"Other Grammar","Table Expression","
{ { digit | a-f | A-F } { digit | a-f | A-F } } [...]
{ [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN tableExpression [ ON expression ] ]
","
","
The hexadecimal representation of a number or of bytes. Two characters are one
Joins a table. The join expression is not supported for cross and natural joins.
byte.
A natural join is an inner join, where the condition is automatically on the
columns with the same name.
","
","
cafe
TEST AS T LEFT JOIN TEST AS T1 ON T.ID = T1.ID
"
"
"Other Grammar","Digit","
"Other Grammar","Term","
0-9
value
| columnName
| ?[ int ]
| NEXT VALUE FOR sequenceName
| function
| { - | + } term
| ( expression )
| select
| case
| caseWhen
| tableAlias.columnName
","
","
A
digit
.
A
value. Parameters can be indexed, for example ?1 meaning the first parameter
.
","
","
0
'Hello'
"
"Other Grammar","Time","
TIME 'hh:mm:ss'
","
A time literal.
","
TIME '23:59:59'
"
"Other Grammar","Timestamp","
TIMESTAMP 'yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]'
","
A timestamp literal. The limitations are the same as for the Java data type
java.sql.Timestamp, but for compatibility with other databases the suggested
minimum and maximum years are 0001 and 9999.
","
TIMESTAMP '2005-12-31 23:59:59'
"
"Other Grammar","Value","
string | dollarQuotedString | hexNumber | int | long | decimal | double
| date | time | timestamp | boolean | bytes | array | null
","
A value of any data type, or null.
","
10
"
"
"Data Types","INT Type","
"Data Types","INT Type","
...
...
h2/src/docsrc/html/datatypes.html
浏览文件 @
2a1545d7
...
@@ -16,11 +16,33 @@ Data Types
...
@@ -16,11 +16,33 @@ Data Types
<!-- } -->
<!-- } -->
<h1>
Data Types
</h1>
<h1>
Data Types
</h1>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="dataTypes">
<c:forEach var="item" items="dataTypes">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"dataTypes-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"dataTypes-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"dataTypes-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<c:forEach
var=
"item"
items=
"dataTypes"
>
<c:forEach
var=
"item"
items=
"dataTypes"
>
<h3
id=
"${item.link}"
class=
"notranslate"
>
${item.topic}
</h3>
<h3
id=
"${item.link}"
class=
"notranslate"
>
${item.topic}
</h3>
...
...
h2/src/docsrc/html/faq.html
浏览文件 @
2a1545d7
...
@@ -190,7 +190,7 @@ This is not a bug. According the the JDBC specification, the method
...
@@ -190,7 +190,7 @@ This is not a bug. According the the JDBC specification, the method
<code>
ResultSetMetaData.getColumnName()
</code>
should return the name of the column
<code>
ResultSetMetaData.getColumnName()
</code>
should return the name of the column
and not the alias name. If you need the alias name, use
and not the alias name. If you need the alias name, use
<a
href=
"http://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnLabel(int)"
><code>
ResultSetMetaData.getColumnLabel()
</code></a>
.
<a
href=
"http://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnLabel(int)"
><code>
ResultSetMetaData.getColumnLabel()
</code></a>
.
Other database don't work like this (they don't follow the JDBC s
tandard
).
Other database don't work like this (they don't follow the JDBC s
pecification
).
If you need compatibility with those databases, use the
<a
href=
"features.html#compatibility"
>
Compatibility Mode
</a>
,
If you need compatibility with those databases, use the
<a
href=
"features.html#compatibility"
>
Compatibility Mode
</a>
,
or set the system property
<a
href=
"../javadoc/org/h2/constant/SysProperties.html#h2.aliasColumnName"
><code>
h2.aliasColumnName
</code></a>
.
or set the system property
<a
href=
"../javadoc/org/h2/constant/SysProperties.html#h2.aliasColumnName"
><code>
h2.aliasColumnName
</code></a>
.
</p>
</p>
...
...
h2/src/docsrc/html/fragments.html
浏览文件 @
2a1545d7
...
@@ -24,7 +24,7 @@ Initial Developer: H2 Group
...
@@ -24,7 +24,7 @@ Initial Developer: H2 Group
<td
class=
"search"
colspan=
"2"
>
<td
class=
"search"
colspan=
"2"
>
<!-- translate
<!-- translate
<a href="http://translate.google.com/translate?u=http%3A%2F%2Fh2database.com"
<a href="http://translate.google.com/translate?u=http%3A%2F%2Fh2database.com"
onclick="javascript:
document.getElementById('translate').style.display=''
;return false;">Translate</a>
onclick="javascript:
startTranslate()
;return false;">Translate</a>
<div id = "translate" style="display:none"><div id = "google_translate_element"></div></div>
<div id = "translate" style="display:none"><div id = "google_translate_element"></div></div>
translate -->
translate -->
</td>
</td>
...
@@ -94,7 +94,18 @@ translate -->
...
@@ -94,7 +94,18 @@ translate -->
</div></td></tr></table>
</div></td></tr></table>
<script
type=
"text/javascript"
src=
"index.js"
></script>
<script
type=
"text/javascript"
src=
"index.js"
></script>
<script
type=
"text/javascript"
src=
"search.js"
></script>
<script
type=
"text/javascript"
src=
"search.js"
></script>
<script
type=
"text/javascript"
>
function
googleTranslateElementInit
()
{
new
google
.
translate
.
TranslateElement
({
pageLanguage
:
'en'
},
'google_translate_element'
);
}
</script>
<script
type=
"text/javascript"
>
function
startTranslate
()
{
document
.
getElementById
(
'translate'
).
style
.
display
=
''
;
var
script
=
document
.
createElement
(
'script'
);
script
.
setAttribute
(
"type"
,
"text/javascript"
);
script
.
setAttribute
(
"src"
,
"http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"
);
document
.
getElementsByTagName
(
"head"
)[
0
].
appendChild
(
script
);
}
function
googleTranslateElementInit
()
{
new
google
.
translate
.
TranslateElement
({
pageLanguage
:
'en'
},
'google_translate_element'
);
}
</script>
<!-- } -->
<!-- } -->
...
...
h2/src/docsrc/html/functions.html
浏览文件 @
2a1545d7
...
@@ -18,39 +18,144 @@ Functions
...
@@ -18,39 +18,144 @@ Functions
<h1>
Functions
</h1>
<h1>
Functions
</h1>
<h2>
Aggregate Functions
</h2>
<h2>
Aggregate Functions
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="functionsAggregate">
<c:forEach var="item" items="functionsAggregate">
<a href="#${item.link}" >${item.topic}</a><br />
<a href="#${item.link}" >${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsAggregate-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsAggregate-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsAggregate-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
Numeric Functions
</h2>
<h2>
Numeric Functions
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="functionsNumeric">
<c:forEach var="item" items="functionsNumeric">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsNumeric-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsNumeric-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsNumeric-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
String Functions
</h2>
<h2>
String Functions
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="functionsString">
<c:forEach var="item" items="functionsString">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsString-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsString-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsString-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
Time and Date Functions
</h2>
<h2>
Time and Date Functions
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="functionsTimeDate">
<c:forEach var="item" items="functionsTimeDate">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsTimeDate-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsTimeDate-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsTimeDate-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
System Functions
</h2>
<h2>
System Functions
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="functionsSystem">
<c:forEach var="item" items="functionsSystem">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsSystem-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsSystem-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"functionsSystem-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<c:forEach
var=
"item"
items=
"functionsAll"
>
<c:forEach
var=
"item"
items=
"functionsAll"
>
<h3
id=
"${item.link}"
class=
"notranslate"
>
${item.topic}
</h3>
<h3
id=
"${item.link}"
class=
"notranslate"
>
${item.topic}
</h3>
...
...
h2/src/docsrc/html/grammar.html
浏览文件 @
2a1545d7
...
@@ -17,32 +17,116 @@ SQL Grammar
...
@@ -17,32 +17,116 @@ SQL Grammar
<h1>
SQL Grammar
</h1>
<h1>
SQL Grammar
</h1>
<h2>
Commands (Data Manipulation)
</h2>
<h2>
Commands (Data Manipulation)
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="commandsDML">
<c:forEach var="item" items="commandsDML">
<a href="#${item.link}">${item.topic}</a><br />
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsDML-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsDML-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsDML-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
Commands (Data Definition)
</h2>
<h2>
Commands (Data Definition)
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="commandsDDL">
<c:forEach var="item" items="commandsDDL">
<a href="#${item.link}">${item.topic}</a><br />
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsDDL-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsDDL-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsDDL-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
Commands (Other)
</h2>
<h2>
Commands (Other)
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="commandsOther">
<c:forEach var="item" items="commandsOther">
<a href="#${item.link}">${item.topic}</a><br />
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsOther-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsOther-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"commandsOther-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
Other Grammar
</h2>
<h2>
Other Grammar
</h2>
<!-- syntax-start
<p class="notranslate">
<p class="notranslate">
<c:forEach var="item" items="otherGrammar">
<c:forEach var="item" items="otherGrammar">
<a href="#${item.link}" >${item.topic}</a><br />
<a href="#${item.link}" >${item.topic}</a><br />
</c:forEach>
</c:forEach>
</p>
</p>
syntax-end -->
<!-- railroad-start -->
<table
class=
"notranslate index"
>
<tr>
<td
class=
"index"
>
<c:forEach
var=
"item"
items=
"otherGrammar-0"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"otherGrammar-1"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td><td
class=
"index"
>
<c:forEach
var=
"item"
items=
"otherGrammar-2"
>
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
</c:forEach>
</td>
</tr>
</table>
<!-- railroad-end -->
<h2>
System Tables
</h2>
<h2>
System Tables
</h2>
<p
class=
"notranslate"
>
<p
class=
"notranslate"
>
...
...
h2/src/docsrc/html/stylesheet.css
浏览文件 @
2a1545d7
...
@@ -214,6 +214,29 @@ td.content {
...
@@ -214,6 +214,29 @@ td.content {
color
:
#800
;
color
:
#800
;
}
}
table
.index
{
width
:
100%
;
border
:
0px
;
padding
:
0px
;
margin
:
0px
;
border
:
0px
none
;
border-collapse
:
collapse
;
}
/* width: 570px;
width: 190px;
*/
td
.index
{
width
:
33%
;
border
:
0px
;
padding
:
0px
;
margin
:
0px
;
border
:
0px
none
;
border-collapse
:
collapse
;
vertical-align
:
top
;
}
.railroad
{
.railroad
{
border
:
0px
;
border
:
0px
;
padding
:
0px
;
padding
:
0px
;
...
...
h2/src/docsrc/html/stylesheetPdf.css
浏览文件 @
2a1545d7
...
@@ -131,3 +131,25 @@ em.u {
...
@@ -131,3 +131,25 @@ em.u {
color
:
#800
;
color
:
#800
;
}
}
table
.index
{
width
:
100%
;
border
:
0px
;
padding
:
0px
;
margin
:
0px
;
border
:
0px
none
;
border-collapse
:
collapse
;
}
/* width: 570px;
width: 190px;
*/
td
.index
{
width
:
33%
;
border
:
0px
;
padding
:
0px
;
margin
:
0px
;
border
:
0px
none
;
border-collapse
:
collapse
;
vertical-align
:
top
;
}
h2/src/main/org/h2/res/help.csv
浏览文件 @
2a1545d7
...
@@ -78,35 +78,18 @@ Adds a new column to a table."
...
@@ -78,35 +78,18 @@ Adds a new column to a table."
ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
","
","
Adds a constraint to a table."
Adds a constraint to a table."
"Commands (DDL)","ALTER TABLE ALTER COLUMN","
"Commands (DDL)","ALTER TABLE ALTER","
ALTER TABLE tableName ALTER COLUMN columnName dataType
ALTER TABLE tableName ALTER COLUMN columnName
[ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ]
{ { dataType [ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] }
","
| { RENAME TO name }
Changes the data type of a column."
| { RESTART WITH long }
"Commands (DDL)","ALTER TABLE ALTER COLUMN RENAME","
| { SELECTIVITY int }
ALTER TABLE tableName ALTER COLUMN columnName RENAME TO name
| { SET DEFAULT expression }
","
| { SET NULL }
Renames a column."
| { SET NOT NULL } }
"Commands (DDL)","ALTER TABLE ALTER COLUMN RESTART","
","
ALTER TABLE tableName ALTER COLUMN columnName RESTART WITH long
Changes the data type of a column, rename a column,
","
change the identity value, or change the selectivity."
Changes the next value of an auto increment column."
"Commands (DDL)","ALTER TABLE ALTER COLUMN SELECTIVITY","
ALTER TABLE tableName ALTER COLUMN columnName SELECTIVITY int
","
Sets the selectivity (1-100) for a column."
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET DEFAULT","
ALTER TABLE tableName ALTER COLUMN columnName SET DEFAULT expression
","
Changes the default value of a column."
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET NOT NULL","
ALTER TABLE tableName ALTER COLUMN columnName SET NOT NULL
","
Sets a column to not allow NULL."
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET NULL","
ALTER TABLE tableName ALTER COLUMN columnName SET NULL
","
Sets a column to allow NULL."
"Commands (DDL)","ALTER TABLE DROP COLUMN","
"Commands (DDL)","ALTER TABLE DROP COLUMN","
ALTER TABLE tableName DROP COLUMN columnName
ALTER TABLE tableName DROP COLUMN columnName
","
","
...
@@ -480,56 +463,54 @@ SHUTDOWN [ IMMEDIATELY | COMPACT | SCRIPT ]
...
@@ -480,56 +463,54 @@ SHUTDOWN [ IMMEDIATELY | COMPACT | SCRIPT ]
","
","
This statement is closes all open connections to the database and closes the
This statement is closes all open connections to the database and closes the
database."
database."
"Other Grammar","
Comment
s","
"Other Grammar","
Alia
s","
-- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
name
","
","
Comments can be used anywhere in a command and are ignored by the database
."
An alias is a name that is only valid in the context of the statement
."
"Other Grammar","
Order
","
"Other Grammar","
And Condition
","
{ int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST }
]
condition [ { AND condition } [...]
]
","
","
Sorts the result by the given column number, or by an expression."
Value or condition."
"Other Grammar","Constraint","
"Other Grammar","Array","
[ constraintNameDefinition ] {
( expression [,...] )
CHECK expression | UNIQUE ( columnName [,...] )
| referentialConstraint }
| PRIMARY KEY [ HASH ] ( columnName [,...] )
","
","
Defines a constraint
."
An array of values
."
"Other Grammar","
Constraint Name Definitio
n","
"Other Grammar","
Boolea
n","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
TRUE | FALSE
","
","
Defines a constraint name."
A boolean value."
"Other Grammar","Referential Constraint","
"Other Grammar","Bytes","
FOREIGN KEY ( columnName [,...] )
X'hex'
REFERENCES [ refTableName ] [ ( refColumnName [,...] ) ]
[ ON DELETE { CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL } } ]
[ ON UPDATE { CASCADE | SET { DEFAULT | NULL } } ]
","
","
Defines a referential constraint."
A binary value."
"Other Grammar","Table Expression","
"Other Grammar","Case","
{ [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
CASE expression { WHEN expression THEN expression } [...]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
[ ELSE expression ] END
JOIN tableExpression [ ON expression ] ]
","
","
Joins a table."
Returns the first expression where the value is equal to the test expression."
"Other Grammar","Index Column","
"Other Grammar","Case When","
columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
CASE { WHEN expression THEN expression} [...]
[ ELSE expression ] END
","
","
Indexes this column in ascending or descending order."
Returns the first expression where the condition is true."
"Other Grammar","Cipher","
{ AES | XTEA }
","
Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds)."
"Other Grammar","Column Definition","
"Other Grammar","Column Definition","
columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT ] NULL ]
columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT ] NULL ]
[ { AUTO_INCREMENT | IDENTITY } [ ( startInt [, incrementInt ] ) ] ]
[ { AUTO_INCREMENT | IDENTITY } [ ( startInt [, incrementInt ] ) ] ]
[ SELECTIVITY selectivity ] [ PRIMARY KEY [ HASH ] | UNIQUE ]
[ SELECTIVITY selectivity ] [ PRIMARY KEY [ HASH ] | UNIQUE ]
","
","
Default expressions are used if no explicit value was used when adding a row."
Default expressions are used if no explicit value was used when adding a row."
"Other Grammar","
Expression
","
"Other Grammar","
Comments
","
andCondition [ { OR andCondition } [...] ]
-- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
","
","
Value or condition
."
Comments can be used anywhere in a command and are ignored by the database
."
"Other Grammar","
And Condition
","
"Other Grammar","
Compare
","
condition [ { AND condition } [...] ]
<> | <= | >= | = | < | > | !=
","
","
Value or condition
."
Comparison operator
."
"Other Grammar","Condition","
"Other Grammar","Condition","
operand [ conditionRightHandSide ] | NOT condition | EXISTS ( select )
operand [ conditionRightHandSide ] | NOT condition | EXISTS ( select )
","
","
...
@@ -543,63 +524,21 @@ compare { { { ALL | ANY | SOME } ( select ) } | operand }
...
@@ -543,63 +524,21 @@ compare { { { ALL | ANY | SOME } ( select ) } | operand }
| [ NOT ] REGEXP operand
| [ NOT ] REGEXP operand
","
","
The right hand side of a condition."
The right hand side of a condition."
"Other Grammar","Compare","
"Other Grammar","Constraint","
<> | <= | >= | = | < | > | !=
[ constraintNameDefinition ] {
","
CHECK expression | UNIQUE ( columnName [,...] )
Comparison operator."
| referentialConstraint }
"Other Grammar","Operand","
| PRIMARY KEY [ HASH ] ( columnName [,...] )
summand [ { || summand } [...] ]
","
A value or a concatenation of values."
"Other Grammar","Summand","
factor [ { { + | - } factor } [...] ]
","
A value or a numeric sum."
"Other Grammar","Factor","
term [ { { * | / } term } [...] ]
","
A value or a numeric factor."
"Other Grammar","Term","
value
| columnName
| ?[ int ]
| NEXT VALUE FOR sequenceName
| function
| { - | + } term
| ( expression )
| select
| case
| caseWhen
| tableAlias.columnName
","
A value."
"Other Grammar","Value","
string | dollarQuotedString | hexNumber | int | long | decimal | double
| date | time | timestamp | boolean | bytes | array | null
","
A value of any data type, or null."
"Other Grammar","Case","
CASE expression { WHEN expression THEN expression } [...]
[ ELSE expression ] END
","
","
Returns the first expression where the value is equal to the test expression."
Defines a constraint."
"Other Grammar","Case When","
"Other Grammar","Constraint Name Definition","
CASE { WHEN expression THEN expression} [...]
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
[ ELSE expression ] END
","
","
Returns the first expression where the condition is tru
e."
Defines a constraint nam
e."
"Other Grammar","Csv Options","
"Other Grammar","Csv Options","
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]]
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]]
","
","
Optional parameters for CSVREAD and CSVWRITE."
Optional parameters for CSVREAD and CSVWRITE."
"Other Grammar","Cipher","
{ AES | XTEA }
","
Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds)."
"Other Grammar","Select Expression","
* | expression [ [ AS ] columnAlias ] | tableAlias.*
","
An expression in a SELECT statement."
"Other Grammar","Data Type","
"Other Grammar","Data Type","
intType | booleanType | tinyintType | smallintType | bigintType | identityType
intType | booleanType | tinyintType | smallintType | bigintType | identityType
| decimalType | doubleType | realType | dateType | timeType | timestampType
| decimalType | doubleType | realType | dateType | timeType | timestampType
...
@@ -607,26 +546,46 @@ intType | booleanType | tinyintType | smallintType | bigintType | identityType
...
@@ -607,26 +546,46 @@ intType | booleanType | tinyintType | smallintType | bigintType | identityType
| blobType | clobType | uuidType | arrayType
| blobType | clobType | uuidType | arrayType
","
","
A data type definition."
A data type definition."
"Other Grammar","Name","
"Other Grammar","Date","
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
DATE 'yyyy-MM-dd'
","
Names are not case sensitive."
"Other Grammar","Alias","
name
","
","
A
n alias is a name that is only valid in the context of the statement
."
A
date literal
."
"Other Grammar","
Quoted Name
","
"Other Grammar","
Decimal
","
""anythingExceptDoubleQuote""
[ + | - ] number [ . number ]
","
","
Quoted names are case sensitive, and can contain spaces
."
Number with fixed precision and scale
."
"Other Grammar","
String
","
"Other Grammar","
Digit
","
'anythingExceptSingleQuote'
0-9
","
","
A
string starts and ends with a single quote
."
A
digit
."
"Other Grammar","Dollar Quoted String","
"Other Grammar","Dollar Quoted String","
$$anythingExceptTwoDollarSigns$$
$$anythingExceptTwoDollarSigns$$
","
","
A string starts and ends with two dollar signs."
A string starts and ends with two dollar signs."
"Other Grammar","Double","
[ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
","
The limitations are the same as for the Java data type Double."
"Other Grammar","Expression","
andCondition [ { OR andCondition } [...] ]
","
Value or condition."
"Other Grammar","Factor","
term [ { { * | / } term } [...] ]
","
A value or a numeric factor."
"Other Grammar","Hex","
{ { digit | a-f | A-F } { digit | a-f | A-F } } [...]
","
The hexadecimal representation of a number or of bytes."
"Other Grammar","Hex Number","
[ + | - ] 0x hex
","
A number written in hexadecimal notation."
"Other Grammar","Index Column","
columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
","
Indexes this column in ascending or descending order."
"Other Grammar","Int","
"Other Grammar","Int","
[ + | - ] number
[ + | - ] number
","
","
...
@@ -635,26 +594,69 @@ The maximum integer number is 2147483647, the minimum is -2147483648."
...
@@ -635,26 +594,69 @@ The maximum integer number is 2147483647, the minimum is -2147483648."
[ + | - ] number
[ + | - ] number
","
","
Long numbers are between -9223372036854775808 and 9223372036854775807."
Long numbers are between -9223372036854775808 and 9223372036854775807."
"Other Grammar","Hex Number","
"Other Grammar","Name","
[ + | - ] 0x hex
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
","
A number written in hexadecimal notation."
"Other Grammar","Decimal","
[ + | - ] number [ . number ]
","
","
N
umber with fixed precision and scal
e."
N
ames are not case sensitiv
e."
"Other Grammar","
Double
","
"Other Grammar","
Null
","
[ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
NULL
","
","
The limitations are the same as for the Java data type Double
."
NULL is a value without data type and means 'unknown value'
."
"Other Grammar","Number","
"Other Grammar","Number","
digit [...]
digit [...]
","
","
The maximum length of the number depends on the data type used."
The maximum length of the number depends on the data type used."
"Other Grammar","
Date
","
"Other Grammar","
Operand
","
DATE 'yyyy-MM-dd'
summand [ { || summand } [...] ]
","
","
A date literal."
A value or a concatenation of values."
"Other Grammar","Order","
{ int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
","
Sorts the result by the given column number, or by an expression."
"Other Grammar","Quoted Name","
""anythingExceptDoubleQuote""
","
Quoted names are case sensitive, and can contain spaces."
"Other Grammar","Referential Constraint","
FOREIGN KEY ( columnName [,...] )
REFERENCES [ refTableName ] [ ( refColumnName [,...] ) ]
[ ON DELETE { CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL } } ]
[ ON UPDATE { CASCADE | SET { DEFAULT | NULL } } ]
","
Defines a referential constraint."
"Other Grammar","Select Expression","
* | expression [ [ AS ] columnAlias ] | tableAlias.*
","
An expression in a SELECT statement."
"Other Grammar","String","
'anythingExceptSingleQuote'
","
A string starts and ends with a single quote."
"Other Grammar","Summand","
factor [ { { + | - } factor } [...] ]
","
A value or a numeric sum."
"Other Grammar","Table Expression","
{ [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN tableExpression [ ON expression ] ]
","
Joins a table."
"Other Grammar","Term","
value
| columnName
| ?[ int ]
| NEXT VALUE FOR sequenceName
| function
| { - | + } term
| ( expression )
| select
| case
| caseWhen
| tableAlias.columnName
","
A value."
"Other Grammar","Time","
"Other Grammar","Time","
TIME 'hh:mm:ss'
TIME 'hh:mm:ss'
","
","
...
@@ -663,30 +665,11 @@ A time literal."
...
@@ -663,30 +665,11 @@ A time literal."
TIMESTAMP 'yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]'
TIMESTAMP 'yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]'
","
","
A timestamp literal."
A timestamp literal."
"Other Grammar","Boolean","
"Other Grammar","Value","
TRUE | FALSE
string | dollarQuotedString | hexNumber | int | long | decimal | double
","
| date | time | timestamp | boolean | bytes | array | null
A boolean value."
"Other Grammar","Bytes","
X'hex'
","
A binary value."
"Other Grammar","Array","
( expression [,...] )
","
An array of values."
"Other Grammar","Null","
NULL
","
NULL is a value without data type and means 'unknown value'."
"Other Grammar","Hex","
{ { digit | a-f | A-F } { digit | a-f | A-F } } [...]
","
The hexadecimal representation of a number or of bytes."
"Other Grammar","Digit","
0-9
","
","
A
digit
."
A
value of any data type, or null
."
"Data Types","INT Type","
"Data Types","INT Type","
INT | INTEGER | MEDIUMINT | INT4 | SIGNED
INT | INTEGER | MEDIUMINT | INT4 | SIGNED
","
","
...
...
h2/src/main/org/h2/server/web/PageParser.java
浏览文件 @
2a1545d7
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
package
org
.
h2
.
server
.
web
;
package
org
.
h2
.
server
.
web
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.h2.util.New
;
import
org.h2.util.New
;
...
@@ -92,7 +92,7 @@ public class PageParser {
...
@@ -92,7 +92,7 @@ public class PageParser {
String
items
=
readParam
(
"items"
);
String
items
=
readParam
(
"items"
);
read
(
">"
);
read
(
">"
);
int
start
=
pos
;
int
start
=
pos
;
ArrayList
<
Object
>
list
=
(
Array
List
<
Object
>)
get
(
items
);
List
<
Object
>
list
=
(
List
<
Object
>)
get
(
items
);
if
(
list
==
null
)
{
if
(
list
==
null
)
{
result
.
append
(
"?items?"
);
result
.
append
(
"?items?"
);
list
=
New
.
arrayList
();
list
=
New
.
arrayList
();
...
...
h2/src/tools/org/h2/build/doc/GenerateDoc.java
浏览文件 @
2a1545d7
...
@@ -16,6 +16,7 @@ import java.sql.ResultSetMetaData;
...
@@ -16,6 +16,7 @@ import java.sql.ResultSetMetaData;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.h2.bnf.Bnf
;
import
org.h2.bnf.Bnf
;
import
org.h2.engine.Constants
;
import
org.h2.engine.Constants
;
...
@@ -69,15 +70,15 @@ public class GenerateDoc {
...
@@ -69,15 +70,15 @@ public class GenerateDoc {
// String help = "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION";
// String help = "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION";
String
help
=
"SELECT ROWNUM ID, * FROM CSVREAD('"
+
inHelp
+
"') WHERE SECTION "
;
String
help
=
"SELECT ROWNUM ID, * FROM CSVREAD('"
+
inHelp
+
"') WHERE SECTION "
;
map
(
"commands"
,
help
+
"LIKE 'Commands%' ORDER BY ID"
,
true
);
map
(
"commands"
,
help
+
"LIKE 'Commands%' ORDER BY ID"
,
true
);
map
(
"commandsDML"
,
help
+
"= 'Commands (DML)' ORDER BY ID"
,
tru
e
);
map
(
"commandsDML"
,
help
+
"= 'Commands (DML)' ORDER BY ID"
,
fals
e
);
map
(
"commandsDDL"
,
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
tru
e
);
map
(
"commandsDDL"
,
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
fals
e
);
map
(
"commandsOther"
,
help
+
"= 'Commands (Other)' ORDER BY ID"
,
tru
e
);
map
(
"commandsOther"
,
help
+
"= 'Commands (Other)' ORDER BY ID"
,
fals
e
);
map
(
"otherGrammar"
,
help
+
"= 'Other Grammar' ORDER BY ID"
,
true
);
map
(
"otherGrammar"
,
help
+
"= 'Other Grammar' ORDER BY ID"
,
true
);
map
(
"functionsAggregate"
,
help
+
"= 'Functions (Aggregate)' ORDER BY ID"
,
tru
e
);
map
(
"functionsAggregate"
,
help
+
"= 'Functions (Aggregate)' ORDER BY ID"
,
fals
e
);
map
(
"functionsNumeric"
,
help
+
"= 'Functions (Numeric)' ORDER BY ID"
,
tru
e
);
map
(
"functionsNumeric"
,
help
+
"= 'Functions (Numeric)' ORDER BY ID"
,
fals
e
);
map
(
"functionsString"
,
help
+
"= 'Functions (String)' ORDER BY ID"
,
tru
e
);
map
(
"functionsString"
,
help
+
"= 'Functions (String)' ORDER BY ID"
,
fals
e
);
map
(
"functionsTimeDate"
,
help
+
"= 'Functions (Time and Date)' ORDER BY ID"
,
tru
e
);
map
(
"functionsTimeDate"
,
help
+
"= 'Functions (Time and Date)' ORDER BY ID"
,
fals
e
);
map
(
"functionsSystem"
,
help
+
"= 'Functions (System)' ORDER BY ID"
,
tru
e
);
map
(
"functionsSystem"
,
help
+
"= 'Functions (System)' ORDER BY ID"
,
fals
e
);
map
(
"functionsAll"
,
help
+
"LIKE 'Functions%' ORDER BY SECTION, ID"
,
true
);
map
(
"functionsAll"
,
help
+
"LIKE 'Functions%' ORDER BY SECTION, ID"
,
true
);
map
(
"dataTypes"
,
help
+
"LIKE 'Data Types%' ORDER BY SECTION, ID"
,
true
);
map
(
"dataTypes"
,
help
+
"LIKE 'Data Types%' ORDER BY SECTION, ID"
,
true
);
map
(
"informationSchema"
,
"SELECT TABLE_NAME TOPIC, GROUP_CONCAT(COLUMN_NAME "
map
(
"informationSchema"
,
"SELECT TABLE_NAME TOPIC, GROUP_CONCAT(COLUMN_NAME "
...
@@ -160,6 +161,12 @@ public class GenerateDoc {
...
@@ -160,6 +161,12 @@ public class GenerateDoc {
list
.
add
(
map
);
list
.
add
(
map
);
}
}
session
.
put
(
key
,
list
);
session
.
put
(
key
,
list
);
int
div
=
3
;
int
part
=
(
list
.
size
()
+
div
-
1
)
/
div
;
for
(
int
i
=
0
,
start
=
0
;
i
<
div
;
i
++,
start
+=
part
)
{
List
<
HashMap
<
String
,
String
>>
listThird
=
list
.
subList
(
start
,
Math
.
min
(
start
+
part
,
list
.
size
()));
session
.
put
(
key
+
"-"
+
i
,
listThird
);
}
}
finally
{
}
finally
{
JdbcUtils
.
closeSilently
(
rs
);
JdbcUtils
.
closeSilently
(
rs
);
JdbcUtils
.
closeSilently
(
stat
);
JdbcUtils
.
closeSilently
(
stat
);
...
...
h2/src/tools/org/h2/build/doc/WebSite.java
浏览文件 @
2a1545d7
...
@@ -25,10 +25,9 @@ import org.h2.util.StringUtils;
...
@@ -25,10 +25,9 @@ import org.h2.util.StringUtils;
public
class
WebSite
{
public
class
WebSite
{
private
static
final
String
ANALYTICS_TAG
=
"<!-- analytics -->"
;
private
static
final
String
ANALYTICS_TAG
=
"<!-- analytics -->"
;
private
static
final
String
ANALYTICS_
AND_TRANSLATE_
SCRIPT
=
private
static
final
String
ANALYTICS_SCRIPT
=
"<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\"></script>\n"
+
"<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\"></script>\n"
+
"<script type=\"text/javascript\">var pageTracker=_gat._getTracker(\"UA-2351060-1\");pageTracker._initData();pageTracker._trackPageview();</script>\n"
+
"<script type=\"text/javascript\">var pageTracker=_gat._getTracker(\"UA-2351060-1\");pageTracker._initData();pageTracker._trackPageview();</script>"
;
"<script type=\"text/javascript\" src=\"http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit\"></script>"
;
private
static
final
String
TRANSLATE_START
=
"<!-- translate"
;
private
static
final
String
TRANSLATE_START
=
"<!-- translate"
;
private
static
final
String
TRANSLATE_END
=
"translate -->"
;
private
static
final
String
TRANSLATE_END
=
"translate -->"
;
...
@@ -139,7 +138,7 @@ public class WebSite {
...
@@ -139,7 +138,7 @@ public class WebSite {
if
(
name
.
endsWith
(
".html"
))
{
if
(
name
.
endsWith
(
".html"
))
{
String
page
=
new
String
(
bytes
,
"UTF-8"
);
String
page
=
new
String
(
bytes
,
"UTF-8"
);
if
(
web
)
{
if
(
web
)
{
page
=
StringUtils
.
replaceAll
(
page
,
ANALYTICS_TAG
,
ANALYTICS_
AND_TRANSLATE_
SCRIPT
);
page
=
StringUtils
.
replaceAll
(
page
,
ANALYTICS_TAG
,
ANALYTICS_SCRIPT
);
}
}
if
(
replaceFragments
)
{
if
(
replaceFragments
)
{
page
=
replaceFragments
(
name
,
page
);
page
=
replaceFragments
(
name
,
page
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论