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.
ALTER TABLE TEST ADD CONSTRAINT NAME_UNIQUE UNIQUE(NAME)
"
"Commands (DDL)","ALTER TABLE ALTER COLUMN","
ALTER TABLE tableName ALTER COLUMN columnName dataType
[ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ]
"Commands (DDL)","ALTER TABLE ALTER","
ALTER TABLE tableName ALTER COLUMN columnName
{ { 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.
The operation fails if the data can not be converted.
This command commits an open transaction.
","
ALTER TABLE TEST ALTER COLUMN NAME CLOB
"
Changes the data type of a column, rename a column,
change the identity value, or change the selectivity.
"Commands (DDL)","ALTER TABLE ALTER COLUMN RENAME","
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
"
Changing the data type fails if the data can not be converted.
"Commands (DDL)","ALTER TABLE ALTER COLUMN RESTART","
ALTER TABLE tableName ALTER COLUMN columnName RESTART WITH long
","
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
"
RESTART changes the next value of an auto increment column.
The column must already be an auto increment column.
For RESTART, the same transactional rules as for ALTER SEQUENCE apply.
"Commands (DDL)","ALTER TABLE ALTER COLUMN SELECTIVITY","
ALTER TABLE tableName ALTER COLUMN columnName SELECTIVITY int
","
Sets the selectivity (1-100) for a column. 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. 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
"
SELECTIVITY sets the selectivity (1-100) for a column.
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.
Selectivity 100 means values are unique, 10 means every distinct value appears 10 times on average.
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET DEFAULT","
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
"
SET DEFAULT changes the default value of a column.
"Commands (DDL)","ALTER TABLE ALTER COLUMN SET NULL","
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
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.
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 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","
...
...
@@ -1394,81 +1366,73 @@ Admin rights are required to execute this command.
SHUTDOWN
"
"Other Grammar","
Comment
s","
-- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
"Other Grammar","
Alia
s","
name
","
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.
An alias is a name that is only valid in the context of the statement.
","
// This is a comment
A
"
"Other Grammar","
Order
","
{ int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST }
]
"Other Grammar","
And Condition
","
condition [ { AND condition } [...]
]
","
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.
Value or condition.
","
NAME DESC NULLS LAST
ID=1 AND NAME='Hi'
"
"Other Grammar","Constraint","
[ constraintNameDefinition ] {
CHECK expression | UNIQUE ( columnName [,...] )
| referentialConstraint }
| PRIMARY KEY [ HASH ] ( columnName [,...] )
"Other Grammar","Array","
( expression [,...] )
","
Defines a constraint. The check condition must evaluate to true or to NULL (to
prevent NULL, use NOT NULL).
An array of values.
","
PRIMARY KEY(ID, NAME
)
(1, 2
)
"
"Other Grammar","
Constraint Name Definitio
n","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
"Other Grammar","
Boolea
n","
TRUE | FALSE
","
Defines a constraint nam
e.
A boolean valu
e.
","
CONSTRAINT CONST_ID
TRUE
"
"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 } } ]
"Other Grammar","Bytes","
X'hex'
","
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.
A binary value. The hex value is not case sensitive.
","
FOREIGN KEY(ID) REFERENCES TEST(ID)
X'01FF'
"
"Other Grammar","Table Expression","
{ [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN tableExpression [ ON expression ] ]
"Other Grammar","Case","
CASE expression { WHEN expression THEN expression } [...]
[ ELSE expression ] END
","
Joins a table. The join expression is not supported for cross and natural joins.
A natural join is an inner join, where the condition is automatically on the
columns with the same name.
Returns the first expression where the value is equal to the test expression. If
no else part is specified, return NULL.
","
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","
columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
"Other Grammar","Case When","
CASE { WHEN expression THEN expression} [...]
[ ELSE expression ] END
","
Indexes this column in ascending or descending order. Usually it is not required
to specify the order; however doing so will speed up large queries that order
the column in the same way.
Returns the first expression where the condition is true. If no else part is
specified, return NULL.
","
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","
...
...
@@ -1486,20 +1450,22 @@ CREATE TABLE(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT '');
CREATE TABLE(ID BIGINT IDENTITY);
"
"Other Grammar","
Expression
","
andCondition [ { OR andCondition } [...] ]
"Other Grammar","
Comments
","
-- 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
","
condition [ { AND condition } [...] ]
"Other Grammar","
Compare
","
<> | <= | >= | = | < | > | !=
","
Value or condition
.
Comparison operator. The operator != is the same as <>
.
","
ID=1 AND NAME='Hi'
<>
"
"Other Grammar","Condition","
...
...
@@ -1532,164 +1498,130 @@ See Java Matcher.find for details.
LIKE 'Jo%'
"
"Other Grammar","Compare","
<> | <= | >= | = | < | > | !=
","
Comparison operator. The operator != is the same as <>.
","
<>
"
"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 } [...] ]
"Other Grammar","Constraint","
[ constraintNameDefinition ] {
CHECK expression | UNIQUE ( columnName [,...] )
| referentialConstraint }
| PRIMARY KEY [ HASH ] ( columnName [,...] )
","
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","
value
| columnName
| ?[ int ]
| NEXT VALUE FOR sequenceName
| function
| { - | + } term
| ( expression )
| select
| case
| caseWhen
| tableAlias.columnName
"Other Grammar","Constraint Name Definition","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
","
A value. Parameters can be indexed, for example ?1 meaning the first parameter
.
Defines a constraint name
.
","
'Hello'
CONSTRAINT CONST_ID
"
"Other Grammar","Value","
string | dollarQuotedString | hexNumber | int | long | decimal | double
| date | time | timestamp | boolean | bytes | array | null
"Other Grammar","Csv Options","
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]]
","
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","
CASE expression { WHEN expression THEN expression } [...]
[ ELSE expression ] END
"Other Grammar","Data Type","
intType | booleanType | tinyintType | smallintType | bigintType | identityType
| 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
no else part is specified, return NULL.
A data type definition.
","
CASE CNT WHEN 0 THEN 'No' WHEN 1 THEN 'One' ELSE 'Some' END
INT
"
"Other Grammar","Case When","
CASE { WHEN expression THEN expression} [...]
[ ELSE expression ] END
"Other Grammar","Date","
DATE 'yyyy-MM-dd'
","
Returns the first expression where the condition is true. If no else part is
specified, return NULL.
A date literal. The limitations are the same as for the Java data type
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
","
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]
]
"Other Grammar","
Decimal
","
[ + | - ] 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
","
{ AES | XTEA }
"Other Grammar","
Digit
","
0-9
","
Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds). The AES
algorithm is about half as fast as XTEA.
A digit.
","
AES
0
"
"Other Grammar","
Select Expression
","
* | expression [ [ AS ] columnAlias ] | tableAlias.*
"Other Grammar","
Dollar Quoted String
","
$$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","
intType | booleanType | tinyintType | smallintType | bigintType | identityType
| decimalType | doubleType | realType | dateType | timeType | timestampType
| binaryType | otherType | varcharType | varcharIgnorecaseType | charType
| blobType | clobType | uuidType | arrayType
"Other Grammar","Double","
[ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
","
A data type definition
.
The limitations are the same as for the Java data type Double
.
","
INT
-1.4e-10
"
"Other Grammar","
Name
","
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
"Other Grammar","
Expression
","
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
","
name
"Other Grammar","
Factor
","
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
","
""anythingExceptDoubleQuote""
"Other Grammar","
Hex
","
{ { digit | a-f | A-F } { digit | a-f | A-F } } [...]
","
Quoted names are case sensitive, and can contain spaces. There is no maximum
name length. Two double quotes can be used to create a single double quote
inside an identifier.
The hexadecimal representation of a number or of bytes. Two characters are one
byte.
","
""FirstName""
cafe
"
"Other Grammar","
String
","
'anythingExceptSingleQuote'
"Other Grammar","
Hex Number
","
[ + | - ] 0x hex
","
A string starts and ends with a single quote. Two single quotes can be used to
create a single quote inside a string.
A number written in hexadecimal notation.
","
'John''s car'
0xff
"
"Other Grammar","
Dollar Quoted String
","
$$anythingExceptTwoDollarSigns$$
"Other Grammar","
Index Column
","
columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
","
A string starts and ends with two dollar signs. Two dollar signs are not allow
ed
within the text. A whitespace is required before the first set of dollar signs.
No escaping is required within the text
.
Indexes this column in ascending or descending order. Usually it is not requir
ed
to specify the order; however doing so will speed up large queries that order
the column in the same way
.
","
$$John's car$$
NAME
"
"Other Grammar","Int","
...
...
@@ -1708,28 +1640,20 @@ Long numbers are between -9223372036854775808 and 9223372036854775807.
100000
"
"Other Grammar","Hex Number","
[ + | - ] 0x hex
","
A number written in hexadecimal notation.
","
0xff
"
"Other Grammar","Decimal","
[ + | - ] number [ . number ]
"Other Grammar","Name","
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
","
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
","
[ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
"Other Grammar","
Null
","
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","
...
...
@@ -1740,81 +1664,129 @@ The maximum length of the number depends on the data type used.
100
"
"Other Grammar","
Date
","
DATE 'yyyy-MM-dd'
"Other Grammar","
Operand
","
summand [ { || summand } [...] ]
","
A date literal. The limitations are the same as for the Java data type
java.sql.Date, but for compatibility with other databases the suggested minimum
and maximum years are 0001 and 9999.
A value or a concatenation of values.
","
DATE '2004-12-31
'
'Hi' || ' Eva
'
"
"Other Grammar","
Time
","
TIME 'hh:mm:ss'
"Other Grammar","
Order
","
{ 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
","
TIMESTAMP 'yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]'
"Other Grammar","
Quoted Name
","
""anythingExceptDoubleQuote""
","
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
.
Quoted names are case sensitive, and can contain spaces. There is no maximum
name length. Two double quotes can be used to create a single double quote
inside an identifier
.
","
TIMESTAMP '2005-12-31 23:59:59'
""FirstName""
"
"Other Grammar","Boolean","
TRUE | FALSE
"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 } } ]
","
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
","
X'hex'
"Other Grammar","
Select Expression
","
* | 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
","
( expression [,...] )
"Other Grammar","
String
","
'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
","
NULL
"Other Grammar","
Summand
","
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","
{ { digit | a-f | A-F } { digit | a-f | A-F } } [...]
"Other Grammar","Table Expression","
{ [ 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
byte.
Joins a table. The join expression is not supported for cross and natural joins.
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","
0-9
"Other Grammar","Term","
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","
...
...
h2/src/docsrc/html/datatypes.html
浏览文件 @
2a1545d7
...
...
@@ -16,11 +16,33 @@ Data Types
<!-- } -->
<h1>
Data Types
</h1>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="dataTypes">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</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"
>
<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
<code>
ResultSetMetaData.getColumnName()
</code>
should return the name of the column
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>
.
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>
,
or set the system property
<a
href=
"../javadoc/org/h2/constant/SysProperties.html#h2.aliasColumnName"
><code>
h2.aliasColumnName
</code></a>
.
</p>
...
...
h2/src/docsrc/html/fragments.html
浏览文件 @
2a1545d7
...
...
@@ -24,7 +24,7 @@ Initial Developer: H2 Group
<td
class=
"search"
colspan=
"2"
>
<!-- translate
<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>
translate -->
</td>
...
...
@@ -94,7 +94,18 @@ translate -->
</div></td></tr></table>
<script
type=
"text/javascript"
src=
"index.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
<h1>
Functions
</h1>
<h2>
Aggregate Functions
</h2>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="functionsAggregate">
<a href="#${item.link}" >${item.topic}</a><br />
</c:forEach>
</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>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="functionsNumeric">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</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>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="functionsString">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</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>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="functionsTimeDate">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</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>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="functionsSystem">
<a
href=
"#${item.link}"
>
${item.topic}
</a><br
/>
<a href="#${item.link}"
>${item.topic}</a><br />
</c:forEach>
</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"
>
<h3
id=
"${item.link}"
class=
"notranslate"
>
${item.topic}
</h3>
...
...
h2/src/docsrc/html/grammar.html
浏览文件 @
2a1545d7
...
...
@@ -17,32 +17,116 @@ SQL Grammar
<h1>
SQL Grammar
</h1>
<h2>
Commands (Data Manipulation)
</h2>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="commandsDML">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</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>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="commandsDDL">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</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>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="commandsOther">
<a href="#${item.link}">${item.topic}</a><br />
</c:forEach>
</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>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="otherGrammar">
<a href="#${item.link}" >${item.topic}</a><br />
</c:forEach>
</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>
<p
class=
"notranslate"
>
...
...
h2/src/docsrc/html/stylesheet.css
浏览文件 @
2a1545d7
...
...
@@ -214,6 +214,29 @@ td.content {
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
{
border
:
0px
;
padding
:
0px
;
...
...
h2/src/docsrc/html/stylesheetPdf.css
浏览文件 @
2a1545d7
...
...
@@ -131,3 +131,25 @@ em.u {
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."
ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
","
Adds a constraint to a table."
"Commands (DDL)","ALTER TABLE ALTER COLUMN","
ALTER TABLE tableName ALTER COLUMN columnName dataType
[ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ]
","
Changes the data type of a column."
"Commands (DDL)","ALTER TABLE ALTER COLUMN RENAME","
ALTER TABLE tableName ALTER COLUMN columnName RENAME TO name
","
Renames a column."
"Commands (DDL)","ALTER TABLE ALTER COLUMN RESTART","
ALTER TABLE tableName ALTER COLUMN columnName RESTART WITH long
","
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 ALTER","
ALTER TABLE tableName ALTER COLUMN columnName
{ { 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, rename a column,
change the identity value, or change the selectivity."
"Commands (DDL)","ALTER TABLE DROP COLUMN","
ALTER TABLE tableName DROP COLUMN columnName
","
...
...
@@ -480,56 +463,54 @@ SHUTDOWN [ IMMEDIATELY | COMPACT | SCRIPT ]
","
This statement is closes all open connections to the database and closes the
database."
"Other Grammar","
Comment
s","
-- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
"Other Grammar","
Alia
s","
name
","
Comments can be used anywhere in a command and are ignored by the database
."
"Other Grammar","
Order
","
{ int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST }
]
An alias is a name that is only valid in the context of the statement
."
"Other Grammar","
And Condition
","
condition [ { AND condition } [...]
]
","
Sorts the result by the given column number, or by an expression."
"Other Grammar","Constraint","
[ constraintNameDefinition ] {
CHECK expression | UNIQUE ( columnName [,...] )
| referentialConstraint }
| PRIMARY KEY [ HASH ] ( columnName [,...] )
Value or condition."
"Other Grammar","Array","
( expression [,...] )
","
Defines a constraint
."
"Other Grammar","
Constraint Name Definitio
n","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
An array of values
."
"Other Grammar","
Boolea
n","
TRUE | FALSE
","
Defines a constraint name."
"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 } } ]
A boolean value."
"Other Grammar","Bytes","
X'hex'
","
Defines a referential constraint."
"Other Grammar","Table Expression","
{ [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN tableExpression [ ON expression ] ]
A binary value."
"Other Grammar","Case","
CASE expression { WHEN expression THEN expression } [...]
[ ELSE expression ] END
","
Joins a table."
"Other Grammar","Index Column","
columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
Returns the first expression where the value is equal to the test expression."
"Other Grammar","Case When","
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","
columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT ] NULL ]
[ { AUTO_INCREMENT | IDENTITY } [ ( startInt [, incrementInt ] ) ] ]
[ SELECTIVITY selectivity ] [ PRIMARY KEY [ HASH ] | UNIQUE ]
","
Default expressions are used if no explicit value was used when adding a row."
"Other Grammar","
Expression
","
andCondition [ { OR andCondition } [...] ]
"Other Grammar","
Comments
","
-- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
","
Value or condition
."
"Other Grammar","
And Condition
","
condition [ { AND condition } [...] ]
Comments can be used anywhere in a command and are ignored by the database
."
"Other Grammar","
Compare
","
<> | <= | >= | = | < | > | !=
","
Value or condition
."
Comparison operator
."
"Other Grammar","Condition","
operand [ conditionRightHandSide ] | NOT condition | EXISTS ( select )
","
...
...
@@ -543,63 +524,21 @@ compare { { { ALL | ANY | SOME } ( select ) } | operand }
| [ NOT ] REGEXP operand
","
The right hand side of a condition."
"Other Grammar","Compare","
<> | <= | >= | = | < | > | !=
","
Comparison operator."
"Other Grammar","Operand","
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
"Other Grammar","Constraint","
[ constraintNameDefinition ] {
CHECK expression | UNIQUE ( columnName [,...] )
| referentialConstraint }
| PRIMARY KEY [ HASH ] ( columnName [,...] )
","
Returns the first expression where the value is equal to the test expression."
"Other Grammar","Case When","
CASE { WHEN expression THEN expression} [...]
[ ELSE expression ] END
Defines a constraint."
"Other Grammar","Constraint Name Definition","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
","
Returns the first expression where the condition is tru
e."
Defines a constraint nam
e."
"Other Grammar","Csv Options","
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]]
","
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","
intType | booleanType | tinyintType | smallintType | bigintType | identityType
| decimalType | doubleType | realType | dateType | timeType | timestampType
...
...
@@ -607,26 +546,46 @@ intType | booleanType | tinyintType | smallintType | bigintType | identityType
| blobType | clobType | uuidType | arrayType
","
A data type definition."
"Other Grammar","Name","
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
","
Names are not case sensitive."
"Other Grammar","Alias","
name
"Other Grammar","Date","
DATE 'yyyy-MM-dd'
","
A
n alias is a name that is only valid in the context of the statement
."
"Other Grammar","
Quoted Name
","
""anythingExceptDoubleQuote""
A
date literal
."
"Other Grammar","
Decimal
","
[ + | - ] number [ . number ]
","
Quoted names are case sensitive, and can contain spaces
."
"Other Grammar","
String
","
'anythingExceptSingleQuote'
Number with fixed precision and scale
."
"Other Grammar","
Digit
","
0-9
","
A
string starts and ends with a single quote
."
A
digit
."
"Other Grammar","Dollar Quoted String","
$$anythingExceptTwoDollarSigns$$
","
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","
[ + | - ] number
","
...
...
@@ -635,26 +594,69 @@ The maximum integer number is 2147483647, the minimum is -2147483648."
[ + | - ] number
","
Long numbers are between -9223372036854775808 and 9223372036854775807."
"Other Grammar","Hex Number","
[ + | - ] 0x hex
","
A number written in hexadecimal notation."
"Other Grammar","Decimal","
[ + | - ] number [ . number ]
"Other Grammar","Name","
{ { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
","
N
umber with fixed precision and scal
e."
"Other Grammar","
Double
","
[ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
N
ames are not case sensitiv
e."
"Other Grammar","
Null
","
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","
digit [...]
","
The maximum length of the number depends on the data type used."
"Other Grammar","
Date
","
DATE 'yyyy-MM-dd'
"Other Grammar","
Operand
","
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","
TIME 'hh:mm:ss'
","
...
...
@@ -663,30 +665,11 @@ A time literal."
TIMESTAMP 'yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]'
","
A timestamp literal."
"Other Grammar","Boolean","
TRUE | FALSE
","
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
"Other Grammar","Value","
string | dollarQuotedString | hexNumber | int | long | decimal | double
| date | time | timestamp | boolean | bytes | array | null
","
A
digit
."
A
value of any data type, or null
."
"Data Types","INT Type","
INT | INTEGER | MEDIUMINT | INT4 | SIGNED
","
...
...
h2/src/main/org/h2/server/web/PageParser.java
浏览文件 @
2a1545d7
...
...
@@ -7,8 +7,8 @@
package
org
.
h2
.
server
.
web
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.h2.util.New
;
...
...
@@ -92,7 +92,7 @@ public class PageParser {
String
items
=
readParam
(
"items"
);
read
(
">"
);
int
start
=
pos
;
ArrayList
<
Object
>
list
=
(
Array
List
<
Object
>)
get
(
items
);
List
<
Object
>
list
=
(
List
<
Object
>)
get
(
items
);
if
(
list
==
null
)
{
result
.
append
(
"?items?"
);
list
=
New
.
arrayList
();
...
...
h2/src/tools/org/h2/build/doc/GenerateDoc.java
浏览文件 @
2a1545d7
...
...
@@ -16,6 +16,7 @@ import java.sql.ResultSetMetaData;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.h2.bnf.Bnf
;
import
org.h2.engine.Constants
;
...
...
@@ -69,15 +70,15 @@ public class GenerateDoc {
// String help = "SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION";
String
help
=
"SELECT ROWNUM ID, * FROM CSVREAD('"
+
inHelp
+
"') WHERE SECTION "
;
map
(
"commands"
,
help
+
"LIKE 'Commands%' ORDER BY ID"
,
true
);
map
(
"commandsDML"
,
help
+
"= 'Commands (DML)' ORDER BY ID"
,
tru
e
);
map
(
"commandsDDL"
,
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
tru
e
);
map
(
"commandsOther"
,
help
+
"= 'Commands (Other)' ORDER BY ID"
,
tru
e
);
map
(
"commandsDML"
,
help
+
"= 'Commands (DML)' ORDER BY ID"
,
fals
e
);
map
(
"commandsDDL"
,
help
+
"= 'Commands (DDL)' ORDER BY ID"
,
fals
e
);
map
(
"commandsOther"
,
help
+
"= 'Commands (Other)' ORDER BY ID"
,
fals
e
);
map
(
"otherGrammar"
,
help
+
"= 'Other Grammar' ORDER BY ID"
,
true
);
map
(
"functionsAggregate"
,
help
+
"= 'Functions (Aggregate)' ORDER BY ID"
,
tru
e
);
map
(
"functionsNumeric"
,
help
+
"= 'Functions (Numeric)' ORDER BY ID"
,
tru
e
);
map
(
"functionsString"
,
help
+
"= 'Functions (String)' ORDER BY ID"
,
tru
e
);
map
(
"functionsTimeDate"
,
help
+
"= 'Functions (Time and Date)' ORDER BY ID"
,
tru
e
);
map
(
"functionsSystem"
,
help
+
"= 'Functions (System)' ORDER BY ID"
,
tru
e
);
map
(
"functionsAggregate"
,
help
+
"= 'Functions (Aggregate)' ORDER BY ID"
,
fals
e
);
map
(
"functionsNumeric"
,
help
+
"= 'Functions (Numeric)' ORDER BY ID"
,
fals
e
);
map
(
"functionsString"
,
help
+
"= 'Functions (String)' ORDER BY ID"
,
fals
e
);
map
(
"functionsTimeDate"
,
help
+
"= 'Functions (Time and Date)' ORDER BY ID"
,
fals
e
);
map
(
"functionsSystem"
,
help
+
"= 'Functions (System)' ORDER BY ID"
,
fals
e
);
map
(
"functionsAll"
,
help
+
"LIKE 'Functions%' 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 "
...
...
@@ -160,6 +161,12 @@ public class GenerateDoc {
list
.
add
(
map
);
}
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
{
JdbcUtils
.
closeSilently
(
rs
);
JdbcUtils
.
closeSilently
(
stat
);
...
...
h2/src/tools/org/h2/build/doc/WebSite.java
浏览文件 @
2a1545d7
...
...
@@ -25,10 +25,9 @@ import org.h2.util.StringUtils;
public
class
WebSite
{
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 type=\"text/javascript\">var pageTracker=_gat._getTracker(\"UA-2351060-1\");pageTracker._initData();pageTracker._trackPageview();</script>\n"
+
"<script type=\"text/javascript\" src=\"http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit\"></script>"
;
"<script type=\"text/javascript\">var pageTracker=_gat._getTracker(\"UA-2351060-1\");pageTracker._initData();pageTracker._trackPageview();</script>"
;
private
static
final
String
TRANSLATE_START
=
"<!-- translate"
;
private
static
final
String
TRANSLATE_END
=
"translate -->"
;
...
...
@@ -139,7 +138,7 @@ public class WebSite {
if
(
name
.
endsWith
(
".html"
))
{
String
page
=
new
String
(
bytes
,
"UTF-8"
);
if
(
web
)
{
page
=
StringUtils
.
replaceAll
(
page
,
ANALYTICS_TAG
,
ANALYTICS_
AND_TRANSLATE_
SCRIPT
);
page
=
StringUtils
.
replaceAll
(
page
,
ANALYTICS_TAG
,
ANALYTICS_SCRIPT
);
}
if
(
replaceFragments
)
{
page
=
replaceFragments
(
name
,
page
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论