提交 2a1545d7 authored 作者: Thomas Mueller's avatar Thomas Mueller

HTML railroad diagrams

上级 11095888
...@@ -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","Comments"," "Other Grammar","Alias","
-- 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 Definition"," "Other Grammar","Boolean","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName TRUE | FALSE
"," ","
Defines a constraint name. A boolean value.
"," ","
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.ID CASE CNT WHEN 0 THEN 'No' WHEN 1 THEN 'One' ELSE 'Some' END
" "
"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 } [...] ]
"," ","
An 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 allowed Indexes this column in ascending or descending order. Usually it is not required
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 ]
"," ","
Number with fixed precision and scale. Names 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. An 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","
......
...@@ -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>
......
...@@ -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 standard). Other database don't work like this (they don't follow the JDBC specification).
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>
......
...@@ -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>
<!-- } --> <!-- } -->
......
...@@ -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>
......
...@@ -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">
......
...@@ -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;
......
...@@ -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;
}
...@@ -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","Comments"," "Other Grammar","Alias","
-- 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 Definition"," "Other Grammar","Boolean","
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 true." Defines a constraint name."
"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
"," ","
An 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 ]
"," ","
Number with fixed precision and scale." Names are not case sensitive."
"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
"," ","
......
...@@ -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 = (ArrayList<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();
......
...@@ -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", true); map("commandsDML", help + "= 'Commands (DML)' ORDER BY ID", false);
map("commandsDDL", help + "= 'Commands (DDL)' ORDER BY ID", true); map("commandsDDL", help + "= 'Commands (DDL)' ORDER BY ID", false);
map("commandsOther", help + "= 'Commands (Other)' ORDER BY ID", true); map("commandsOther", help + "= 'Commands (Other)' ORDER BY ID", false);
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", true); map("functionsAggregate", help + "= 'Functions (Aggregate)' ORDER BY ID", false);
map("functionsNumeric", help + "= 'Functions (Numeric)' ORDER BY ID", true); map("functionsNumeric", help + "= 'Functions (Numeric)' ORDER BY ID", false);
map("functionsString", help + "= 'Functions (String)' ORDER BY ID", true); map("functionsString", help + "= 'Functions (String)' ORDER BY ID", false);
map("functionsTimeDate", help + "= 'Functions (Time and Date)' ORDER BY ID", true); map("functionsTimeDate", help + "= 'Functions (Time and Date)' ORDER BY ID", false);
map("functionsSystem", help + "= 'Functions (System)' ORDER BY ID", true); map("functionsSystem", help + "= 'Functions (System)' ORDER BY ID", false);
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);
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论