提交 31ed2e1e authored 作者: Thomas Mueller's avatar Thomas Mueller

HTML railroad diagrams

上级 c4ae4586
...@@ -4,29 +4,39 @@ ...@@ -4,29 +4,39 @@
# Initial Developer: H2 Group # Initial Developer: H2 Group
"SECTION","TOPIC","SYNTAX","TEXT","EXAMPLE" "SECTION","TOPIC","SYNTAX","TEXT","EXAMPLE"
"Commands (DML)","SELECT"," "Commands (DML)","SELECT","
{SELECT selectPart FROM fromPart | FROM fromPart SELECT selectPart} SELECT [ TOP term ] [ DISTINCT | ALL ] selectExpression [,...]
[WHERE expression] [GROUP BY expression [,...]] [HAVING expression] FROM tableExpression [,...] [ WHERE expression ]
[{UNION [ALL] | MINUS | EXCEPT | INTERSECT} select] [ GROUP BY expression [,...] ] [ HAVING expression ]
[ORDER BY order [,...]] [LIMIT expression [OFFSET expression] [ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } select ] [ ORDER BY order [,...] ]
[SAMPLE_SIZE rowCountInt]] [FOR UPDATE] [ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ]
[ FOR UPDATE ]","
"," ","
Selects data from a table or multiple tables. Selects data from a table or multiple tables.
GROUP BY groups the the result by the given expression(s).
HAVING filter rows after grouping.
ORDER BY sorts the result by the given column(s) or expression(s).
UNION combines the result of this query with the results of another query.
LIMIT limits the number of rows returned by the query, OFFSET specified how many LIMIT limits the number of rows returned by the query, OFFSET specified
rows to skip. SAMPLE_SIZE limits the number of rows read for aggregate queries. how many rows to skip. SAMPLE_SIZE limits the number of rows read for
If FOR UPDATE is specified, the tables are locked for writing. aggregate queries.
FOR UPDATE will lock the table for writing. If FOR UPDATE is specified, the tables are locked for writing.
"," ","
SELECT * FROM TEST; SELECT * FROM TEST;
SELECT * FROM TEST ORDER BY NAME;
SELECT ID, COUNT(*) FROM TEST GROUP BY ID;
SELECT NAME, COUNT(*) FROM TEST GROUP BY NAME HAVING COUNT(*) > 2;
SELECT 'ID' COL, MAX(ID) AS MAX FROM TEST UNION SELECT 'NAME', MAX(NAME) FROM TEST;
SELECT * FROM TEST LIMIT 1000;
SELECT * FROM (SELECT ID, COUNT(*) FROM TEST SELECT * FROM (SELECT ID, COUNT(*) FROM TEST
GROUP BY ID UNION SELECT NULL, COUNT(*) FROM TEST) GROUP BY ID UNION SELECT NULL, COUNT(*) FROM TEST)
ORDER BY 1 NULLS LAST; ORDER BY 1 NULLS LAST;
" "
"Commands (DML)","INSERT"," "Commands (DML)","INSERT","
INSERT INTO tableName [(columnName [,...])] INSERT INTO tableName [ ( columnName [,...] ) ]
{VALUES {( [{DEFAULT | expression} [,...]] )} [,...] | select} { VALUES { ( [ { DEFAULT | expression } [,...] ] ) } [,...] | select }
"," ","
Inserts a new row / new rows into a table. Inserts a new row / new rows into a table.
"," ","
...@@ -34,8 +44,8 @@ INSERT INTO TEST VALUES(1, 'Hello') ...@@ -34,8 +44,8 @@ INSERT INTO TEST VALUES(1, 'Hello')
" "
"Commands (DML)","UPDATE"," "Commands (DML)","UPDATE","
UPDATE tableName SET {columnName= {DEFAULT | expression} } [,...] UPDATE tableName SET { columnName= { DEFAULT | expression } } [,...]
[WHERE expression] [ WHERE expression ]
"," ","
Updates data in a table. Updates data in a table.
"," ","
...@@ -43,7 +53,7 @@ UPDATE TEST SET NAME='Hi' WHERE ID=1 ...@@ -43,7 +53,7 @@ UPDATE TEST SET NAME='Hi' WHERE ID=1
" "
"Commands (DML)","DELETE"," "Commands (DML)","DELETE","
DELETE FROM tableName [WHERE expression] DELETE FROM tableName [ WHERE expression ]
"," ","
Deletes rows form a table. Deletes rows form a table.
"," ","
...@@ -68,7 +78,7 @@ CALL 15*25 ...@@ -68,7 +78,7 @@ CALL 15*25
" "
"Commands (DML)","EXPLAIN"," "Commands (DML)","EXPLAIN","
EXPLAIN [PLAN FOR] {select | insert | update | delete} EXPLAIN [ PLAN FOR ] { select | insert | update | delete }
"," ","
Shows the execution plan for a statement. Shows the execution plan for a statement.
"," ","
...@@ -76,8 +86,9 @@ EXPLAIN SELECT * FROM TEST WHERE ID=1 ...@@ -76,8 +86,9 @@ EXPLAIN SELECT * FROM TEST WHERE ID=1
" "
"Commands (DML)","MERGE"," "Commands (DML)","MERGE","
MERGE INTO tableName [(columnName [,...])] [KEY(columnName [,...])] MERGE INTO tableName [ ( columnName [,...] ) ]
{VALUES {( [{DEFAULT | expression} [,...]] )} [,...] | select} [ KEY ( columnName [,...] ) ]
{ VALUES { ( [ { DEFAULT | expression } [,...] ] ) } [,...] | select }
"," ","
Updates existing rows, and insert rows that don't exist. If no key column is Updates existing rows, and insert rows that don't exist. If no key column is
specified, the primary key columns are used to find the row. If more than one specified, the primary key columns are used to find the row. If more than one
...@@ -90,9 +101,9 @@ MERGE INTO TEST KEY(ID) VALUES(2, 'World') ...@@ -90,9 +101,9 @@ MERGE INTO TEST KEY(ID) VALUES(2, 'World')
"Commands (DML)","RUNSCRIPT"," "Commands (DML)","RUNSCRIPT","
RUNSCRIPT FROM fileNameString RUNSCRIPT FROM fileNameString
[COMPRESSION {DEFLATE|LZF|ZIP|GZIP}] [ COMPRESSION { DEFLATE | LZF | ZIP | GZIP } ]
[CIPHER cipher PASSWORD string] [ CIPHER cipher PASSWORD string ]
[CHARSET charsetString] [ CHARSET charsetString ]
"," ","
Runs a SQL script from a file. The script is a text file containing SQL Runs a SQL script from a file. The script is a text file containing SQL
statements; each statement must end with ';'. This command can be used to statements; each statement must end with ';'. This command can be used to
...@@ -109,20 +120,25 @@ RUNSCRIPT FROM 'backup' ...@@ -109,20 +120,25 @@ RUNSCRIPT FROM 'backup'
" "
"Commands (DML)","SCRIPT"," "Commands (DML)","SCRIPT","
SCRIPT [SIMPLE] [NODATA] [NOPASSWORDS] [NOSETTINGS] [DROP] SCRIPT [ SIMPLE ] [ NODATA ] [ NOPASSWORDS ] [ NOSETTINGS ]
[BLOCKSIZE blockSizeInt] [TO fileNameString [ DROP ] [ BLOCKSIZE blockSizeInt ]
[COMPRESSION {DEFLATE|LZF|ZIP|GZIP}] [ TO fileNameString [ COMPRESSION { DEFLATE | LZF | ZIP | GZIP } ]
[CIPHER cipher PASSWORD string]] [ CIPHER cipher PASSWORD string ] ]
"," ","
Creates a SQL script with or without the insert statements. The simple format Creates a SQL script from the database.
does not use multi-row insert statements. If no file name is specified, the
SIMPLE does not use multi-row insert statements.
NODATA will not emit INSERT statements.
If the DROP option is specified, drop statements are created for tables, views,
and sequences. If the block size is set, CLOB and BLOB values larger than this
size are split into separate blocks.
If no file name is specified, the
script is returned as a result set. This command can be used to create a backup script is returned as a result set. This command can be used to create a backup
of the database. For long term storage, it is more portable than copying the of the database. For long term storage, it is more portable than copying the
database files. database files.
If the DROP option is specified, drop statements are created for tables, views, If a file name is specified, then the whole
and sequences. If the block size is set, CLOB and BLOB values larger than this
size are split into separate blocks. If a file name is specified, then the whole
script (including insert statements) is written to this file, and a result set script (including insert statements) is written to this file, and a result set
without the insert statements is returned. When using encryption, only DEFLATE without the insert statements is returned. When using encryption, only DEFLATE
and LZF are supported (LZF is faster but uses more space). and LZF are supported (LZF is faster but uses more space).
...@@ -134,8 +150,8 @@ SCRIPT NODATA ...@@ -134,8 +150,8 @@ SCRIPT NODATA
" "
"Commands (DML)","SHOW"," "Commands (DML)","SHOW","
SHOW { SCHEMAS | TABLES [FROM schemaName] | SHOW { SCHEMAS | TABLES [ FROM schemaName ] |
COLUMNS FROM tableName [FROM schemaName] } COLUMNS FROM tableName [ FROM schemaName ] }
"," ","
Lists the schemas, tables, or the columns of a table. Lists the schemas, tables, or the columns of a table.
"," ","
...@@ -152,7 +168,7 @@ ALTER INDEX IDXNAME RENAME TO IDX_TEST_NAME ...@@ -152,7 +168,7 @@ ALTER INDEX IDXNAME RENAME TO IDX_TEST_NAME
" "
"Commands (DDL)","ALTER SEQUENCE"," "Commands (DDL)","ALTER SEQUENCE","
ALTER SEQUENCE sequenceName [RESTART WITH long] [INCREMENT BY long] ALTER SEQUENCE sequenceName [ RESTART WITH long ] [ INCREMENT BY long ]
"," ","
Changes the next value and the increment of a sequence. Changes the next value and the increment of a sequence.
This command does not commit the current transaction; however the new value is used by other This command does not commit the current transaction; however the new value is used by other
...@@ -162,8 +178,8 @@ ALTER SEQUENCE SEQ_ID RESTART WITH 1000 ...@@ -162,8 +178,8 @@ ALTER SEQUENCE SEQ_ID RESTART WITH 1000
" "
"Commands (DDL)","ALTER TABLE ADD"," "Commands (DDL)","ALTER TABLE ADD","
ALTER TABLE tableName ADD name dataType [DEFAULT expression] ALTER TABLE tableName ADD name dataType [ DEFAULT expression ]
[[NOT] NULL] [AUTO_INCREMENT | IDENTITY] [BEFORE columnName] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] [ BEFORE columnName ]
"," ","
Adds a new column to a table. Adds a new column to a table.
This command commits an open transaction. This command commits an open transaction.
...@@ -172,7 +188,7 @@ ALTER TABLE TEST ADD CREATEDATE TIMESTAMP ...@@ -172,7 +188,7 @@ ALTER TABLE TEST ADD CREATEDATE TIMESTAMP
" "
"Commands (DDL)","ALTER TABLE ADD CONSTRAINT"," "Commands (DDL)","ALTER TABLE ADD CONSTRAINT","
ALTER TABLE tableName ADD constraint [CHECK|NOCHECK] ALTER TABLE tableName ADD constraint [ CHECK | NOCHECK ]
"," ","
Adds a constraint to a table. If NOCHECK is specified, existing rows are not Adds a constraint to a table. If NOCHECK is specified, existing rows are not
checked for consistency (the default is to check consistency for existing rows). checked for consistency (the default is to check consistency for existing rows).
...@@ -184,7 +200,7 @@ ALTER TABLE TEST ADD CONSTRAINT NAME_UNIQUE UNIQUE(NAME) ...@@ -184,7 +200,7 @@ ALTER TABLE TEST ADD CONSTRAINT NAME_UNIQUE UNIQUE(NAME)
"Commands (DDL)","ALTER TABLE ALTER COLUMN"," "Commands (DDL)","ALTER TABLE ALTER COLUMN","
ALTER TABLE tableName ALTER COLUMN columnName dataType ALTER TABLE tableName ALTER COLUMN columnName dataType
[DEFAULT expression] [NOT [NULL]] [AUTO_INCREMENT | IDENTITY] [ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ]
"," ","
Changes the data type of a column. Changes the data type of a column.
The operation fails if the data can not be converted. The operation fails if the data can not be converted.
...@@ -262,8 +278,7 @@ ALTER TABLE TEST DROP COLUMN NAME ...@@ -262,8 +278,7 @@ ALTER TABLE TEST DROP COLUMN NAME
" "
"Commands (DDL)","ALTER TABLE DROP CONSTRAINT"," "Commands (DDL)","ALTER TABLE DROP CONSTRAINT","
ALTER TABLE tableName DROP ALTER TABLE tableName DROP { CONSTRAINT [ IF EXISTS ] constraintName | PRIMARY KEY }
{CONSTRAINT [IF EXISTS] constraintName | PRIMARY KEY}
"," ","
Removes a constraint or a primary key from a table. Removes a constraint or a primary key from a table.
This command commits an open transaction. This command commits an open transaction.
...@@ -273,7 +288,7 @@ ALTER TABLE TEST DROP CONSTRAINT UNIQUE_NAME ...@@ -273,7 +288,7 @@ ALTER TABLE TEST DROP CONSTRAINT UNIQUE_NAME
"Commands (DDL)","ALTER TABLE SET"," "Commands (DDL)","ALTER TABLE SET","
ALTER TABLE tableName SET REFERENTIAL_INTEGRITY ALTER TABLE tableName SET REFERENTIAL_INTEGRITY
{FALSE | TRUE [CHECK|NOCHECK]} { FALSE | TRUE [ CHECK | NOCHECK ] }
"," ","
Disables or enables referential integrity checking for a table. This command can Disables or enables referential integrity checking for a table. This command can
be used inside a transaction. Enabling referential integrity does not check be used inside a transaction. Enabling referential integrity does not check
...@@ -296,7 +311,7 @@ ALTER TABLE TEST RENAME TO MY_DATA ...@@ -296,7 +311,7 @@ ALTER TABLE TEST RENAME TO MY_DATA
" "
"Commands (DDL)","ALTER USER ADMIN"," "Commands (DDL)","ALTER USER ADMIN","
ALTER USER userName ADMIN {TRUE | FALSE} ALTER USER userName ADMIN { TRUE | FALSE }
"," ","
Switches the admin flag of a user on or off. Switches the admin flag of a user on or off.
...@@ -321,7 +336,7 @@ ALTER USER TOM RENAME TO THOMAS ...@@ -321,7 +336,7 @@ ALTER USER TOM RENAME TO THOMAS
" "
"Commands (DDL)","ALTER USER SET PASSWORD"," "Commands (DDL)","ALTER USER SET PASSWORD","
ALTER USER userName SET {PASSWORD string | SALT bytes HASH bytes} ALTER USER userName SET { PASSWORD string | SALT bytes HASH bytes }
"," ","
Changes the password of a user. Changes the password of a user.
Only unquoted or uppercase user names are allowed. Only unquoted or uppercase user names are allowed.
...@@ -344,7 +359,7 @@ ALTER VIEW ADDRESS_VIEW RECOMPILE ...@@ -344,7 +359,7 @@ ALTER VIEW ADDRESS_VIEW RECOMPILE
" "
"Commands (DDL)","ANALYZE"," "Commands (DDL)","ANALYZE","
ANALYZE [SAMPLE_SIZE rowCountInt] ANALYZE [ SAMPLE_SIZE rowCountInt ]
"," ","
Updates the selectivity statistics of all tables. The selectivity is used by the Updates the selectivity statistics of all tables. The selectivity is used by the
cost based optimizer to select the best index for a given query. If no sample cost based optimizer to select the best index for a given query. If no sample
...@@ -359,9 +374,11 @@ ANALYZE SAMPLE_SIZE 1000 ...@@ -359,9 +374,11 @@ ANALYZE SAMPLE_SIZE 1000
" "
"Commands (DDL)","COMMENT"," "Commands (DDL)","COMMENT","
COMMENT ON { { TABLE | VIEW | CONSTANT | CONSTRAINT | ALIAS | INDEX | ROLE COMMENT ON
| SCHEMA | SEQUENCE | TRIGGER | USER | DOMAIN } [schemaName.]objectName } { { COLUMN [ schemaName. ] tableName.columnName }
| { COLUMN [schemaName.]tableName.columnName } IS expression | { { TABLE | VIEW | CONSTANT | CONSTRAINT | ALIAS | INDEX | ROLE
| SCHEMA | SEQUENCE | TRIGGER | USER | DOMAIN } [ schemaName. ] objectName } }
IS expression
"," ","
Sets the comment of a database object. Use NULL to remove the comment. Sets the comment of a database object. Use NULL to remove the comment.
...@@ -372,7 +389,7 @@ COMMENT ON TABLE TEST IS 'Table used for testing' ...@@ -372,7 +389,7 @@ COMMENT ON TABLE TEST IS 'Table used for testing'
" "
"Commands (DDL)","CREATE AGGREGATE"," "Commands (DDL)","CREATE AGGREGATE","
CREATE AGGREGATE [IF NOT EXISTS] newAggregateName FOR className CREATE AGGREGATE [ IF NOT EXISTS ] newAggregateName FOR className
"," ","
Creates a new user-defined aggregate function. The method name must be the full Creates a new user-defined aggregate function. The method name must be the full
qualified class name. The class must implement the interface qualified class name. The class must implement the interface
...@@ -385,7 +402,7 @@ CREATE AGGREGATE MEDIAN FOR ""com.acme.db.Median"" ...@@ -385,7 +402,7 @@ CREATE AGGREGATE MEDIAN FOR ""com.acme.db.Median""
" "
"Commands (DDL)","CREATE ALIAS"," "Commands (DDL)","CREATE ALIAS","
CREATE ALIAS [IF NOT EXISTS] newFunctionAliasName [DETERMINISTIC] CREATE ALIAS [ IF NOT EXISTS ] newFunctionAliasName [ DETERMINISTIC ]
FOR classAndMethodName FOR classAndMethodName
"," ","
Creates a new function alias. The method name must be the full qualified class Creates a new function alias. The method name must be the full qualified class
...@@ -411,7 +428,7 @@ CALL GET_SYSTEM_PROPERTY('com.acme.test', 'true'); ...@@ -411,7 +428,7 @@ CALL GET_SYSTEM_PROPERTY('com.acme.test', 'true');
" "
"Commands (DDL)","CREATE CONSTANT"," "Commands (DDL)","CREATE CONSTANT","
CREATE CONSTANT [IF NOT EXISTS] newConstantName VALUE expression CREATE CONSTANT [ IF NOT EXISTS ] newConstantName VALUE expression
"," ","
Creates a new constant. Creates a new constant.
This command commits an open transaction. This command commits an open transaction.
...@@ -420,8 +437,9 @@ CREATE CONSTANT ONE VALUE 1 ...@@ -420,8 +437,9 @@ CREATE CONSTANT ONE VALUE 1
" "
"Commands (DDL)","CREATE DOMAIN"," "Commands (DDL)","CREATE DOMAIN","
CREATE DOMAIN [IF NOT EXISTS] newDomainName AS dataType [DEFAULT expression] CREATE DOMAIN [ IF NOT EXISTS ] newDomainName AS dataType
[[NOT] NULL] [SELECTIVITY selectivity] [CHECK condition] [ DEFAULT expression ] [ [ NOT ] NULL ] [ SELECTIVITY selectivity ]
[ CHECK condition ]
"," ","
Creates a new data type (domain). The check condition must evaluate to true or Creates a new data type (domain). The check condition must evaluate to true or
to NULL (to prevent NULL, use NOT NULL). In the condition, the term VALUE refers to NULL (to prevent NULL, use NOT NULL). In the condition, the term VALUE refers
...@@ -433,8 +451,9 @@ CREATE DOMAIN EMAIL AS VARCHAR(255) CHECK (POSITION('@', VALUE) > 1) ...@@ -433,8 +451,9 @@ CREATE DOMAIN EMAIL AS VARCHAR(255) CHECK (POSITION('@', VALUE) > 1)
" "
"Commands (DDL)","CREATE INDEX"," "Commands (DDL)","CREATE INDEX","
CREATE {[UNIQUE] [HASH] INDEX [IF NOT EXISTS] newIndexName CREATE { [ UNIQUE ] [ HASH ] INDEX [ IF NOT EXISTS ] newIndexName
| PRIMARY KEY [HASH]} ON tableName(indexColumn [,...]) | PRIMARY KEY [ HASH ] }
ON tableName ( indexColumn [,...] )
"," ","
Creates a new index. Creates a new index.
This command commits an open transaction. This command commits an open transaction.
...@@ -443,9 +462,9 @@ CREATE INDEX IDXNAME ON TEST(NAME) ...@@ -443,9 +462,9 @@ CREATE INDEX IDXNAME ON TEST(NAME)
" "
"Commands (DDL)","CREATE LINKED TABLE"," "Commands (DDL)","CREATE LINKED TABLE","
CREATE [[GLOBAL | LOCAL] TEMPORARY] LINKED TABLE [IF NOT EXISTS] CREATE [ [ GLOBAL | LOCAL ] TEMPORARY ] LINKED TABLE [ IF NOT EXISTS ]
name(driverString, urlString, userString, passwordString, name ( driverString, urlString, userString, passwordString,
[originalSchemaString,] originalTableString) [EMIT UPDATES | READONLY] [ originalSchemaString, ] originalTableString ) [ EMIT UPDATES | READONLY ]
"," ","
Creates a table link to an external table. The driver name may be empty if the Creates a table link to an external table. The driver name may be empty if the
driver is already loaded. If the schema name is not set, only one table with driver is already loaded. If the schema name is not set, only one table with
...@@ -474,7 +493,7 @@ CREATE LINKED TABLE LINK('javax.naming.InitialContext', ...@@ -474,7 +493,7 @@ CREATE LINKED TABLE LINK('javax.naming.InitialContext',
" "
"Commands (DDL)","CREATE ROLE"," "Commands (DDL)","CREATE ROLE","
CREATE ROLE [IF NOT EXISTS] newRoleName CREATE ROLE [ IF NOT EXISTS ] newRoleName
"," ","
Creates a new role. Creates a new role.
This command commits an open transaction. This command commits an open transaction.
...@@ -483,7 +502,7 @@ CREATE ROLE READONLY ...@@ -483,7 +502,7 @@ CREATE ROLE READONLY
" "
"Commands (DDL)","CREATE SCHEMA"," "Commands (DDL)","CREATE SCHEMA","
CREATE SCHEMA [IF NOT EXISTS] name [AUTHORIZATION ownerUserName] CREATE SCHEMA [ IF NOT EXISTS ] name [ AUTHORIZATION ownerUserName ]
"," ","
Creates a new schema. If no owner is specified, the current user is used. The Creates a new schema. If no owner is specified, the current user is used. The
user that executes the command must have admin rights, as well as the owner. user that executes the command must have admin rights, as well as the owner.
...@@ -494,8 +513,8 @@ CREATE SCHEMA TEST_SCHEMA AUTHORIZATION SA ...@@ -494,8 +513,8 @@ CREATE SCHEMA TEST_SCHEMA AUTHORIZATION SA
" "
"Commands (DDL)","CREATE SEQUENCE"," "Commands (DDL)","CREATE SEQUENCE","
CREATE SEQUENCE [IF NOT EXISTS] newSequenceName [START WITH long] CREATE SEQUENCE [ IF NOT EXISTS ] newSequenceName [ START WITH long ]
[INCREMENT BY long] [CACHE long] [ INCREMENT BY long ] [ CACHE long ]
"," ","
Creates a new sequence. The data type of a sequence is BIGINT. Used values are Creates a new sequence. The data type of a sequence is BIGINT. Used values are
never re-used, even when the transaction is rolled back. The cache is the number never re-used, even when the transaction is rolled back. The cache is the number
...@@ -508,39 +527,33 @@ CREATE SEQUENCE SEQ_ID ...@@ -508,39 +527,33 @@ CREATE SEQUENCE SEQ_ID
" "
"Commands (DDL)","CREATE TABLE"," "Commands (DDL)","CREATE TABLE","
CREATE [CACHED | MEMORY | TEMP | [GLOBAL | LOCAL] TEMPORARY] CREATE [ CACHED | MEMORY | TEMP | [ GLOBAL | LOCAL ] TEMPORARY ]
TABLE [IF NOT EXISTS] name TABLE [ IF NOT EXISTS ]
{ ( {name dataType [{AS computedColumnExpression | DEFAULT expression}] name { ( { columnDefinition | constraint } [,...] ) [ AS select ] }
[[NOT] NULL] [{AUTO_INCREMENT | IDENTITY}[(startInt [, incrementInt])]] | { AS select } [ NOT PERSISTENT ]
[SELECTIVITY selectivity] [PRIMARY KEY [HASH] | UNIQUE] | constraint} [,...] )
[AS select] [NOT PERSISTENT] } | { AS select }
"," ","
Creates a new table. Creates a new table.
Cached tables (the default) are persistent, and the number Cached tables (the default) are persistent, and the number
of rows is not limited by the main memory. Memory tables are persistent, but the of rows is not limited by the main memory. Memory tables are persistent, but the
index data is kept in main memory, that means memory tables should not get too index data is kept in main memory, that means memory tables should not get too
large. Tables with the NOT PERSISTENT modifier are kept fully in memory, and all large.
Tables with the NOT PERSISTENT modifier are kept fully in memory, and all
rows are lost when the database is closed. Temporary tables are not persistent. rows are lost when the database is closed. Temporary tables are not persistent.
Temporary tables can be global (accessible by all connections) or local (only Temporary tables can be global (accessible by all connections) or local (only
accessible by the current connection). The default is for temporary tables is accessible by the current connection). The default is for temporary tables is
global. global.
Identity and auto-increment columns are columns with a sequence as the
default. The column declared as the identity columns is implicitly the
primary key column of this table (unlike auto-increment columns).
This command commits an open transaction. This command commits an open transaction.
"," ","
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255)) CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))
" "
"Commands (DDL)","CREATE TRIGGER"," "Commands (DDL)","CREATE TRIGGER","
CREATE TRIGGER [IF NOT EXISTS] newTriggerName CREATE TRIGGER [ IF NOT EXISTS ] newTriggerName { BEFORE | AFTER }
{BEFORE | AFTER} {INSERT | UPDATE | DELETE} [,...] { INSERT | UPDATE | DELETE } [,...] ON tableName [ FOR EACH ROW ]
ON tableName [ QUEUE int ] [ NOWAIT ] CALL triggeredClassName
[FOR EACH ROW] [QUEUE int] [NOWAIT]
CALL triggeredClassName
"," ","
Creates a new trigger. The trigger class must be public. Nested and inner Creates a new trigger. The trigger class must be public. Nested and inner
classes are not supported. The class must be available in the classpath of the classes are not supported. The class must be available in the classpath of the
...@@ -554,9 +567,8 @@ This command commits an open transaction. ...@@ -554,9 +567,8 @@ This command commits an open transaction.
CREATE TRIGGER TRIG_INS BEFORE INSERT ON TEST FOR EACH ROW CALL ""MyTrigger"" CREATE TRIGGER TRIG_INS BEFORE INSERT ON TEST FOR EACH ROW CALL ""MyTrigger""
" "
"Commands (DDL)","CREATE USER"," "Commands (DDL)","CREATE USER","
CREATE USER [IF NOT EXISTS] newUserName CREATE USER [ IF NOT EXISTS ] newUserName
{PASSWORD string | SALT bytes HASH bytes} { PASSWORD string | SALT bytes HASH bytes } [ ADMIN ]
[ADMIN]
"," ","
Creates a new user. For compatibility, only unquoted or uppercase user names are allowed. Creates a new user. For compatibility, only unquoted or uppercase user names are allowed.
The password must be in single quotes. It is case sensitive and can contain spaces. The password must be in single quotes. It is case sensitive and can contain spaces.
...@@ -569,8 +581,8 @@ CREATE USER GUEST PASSWORD 'abc' ...@@ -569,8 +581,8 @@ CREATE USER GUEST PASSWORD 'abc'
" "
"Commands (DDL)","CREATE VIEW"," "Commands (DDL)","CREATE VIEW","
CREATE [FORCE] VIEW [IF NOT EXISTS] newViewName [(columnName [,..])] CREATE [ FORCE ] VIEW [ IF NOT EXISTS ] newViewName
AS select [ ( columnName [,...] ) ] AS select
"," ","
Creates a new view. If the force option is used, then the view is created even Creates a new view. If the force option is used, then the view is created even
if the underlying table(s) don't exist. if the underlying table(s) don't exist.
...@@ -582,7 +594,7 @@ CREATE VIEW TEST_VIEW AS SELECT * FROM TEST WHERE ID < 100 ...@@ -582,7 +594,7 @@ CREATE VIEW TEST_VIEW AS SELECT * FROM TEST WHERE ID < 100
" "
"Commands (DDL)","DROP AGGREGATE"," "Commands (DDL)","DROP AGGREGATE","
DROP AGGREGATE [IF EXISTS] aggregateName DROP AGGREGATE [ IF EXISTS ] aggregateName
"," ","
Drops an existing user-defined aggregate function. Drops an existing user-defined aggregate function.
...@@ -593,7 +605,7 @@ CREATE AGGREGATE MEDIAN ...@@ -593,7 +605,7 @@ CREATE AGGREGATE MEDIAN
" "
"Commands (DDL)","DROP ALIAS"," "Commands (DDL)","DROP ALIAS","
DROP ALIAS [IF EXISTS] functionAliasName DROP ALIAS [ IF EXISTS ] existingFunctionAliasName
"," ","
Drops an existing function alias. Drops an existing function alias.
...@@ -604,7 +616,7 @@ CREATE ALIAS MY_SQRT ...@@ -604,7 +616,7 @@ CREATE ALIAS MY_SQRT
" "
"Commands (DDL)","DROP ALL OBJECTS"," "Commands (DDL)","DROP ALL OBJECTS","
DROP ALL OBJECTS [DELETE FILES] DROP ALL OBJECTS [ DELETE FILES ]
"," ","
Drops all existing views, tables, sequences, schemas, function aliases, roles, Drops all existing views, tables, sequences, schemas, function aliases, roles,
user-defined aggregate functions, domains, and users (except the current user). user-defined aggregate functions, domains, and users (except the current user).
...@@ -618,7 +630,7 @@ DROP ALL OBJECTS ...@@ -618,7 +630,7 @@ DROP ALL OBJECTS
" "
"Commands (DDL)","DROP CONSTANT"," "Commands (DDL)","DROP CONSTANT","
DROP CONSTANT [IF EXISTS] constantName DROP CONSTANT [ IF EXISTS ] constantName
"," ","
Drops a constant. Drops a constant.
This command commits an open transaction. This command commits an open transaction.
...@@ -627,7 +639,7 @@ DROP CONSTANT ONE ...@@ -627,7 +639,7 @@ DROP CONSTANT ONE
" "
"Commands (DDL)","DROP DOMAIN"," "Commands (DDL)","DROP DOMAIN","
DROP DOMAIN [IF EXISTS] domainName DROP DOMAIN [ IF EXISTS ] domainName
"," ","
Drops a data type (domain). Drops a data type (domain).
This command commits an open transaction. This command commits an open transaction.
...@@ -636,7 +648,7 @@ DROP DOMAIN EMAIL ...@@ -636,7 +648,7 @@ DROP DOMAIN EMAIL
" "
"Commands (DDL)","DROP INDEX"," "Commands (DDL)","DROP INDEX","
DROP INDEX [IF EXISTS] indexName DROP INDEX [ IF EXISTS ] indexName
"," ","
Drops an index. Drops an index.
This command commits an open transaction. This command commits an open transaction.
...@@ -645,7 +657,7 @@ DROP INDEX IF EXISTS IDXNAME ...@@ -645,7 +657,7 @@ DROP INDEX IF EXISTS IDXNAME
" "
"Commands (DDL)","DROP ROLE"," "Commands (DDL)","DROP ROLE","
DROP ROLE [IF EXISTS] roleName DROP ROLE [ IF EXISTS ] roleName
"," ","
Drops a role. Drops a role.
This command commits an open transaction. This command commits an open transaction.
...@@ -654,7 +666,7 @@ DROP ROLE READONLY ...@@ -654,7 +666,7 @@ DROP ROLE READONLY
" "
"Commands (DDL)","DROP SCHEMA"," "Commands (DDL)","DROP SCHEMA","
DROP SCHEMA [IF EXISTS] schemaName DROP SCHEMA [ IF EXISTS ] schemaName
"," ","
Drops a schema. Drops a schema.
This command commits an open transaction. This command commits an open transaction.
...@@ -663,7 +675,7 @@ DROP SCHEMA TEST_SCHEMA ...@@ -663,7 +675,7 @@ DROP SCHEMA TEST_SCHEMA
" "
"Commands (DDL)","DROP SEQUENCE"," "Commands (DDL)","DROP SEQUENCE","
DROP SEQUENCE [IF EXISTS] sequenceName DROP SEQUENCE [ IF EXISTS ] sequenceName
"," ","
Drops a sequence. Drops a sequence.
This command commits an open transaction. This command commits an open transaction.
...@@ -672,7 +684,7 @@ DROP SEQUENCE SEQ_ID ...@@ -672,7 +684,7 @@ DROP SEQUENCE SEQ_ID
" "
"Commands (DDL)","DROP TABLE"," "Commands (DDL)","DROP TABLE","
DROP TABLE [IF EXISTS] tableName [,...] DROP TABLE [ IF EXISTS ] tableName [,...]
"," ","
Drops an existing table, or a list of existing tables. Drops an existing table, or a list of existing tables.
This command commits an open transaction. This command commits an open transaction.
...@@ -681,7 +693,7 @@ DROP TABLE TEST ...@@ -681,7 +693,7 @@ DROP TABLE TEST
" "
"Commands (DDL)","DROP TRIGGER"," "Commands (DDL)","DROP TRIGGER","
DROP TRIGGER [IF EXISTS] triggerName DROP TRIGGER [ IF EXISTS ] triggerName
"," ","
Drops an existing trigger. Drops an existing trigger.
This command commits an open transaction. This command commits an open transaction.
...@@ -690,7 +702,7 @@ DROP TRIGGER TRIG_INS ...@@ -690,7 +702,7 @@ DROP TRIGGER TRIG_INS
" "
"Commands (DDL)","DROP USER"," "Commands (DDL)","DROP USER","
DROP USER [IF EXISTS] userName DROP USER [ IF EXISTS ] userName
"," ","
Drops a user. The current user cannot be dropped. Drops a user. The current user cannot be dropped.
For compatibility, only unquoted or uppercase user names are allowed. For compatibility, only unquoted or uppercase user names are allowed.
...@@ -702,7 +714,7 @@ DROP USER TOM ...@@ -702,7 +714,7 @@ DROP USER TOM
" "
"Commands (DDL)","DROP VIEW"," "Commands (DDL)","DROP VIEW","
DROP VIEW [IF EXISTS] viewName DROP VIEW [ IF EXISTS ] viewName
"," ","
Drops a view. Drops a view.
This command commits an open transaction. This command commits an open transaction.
...@@ -745,7 +757,7 @@ CHECKPOINT SYNC ...@@ -745,7 +757,7 @@ CHECKPOINT SYNC
" "
"Commands (Other)","COMMIT"," "Commands (Other)","COMMIT","
COMMIT [WORK] COMMIT [ WORK ]
"," ","
Commits a transaction. Commits a transaction.
"," ","
...@@ -764,8 +776,8 @@ COMMIT TRANSACTION XID_TEST ...@@ -764,8 +776,8 @@ COMMIT TRANSACTION XID_TEST
" "
"Commands (Other)","GRANT RIGHT"," "Commands (Other)","GRANT RIGHT","
GRANT {SELECT | INSERT | UPDATE | DELETE | ALL} [,...] GRANT { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
ON tableName [,...] TO {PUBLIC | userName | roleName} tableName [,...] TO { PUBLIC | userName | roleName }
"," ","
Grants rights for a table to a user or role. Grants rights for a table to a user or role.
...@@ -776,7 +788,7 @@ GRANT SELECT ON TEST TO READONLY ...@@ -776,7 +788,7 @@ GRANT SELECT ON TEST TO READONLY
" "
"Commands (Other)","GRANT ROLE"," "Commands (Other)","GRANT ROLE","
GRANT roleName TO {PUBLIC | userName | roleName} GRANT roleName TO { PUBLIC | userName | roleName }
"," ","
Grants a role to a user or role. Grants a role to a user or role.
...@@ -787,7 +799,7 @@ GRANT READONLY TO PUBLIC ...@@ -787,7 +799,7 @@ GRANT READONLY TO PUBLIC
" "
"Commands (Other)","HELP"," "Commands (Other)","HELP","
HELP [anything [...]] HELP [ anything [...] ]
"," ","
Displays the help pages of SQL commands or keywords. Displays the help pages of SQL commands or keywords.
"," ","
...@@ -804,8 +816,8 @@ PREPARE COMMIT XID_TEST ...@@ -804,8 +816,8 @@ PREPARE COMMIT XID_TEST
" "
"Commands (Other)","REVOKE RIGHT"," "Commands (Other)","REVOKE RIGHT","
REVOKE {SELECT | INSERT | UPDATE | DELETE | ALL} [,...] REVOKE { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON tableName
ON tableName [,...] FROM {PUBLIC | userName | roleName} [,...] FROM { PUBLIC | userName | roleName }
"," ","
Removes rights for a table from a user or role. Removes rights for a table from a user or role.
...@@ -816,8 +828,7 @@ REVOKE SELECT ON TEST FROM READONLY ...@@ -816,8 +828,7 @@ REVOKE SELECT ON TEST FROM READONLY
" "
"Commands (Other)","REVOKE ROLE"," "Commands (Other)","REVOKE ROLE","
REVOKE roleName REVOKE roleName FROM { PUBLIC | userName | roleName }
FROM {PUBLIC | userName | roleName}
"," ","
Removes a role from a user or role. Removes a role from a user or role.
...@@ -828,7 +839,7 @@ REVOKE READONLY FROM TOM ...@@ -828,7 +839,7 @@ REVOKE READONLY FROM TOM
" "
"Commands (Other)","ROLLBACK"," "Commands (Other)","ROLLBACK","
ROLLBACK [TO SAVEPOINT savepointName] ROLLBACK [ TO SAVEPOINT savepointName ]
"," ","
Rolls back a transaction. If a savepoint name is used, the transaction is only Rolls back a transaction. If a savepoint name is used, the transaction is only
rolled back to the specified savepoint. rolled back to the specified savepoint.
...@@ -857,7 +868,7 @@ SAVEPOINT HALF_DONE ...@@ -857,7 +868,7 @@ SAVEPOINT HALF_DONE
" "
"Commands (Other)","SET @"," "Commands (Other)","SET @","
SET @variableName [=] expression SET @variableName [ = ] expression
"," ","
Updates a user-defined variable. Updates a user-defined variable.
This command does not commit a transaction, and rollback does not affect it. This command does not commit a transaction, and rollback does not affect it.
...@@ -866,7 +877,7 @@ SET @TOTAL=0 ...@@ -866,7 +877,7 @@ SET @TOTAL=0
" "
"Commands (Other)","SET ALLOW_LITERALS"," "Commands (Other)","SET ALLOW_LITERALS","
SET ALLOW_LITERALS {NONE|ALL|NUMBERS} SET ALLOW_LITERALS { NONE | ALL | NUMBERS }
"," ","
This setting can help solve the SQL injection problem. By default, text and This setting can help solve the SQL injection problem. By default, text and
number literals are allowed in SQL statements. However, this enables SQL number literals are allowed in SQL statements. However, this enables SQL
...@@ -888,7 +899,7 @@ SET ALLOW_LITERALS NONE ...@@ -888,7 +899,7 @@ SET ALLOW_LITERALS NONE
" "
"Commands (Other)","SET AUTOCOMMIT"," "Commands (Other)","SET AUTOCOMMIT","
SET AUTOCOMMIT {TRUE | ON | FALSE | OFF} SET AUTOCOMMIT { TRUE | ON | FALSE | OFF }
"," ","
Switches auto commit on or off. Switches auto commit on or off.
This setting can be appended to the database URL: jdbc:h2:test;AUTOCOMMIT=OFF This setting can be appended to the database URL: jdbc:h2:test;AUTOCOMMIT=OFF
...@@ -929,9 +940,8 @@ SET CLUSTER '' ...@@ -929,9 +940,8 @@ SET CLUSTER ''
" "
"Commands (Other)","SET COLLATION"," "Commands (Other)","SET COLLATION","
SET [DATABASE] COLLATION SET [ DATABASE ] COLLATION
{OFF | collationName { OFF | collationName [ STRENGTH { PRIMARY | SECONDARY | TERTIARY | IDENTICAL } ] }
[STRENGTH {PRIMARY | SECONDARY | TERTIARY | IDENTICAL}]}
"," ","
Sets the collation used for comparing strings. This command can only be executed Sets the collation used for comparing strings. This command can only be executed
if there are no tables defined. See java.text.Collator for details about if there are no tables defined. See java.text.Collator for details about
...@@ -945,7 +955,7 @@ SET COLLATION ENGLISH ...@@ -945,7 +955,7 @@ SET COLLATION ENGLISH
" "
"Commands (Other)","SET COMPRESS_LOB"," "Commands (Other)","SET COMPRESS_LOB","
SET COMPRESS_LOB {NO|LZF|DEFLATE} SET COMPRESS_LOB { NO | LZF | DEFLATE }
"," ","
Sets the compression algorithm for BLOB and CLOB data. Compression is usually Sets the compression algorithm for BLOB and CLOB data. Compression is usually
slower, but needs less disk space. LZF is faster but uses more space. slower, but needs less disk space. LZF is faster but uses more space.
...@@ -1004,7 +1014,7 @@ SET DEFAULT_LOCK_TIMEOUT 5000 ...@@ -1004,7 +1014,7 @@ SET DEFAULT_LOCK_TIMEOUT 5000
" "
"Commands (Other)","SET DEFAULT_TABLE_TYPE"," "Commands (Other)","SET DEFAULT_TABLE_TYPE","
SET DEFAULT_TABLE_TYPE {MEMORY | CACHED} SET DEFAULT_TABLE_TYPE { MEMORY | CACHED }
"," ","
Sets the default table storage type that is used when creating new tables. Sets the default table storage type that is used when creating new tables.
Memory tables are kept fully in the main memory (including indexes), however Memory tables are kept fully in the main memory (including indexes), however
...@@ -1019,7 +1029,7 @@ SET DEFAULT_TABLE_TYPE MEMORY ...@@ -1019,7 +1029,7 @@ SET DEFAULT_TABLE_TYPE MEMORY
" "
"Commands (Other)","SET EXCLUSIVE"," "Commands (Other)","SET EXCLUSIVE","
SET EXCLUSIVE {TRUE | FALSE} SET EXCLUSIVE { TRUE | FALSE }
"," ","
Switched the database to exclusive mode and back. In exclusive mode, new Switched the database to exclusive mode and back. In exclusive mode, new
connections are rejected, and operations by other connections are paused until connections are rejected, and operations by other connections are paused until
...@@ -1034,7 +1044,7 @@ SET EXCLUSIVE TRUE ...@@ -1034,7 +1044,7 @@ SET EXCLUSIVE TRUE
" "
"Commands (Other)","SET IGNORECASE"," "Commands (Other)","SET IGNORECASE","
SET IGNORECASE {TRUE|FALSE} SET IGNORECASE { TRUE | FALSE }
"," ","
If IGNORECASE is enabled, text columns in newly created tables will be If IGNORECASE is enabled, text columns in newly created tables will be
case-insensitive. Already existing tables are not affected. The effect of case-insensitive. Already existing tables are not affected. The effect of
...@@ -1182,8 +1192,7 @@ SET MAX_OPERATION_MEMORY 0 ...@@ -1182,8 +1192,7 @@ SET MAX_OPERATION_MEMORY 0
" "
"Commands (Other)","SET MODE"," "Commands (Other)","SET MODE","
SET MODE {REGULAR | DB2 | DERBY | HSQLDB | SET MODE { REGULAR | DB2 | DERBY | HSQLDB | MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL }
MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL}
"," ","
Changes to another database compatibility mode. For details, see Compatibility Changes to another database compatibility mode. For details, see Compatibility
Modes in the feature section. Modes in the feature section.
...@@ -1197,7 +1206,7 @@ SET MODE HSQLDB ...@@ -1197,7 +1206,7 @@ SET MODE HSQLDB
" "
"Commands (Other)","SET MULTI_THREADED"," "Commands (Other)","SET MULTI_THREADED","
SET MULTI_THREADED {0|1} SET MULTI_THREADED { 0 | 1 }
"," ","
Enabled (1) or disabled (0) multi-threading inside the database engine. By Enabled (1) or disabled (0) multi-threading inside the database engine. By
default, this setting is disabled. Currently, enabling this is experimental default, this setting is disabled. Currently, enabling this is experimental
...@@ -1214,7 +1223,7 @@ SET MULTI_THREADED 1 ...@@ -1214,7 +1223,7 @@ SET MULTI_THREADED 1
" "
"Commands (Other)","SET OPTIMIZE_REUSE_RESULTS"," "Commands (Other)","SET OPTIMIZE_REUSE_RESULTS","
SET OPTIMIZE_REUSE_RESULTS {0|1} SET OPTIMIZE_REUSE_RESULTS { 0 | 1 }
"," ","
Enabled (1) or disabled (0) the result reuse optimization. If enabled, Enabled (1) or disabled (0) the result reuse optimization. If enabled,
subqueries and views used as subqueries are only re-run if the data in one of subqueries and views used as subqueries are only re-run if the data in one of
...@@ -1251,7 +1260,7 @@ SET QUERY_TIMEOUT 10000 ...@@ -1251,7 +1260,7 @@ SET QUERY_TIMEOUT 10000
" "
"Commands (Other)","SET REFERENTIAL_INTEGRITY"," "Commands (Other)","SET REFERENTIAL_INTEGRITY","
SET REFERENTIAL_INTEGRITY [TRUE|FALSE] SET REFERENTIAL_INTEGRITY { TRUE | FALSE }
"," ","
Disabled or enables referential integrity checking for the whole database. Disabled or enables referential integrity checking for the whole database.
Enabling it does not check existing data. Use ALTER TABLE SET to disable it only Enabling it does not check existing data. Use ALTER TABLE SET to disable it only
...@@ -1315,7 +1324,7 @@ SET THROTTLE 200 ...@@ -1315,7 +1324,7 @@ SET THROTTLE 200
" "
"Commands (Other)","SET TRACE_LEVEL"," "Commands (Other)","SET TRACE_LEVEL","
SET {TRACE_LEVEL_FILE | TRACE_LEVEL_SYSTEM_OUT} int SET { TRACE_LEVEL_FILE | TRACE_LEVEL_SYSTEM_OUT } int
"," ","
Sets the trace level for file the file or system out stream. Levels are: 0=off, Sets the trace level for file the file or system out stream. Levels are: 0=off,
1=error, 2=info, 3=debug. The default level is 1 for file and 0 for system out. 1=error, 2=info, 3=debug. The default level is 1 for file and 0 for system out.
...@@ -1370,7 +1379,7 @@ SET WRITE_DELAY 2000 ...@@ -1370,7 +1379,7 @@ SET WRITE_DELAY 2000
" "
"Commands (Other)","SHUTDOWN"," "Commands (Other)","SHUTDOWN","
SHUTDOWN [IMMEDIATELY|COMPACT|SCRIPT] 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. This command usually does not need to be used, as the database is database. This command usually does not need to be used, as the database is
...@@ -1388,9 +1397,7 @@ SHUTDOWN ...@@ -1388,9 +1397,7 @@ SHUTDOWN
" "
"Other Grammar","Comments"," "Other Grammar","Comments","
-- anythingUntilEndOfLine -- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
| // anythingUntilEndOfLine
"," ","
Comments can be used anywhere in a command and are ignored by the database. Line 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 comments end with a newline. Block comments cannot be nested, but can be
...@@ -1399,28 +1406,21 @@ multiple lines long. ...@@ -1399,28 +1406,21 @@ multiple lines long.
// This is a comment // This is a comment
" "
"Other Grammar","Select Part"," "Other Grammar","Order","
[TOP term] [DISTINCT | ALL] selectExpression [,...] { int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
","
The SELECT part of a query.
","
DISTINCT *
"
"Other Grammar","From Part","
tableExpression [,...]
"," ","
The FROM part of a query. 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.
"," ","
FROM TEST NAME DESC NULLS LAST
" "
"Other Grammar","Constraint"," "Other Grammar","Constraint","
PRIMARY KEY [HASH] (columnName [,...]) [ constraintNameDefinition ] {
| [CONSTRAINT [IF NOT EXISTS] newConstraintName] { CHECK expression | UNIQUE ( columnName [,...] )
CHECK expression | referentialConstraint }
| UNIQUE (columnName [,...]) | PRIMARY KEY [ HASH ] ( columnName [,...] )
| referentialConstraint}
"," ","
Defines a constraint. The check condition must evaluate to true or to NULL (to Defines a constraint. The check condition must evaluate to true or to NULL (to
prevent NULL, use NOT NULL). prevent NULL, use NOT NULL).
...@@ -1428,11 +1428,19 @@ prevent NULL, use NOT NULL). ...@@ -1428,11 +1428,19 @@ prevent NULL, use NOT NULL).
PRIMARY KEY(ID, NAME) PRIMARY KEY(ID, NAME)
" "
"Other Grammar","Constraint Name Definition","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
","
Defines a constraint name.
","
CONSTRAINT CONST_ID
"
"Other Grammar","Referential Constraint"," "Other Grammar","Referential Constraint","
FOREIGN KEY (columnName [,...]) FOREIGN KEY ( columnName [,...] )
REFERENCES [refTableName] [(refColumnName[,...])] REFERENCES [ refTableName ] [ ( refColumnName [,...] ) ]
[ON DELETE {CASCADE | RESTRICT | NO ACTION | SET {DEFAULT|NULL}}] [ ON DELETE { CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL } } ]
[ON UPDATE {CASCADE | SET {DEFAULT|NULL}}] [ ON UPDATE { CASCADE | SET { DEFAULT | NULL } } ]
"," ","
Defines a referential constraint. If the table name is not specified, then the 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, same table is referenced. As this database does not support deferred checking,
...@@ -1444,9 +1452,9 @@ FOREIGN KEY(ID) REFERENCES TEST(ID) ...@@ -1444,9 +1452,9 @@ FOREIGN KEY(ID) REFERENCES TEST(ID)
" "
"Other Grammar","Table Expression"," "Other Grammar","Table Expression","
{[schemaName.] tableName | (select)} [[AS] newTableAlias] { [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
[{{LEFT | RIGHT} [OUTER] | [INNER] | CROSS | NATURAL} [ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN tableExpression [[AS] newTableAlias] [ON expression] ] JOIN tableExpression [ ON expression ] ]
"," ","
Joins a table. The join expression is not supported for cross and natural joins. 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 A natural join is an inner join, where the condition is automatically on the
...@@ -1455,18 +1463,8 @@ columns with the same name. ...@@ -1455,18 +1463,8 @@ columns with the same name.
TEST AS T LEFT JOIN TEST AS T1 ON T.ID = T1.ID TEST AS T LEFT JOIN TEST AS T1 ON T.ID = T1.ID
" "
"Other Grammar","Order","
{int | expression} [ASC | DESC] [NULLS {FIRST | LAST}]
","
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.
","
NAME DESC NULLS LAST
"
"Other Grammar","Index Column"," "Other Grammar","Index Column","
columnName [ASC | DESC] [NULLS {FIRST | LAST}] columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
"," ","
Indexes this column in ascending or descending order. Usually it is not required 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 to specify the order; however doing so will speed up large queries that order
...@@ -1475,8 +1473,23 @@ the column in the same way. ...@@ -1475,8 +1473,23 @@ the column in the same way.
NAME NAME
" "
"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.
Identity and auto-increment columns are columns with a sequence as the
default. The column declared as the identity columns is implicitly the
primary key column of this table (unlike auto-increment columns).
","
CREATE TABLE(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT '');
CREATE TABLE(ID BIGINT IDENTITY);
"
"Other Grammar","Expression"," "Other Grammar","Expression","
andCondition [OR andCondition] andCondition [ OR andCondition ]
"," ","
Value or condition. Value or condition.
"," ","
...@@ -1484,7 +1497,7 @@ ID=1 OR NAME='Hi' ...@@ -1484,7 +1497,7 @@ ID=1 OR NAME='Hi'
" "
"Other Grammar","And Condition"," "Other Grammar","And Condition","
condition [AND condition] condition [ AND condition ]
"," ","
Value or condition. Value or condition.
"," ","
...@@ -1492,7 +1505,7 @@ ID=1 AND NAME='Hi' ...@@ -1492,7 +1505,7 @@ ID=1 AND NAME='Hi'
" "
"Other Grammar","Condition"," "Other Grammar","Condition","
operand [conditionRightHandSide] | NOT condition | EXISTS (select) operand [ conditionRightHandSide ] | NOT condition | EXISTS ( select )
"," ","
Boolean value or condition. Boolean value or condition.
"," ","
...@@ -1500,12 +1513,12 @@ ID<>2 ...@@ -1500,12 +1513,12 @@ ID<>2
" "
"Other Grammar","Condition Right Hand Side"," "Other Grammar","Condition Right Hand Side","
compare { {{ALL|ANY|SOME}(select)} | operand } compare { { { ALL | ANY | SOME } ( select ) } | operand }
| IS [NOT] NULL | IS [ NOT ] NULL
| BETWEEN operand AND operand | BETWEEN operand AND operand
| IN ({select | expression[,...]}) | IN ( { select | expression [,...] } )
| [NOT] LIKE operand [ESCAPE string] | [ NOT ] LIKE operand [ ESCAPE string ]
| [NOT] REGEXP operand | [ NOT ] REGEXP operand
"," ","
The right hand side of a condition. The right hand side of a condition.
...@@ -1530,7 +1543,7 @@ Comparison operator. The operator != is the same as <>. ...@@ -1530,7 +1543,7 @@ Comparison operator. The operator != is the same as <>.
" "
"Other Grammar","Operand"," "Other Grammar","Operand","
summand [ || summand] summand [ || summand ]
"," ","
A value or a concatenation of values. A value or a concatenation of values.
"," ","
...@@ -1538,7 +1551,7 @@ A value or a concatenation of values. ...@@ -1538,7 +1551,7 @@ A value or a concatenation of values.
" "
"Other Grammar","Summand"," "Other Grammar","Summand","
factor [{+ | -} factor] factor [ { + | - } factor ]
"," ","
A value or a numeric sum. A value or a numeric sum.
"," ","
...@@ -1546,7 +1559,7 @@ ID + 20 ...@@ -1546,7 +1559,7 @@ ID + 20
" "
"Other Grammar","Factor"," "Other Grammar","Factor","
term [{* | /} term] term [ { * | / } term ]
"," ","
A value or a numeric factor. A value or a numeric factor.
"," ","
...@@ -1555,16 +1568,16 @@ ID * 10 ...@@ -1555,16 +1568,16 @@ ID * 10
"Other Grammar","Term"," "Other Grammar","Term","
value value
| columnName | columnName
| ?[int] | ?[ int ]
| NEXT VALUE FOR sequenceName | NEXT VALUE FOR sequenceName
| function | function
| {- | +} term | { - | + } term
| (expression) | ( expression )
| select | select
| case | case
| caseWhen | caseWhen
| tableAlias.columnName | tableAlias.columnName
"," ","
A value. Parameters can be indexed, for example ?1 meaning the first parameter. A value. Parameters can be indexed, for example ?1 meaning the first parameter.
"," ","
...@@ -1572,8 +1585,8 @@ A value. Parameters can be indexed, for example ?1 meaning the first parameter. ...@@ -1572,8 +1585,8 @@ A value. Parameters can be indexed, for example ?1 meaning the first parameter.
" "
"Other Grammar","Value"," "Other Grammar","Value","
string | dollarQuotedString | hexNumber | int | long | decimal | double | string | dollarQuotedString | hexNumber | int | long | decimal | double
date | time | timestamp | boolean | bytes | array | null | date | time | timestamp | boolean | bytes | array | null
"," ","
A value of any data type, or null. A value of any data type, or null.
"," ","
...@@ -1581,8 +1594,8 @@ A value of any data type, or null. ...@@ -1581,8 +1594,8 @@ A value of any data type, or null.
" "
"Other Grammar","Case"," "Other Grammar","Case","
CASE expression {WHEN expression THEN expression} CASE expression { WHEN expression THEN expression } [...]
[...] [ELSE expression] END [ ELSE expression ] END
"," ","
Returns the first expression where the value is equal to the test expression. If Returns the first expression where the value is equal to the test expression. If
no else part is specified, return NULL. no else part is specified, return NULL.
...@@ -1591,8 +1604,8 @@ CASE CNT WHEN 0 THEN 'No' WHEN 1 THEN 'One' ELSE 'Some' END ...@@ -1591,8 +1604,8 @@ CASE CNT WHEN 0 THEN 'No' WHEN 1 THEN 'One' ELSE 'Some' END
" "
"Other Grammar","Case When"," "Other Grammar","Case When","
CASE {WHEN expression THEN expression} CASE { WHEN expression THEN expression} [...]
[...] [ELSE expression] END [ ELSE expression ] END
"," ","
Returns the first expression where the condition is true. If no else part is Returns the first expression where the condition is true. If no else part is
specified, return NULL. specified, return NULL.
...@@ -1600,8 +1613,16 @@ specified, return NULL. ...@@ -1600,8 +1613,16 @@ specified, return NULL.
CASE WHEN CNT<10 THEN 'Low' ELSE 'High' END CASE WHEN CNT<10 THEN 'Low' ELSE 'High' END
" "
"Other Grammar","Csv Options","
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]]
","
Optional parameters for CSVREAD and CSVWRITE.
","
CALL CSVWRITE('test2.csv', 'SELECT * FROM TEST', 'UTF-8', '|');
"
"Other Grammar","Cipher"," "Other Grammar","Cipher","
[AES | XTEA] { AES | XTEA }
"," ","
Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds). The AES Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds). The AES
algorithm is about half as fast as XTEA. algorithm is about half as fast as XTEA.
...@@ -1610,7 +1631,7 @@ AES ...@@ -1610,7 +1631,7 @@ AES
" "
"Other Grammar","Select Expression"," "Other Grammar","Select Expression","
* | expression [[AS] columnAlias] | tableAlias.* * | expression [ [ AS ] columnAlias ] | tableAlias.*
"," ","
An expression in a SELECT statement. An expression in a SELECT statement.
"," ","
...@@ -1618,10 +1639,10 @@ ID AS VALUE ...@@ -1618,10 +1639,10 @@ ID AS VALUE
" "
"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
binaryType | otherType | varcharType | varcharIgnorecaseType | charType | binaryType | otherType | varcharType | varcharIgnorecaseType | charType
blobType | clobType | uuidType | arrayType | blobType | clobType | uuidType | arrayType
"," ","
A data type definition. A data type definition.
"," ","
...@@ -1629,7 +1650,7 @@ INT ...@@ -1629,7 +1650,7 @@ INT
" "
"Other Grammar","Name"," "Other Grammar","Name","
{ { A-Z|_ } [ { A-Z|_|0-9} [...] ] } | quotedName { { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
"," ","
Names are not case sensitive. There is no maximum name length. Names are not case sensitive. There is no maximum name length.
"," ","
...@@ -1674,7 +1695,7 @@ $$John's car$$ ...@@ -1674,7 +1695,7 @@ $$John's car$$
" "
"Other Grammar","Int"," "Other Grammar","Int","
[- | +] digit [...] [ - | + ] digit [...]
"," ","
The maximum integer number is 2147483647, the minimum is -2147483648. The maximum integer number is 2147483647, the minimum is -2147483648.
"," ","
...@@ -1682,7 +1703,7 @@ The maximum integer number is 2147483647, the minimum is -2147483648. ...@@ -1682,7 +1703,7 @@ The maximum integer number is 2147483647, the minimum is -2147483648.
" "
"Other Grammar","Long"," "Other Grammar","Long","
[- | +] digit [...] [ - | + ] digit [...]
"," ","
Long numbers are between -9223372036854775808 and 9223372036854775807. Long numbers are between -9223372036854775808 and 9223372036854775807.
"," ","
...@@ -1690,7 +1711,7 @@ Long numbers are between -9223372036854775808 and 9223372036854775807. ...@@ -1690,7 +1711,7 @@ Long numbers are between -9223372036854775808 and 9223372036854775807.
" "
"Other Grammar","Hex Number"," "Other Grammar","Hex Number","
[+ | -] 0x hex [ + | - ] 0x hex
"," ","
A number written in hexadecimal notation. A number written in hexadecimal notation.
"," ","
...@@ -1698,7 +1719,7 @@ A number written in hexadecimal notation. ...@@ -1698,7 +1719,7 @@ A number written in hexadecimal notation.
" "
"Other Grammar","Decimal"," "Other Grammar","Decimal","
[- | +] digit [...] [. digit [...] ] [ - | + ] digit [...] [ . digit [...] ]
"," ","
Number with fixed precision and scale. Number with fixed precision and scale.
"," ","
...@@ -1706,8 +1727,8 @@ Number with fixed precision and scale. ...@@ -1706,8 +1727,8 @@ Number with fixed precision and scale.
" "
"Other Grammar","Double"," "Other Grammar","Double","
[- | +] digit [...] [ - | + ] digit [...]
[. digit [...] [E [- | +] exponentDigit [...] ]] [ . digit [...] [ E [ - | + ] exponentDigit [...] ] ]
"," ","
The limitations are the same as for the Java data type Double. The limitations are the same as for the Java data type Double.
"," ","
...@@ -1759,7 +1780,7 @@ X'01FF' ...@@ -1759,7 +1780,7 @@ X'01FF'
" "
"Other Grammar","Array"," "Other Grammar","Array","
( expression [,..] ) ( expression [,...] )
"," ","
An array of values. An array of values.
"," ","
...@@ -1775,7 +1796,7 @@ NULL ...@@ -1775,7 +1796,7 @@ NULL
" "
"Other Grammar","Hex"," "Other Grammar","Hex","
{{ digit | a-f | A-F } {digit | a-f | A-F }} [...] { { digit | a-f | A-F } { digit | a-f | A-F } } [...]
"," ","
The hexadecimal representation of a number or of bytes. Two characters are one The hexadecimal representation of a number or of bytes. Two characters are one
byte. byte.
...@@ -1854,7 +1875,7 @@ IDENTITY ...@@ -1854,7 +1875,7 @@ IDENTITY
" "
"Data Types","DECIMAL Type"," "Data Types","DECIMAL Type","
{DECIMAL | NUMBER | DEC | NUMERIC} ( precisionInt [, scaleInt] ) { DECIMAL | NUMBER | DEC | NUMERIC } ( precisionInt [ , scaleInt ] )
"," ","
Data type with fixed precision and scale. This data type is recommended for Data type with fixed precision and scale. This data type is recommended for
storing currency values. storing currency values.
...@@ -1865,7 +1886,7 @@ DECIMAL(20, 2) ...@@ -1865,7 +1886,7 @@ DECIMAL(20, 2)
" "
"Data Types","DOUBLE Type"," "Data Types","DOUBLE Type","
{DOUBLE [PRECISION] | FLOAT | FLOAT4 | FLOAT8} { DOUBLE [ PRECISION ] | FLOAT | FLOAT4 | FLOAT8 }
"," ","
Floating point number. Should not be used to represent currency values, because Floating point number. Should not be used to represent currency values, because
of rounding problems. of rounding problems.
...@@ -1907,7 +1928,7 @@ DATE ...@@ -1907,7 +1928,7 @@ DATE
" "
"Data Types","TIMESTAMP Type"," "Data Types","TIMESTAMP Type","
{TIMESTAMP | DATETIME | SMALLDATETIME} { TIMESTAMP | DATETIME | SMALLDATETIME }
"," ","
The format is yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]. The format is yyyy-MM-dd hh:mm:ss[.nnnnnnnnn].
...@@ -1917,8 +1938,7 @@ TIMESTAMP ...@@ -1917,8 +1938,7 @@ TIMESTAMP
" "
"Data Types","BINARY Type"," "Data Types","BINARY Type","
{BINARY | VARBINARY | LONGVARBINARY | RAW | BYTEA} { BINARY | VARBINARY | LONGVARBINARY | RAW | BYTEA } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
Represents a byte array. For very long arrays, use BLOB. Represents a byte array. For very long arrays, use BLOB.
The maximum size is 2 GB, but the whole object is kept in The maximum size is 2 GB, but the whole object is kept in
...@@ -1946,9 +1966,8 @@ OTHER ...@@ -1946,9 +1966,8 @@ OTHER
" "
"Data Types","VARCHAR Type"," "Data Types","VARCHAR Type","
{VARCHAR | LONGVARCHAR | { VARCHAR | LONGVARCHAR | VARCHAR2 | NVARCHAR
VARCHAR2 | NVARCHAR | NVARCHAR2 | VARCHAR_CASESENSITIVE} | NVARCHAR2 | VARCHAR_CASESENSITIVE} [ ( precisionInt ) ]
[( precisionInt )]
"," ","
Unicode String. Use two single quotes ('') to create a quote. The maximum precision Unicode String. Use two single quotes ('') to create a quote. The maximum precision
is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is is Integer.MAX_VALUE. The precision is a size constraint; only the actual data is
...@@ -1961,7 +1980,7 @@ VARCHAR(255) ...@@ -1961,7 +1980,7 @@ VARCHAR(255)
" "
"Data Types","VARCHAR_IGNORECASE Type"," "Data Types","VARCHAR_IGNORECASE Type","
VARCHAR_IGNORECASE [( precisionInt )] VARCHAR_IGNORECASE [ ( precisionInt ) ]
"," ","
Same as VARCHAR, but not case sensitive when comparing. Stored in mixed case. Same as VARCHAR, but not case sensitive when comparing. Stored in mixed case.
The maximum precision is Integer.MAX_VALUE characters, but the whole text is kept in The maximum precision is Integer.MAX_VALUE characters, but the whole text is kept in
...@@ -1974,8 +1993,7 @@ VARCHAR_IGNORECASE ...@@ -1974,8 +1993,7 @@ VARCHAR_IGNORECASE
" "
"Data Types","CHAR Type"," "Data Types","CHAR Type","
{CHAR | CHARACTER | NCHAR} { CHAR | CHARACTER | NCHAR } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
This type is supported for compatibility with other databases and older This type is supported for compatibility with other databases and older
applications. The difference to VARCHAR is that trailing spaces are ignored and applications. The difference to VARCHAR is that trailing spaces are ignored and
...@@ -1990,8 +2008,7 @@ CHAR(10) ...@@ -1990,8 +2008,7 @@ CHAR(10)
" "
"Data Types","BLOB Type"," "Data Types","BLOB Type","
{BLOB | TINYBLOB | MEDIUMBLOB | LONGBLOB | IMAGE | OID} { BLOB | TINYBLOB | MEDIUMBLOB | LONGBLOB | IMAGE | OID } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
Like BINARY, but intended for very large values such as files or images. Unlike Like BINARY, but intended for very large values such as files or images. Unlike
when using BINARY, large objects are not kept fully in-memory. Use when using BINARY, large objects are not kept fully in-memory. Use
...@@ -2004,8 +2021,7 @@ BLOB ...@@ -2004,8 +2021,7 @@ BLOB
" "
"Data Types","CLOB Type"," "Data Types","CLOB Type","
{CLOB | TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT | NTEXT | NCLOB} { CLOB | TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT | NTEXT | NCLOB } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
CLOB is like VARCHAR, but intended for very large values. Unlike when using CLOB is like VARCHAR, but intended for very large values. Unlike when using
VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed. VARCHAR, large CLOB objects are not kept fully in-memory; instead, they are streamed.
...@@ -2037,7 +2053,7 @@ UUID ...@@ -2037,7 +2053,7 @@ UUID
ARRAY ARRAY
"," ","
An array of values. Use a value list (1, 2) or PreparedStatement.setObject(.., An array of values. Use a value list (1, 2) or PreparedStatement.setObject(..,
new Object[]{..}) to store values. new Object[] {..}) to store values.
Mapped to java.lang.Object[] (arrays of any non-primitive type are also supported). Mapped to java.lang.Object[] (arrays of any non-primitive type are also supported).
"," ","
...@@ -2045,7 +2061,7 @@ ARRAY ...@@ -2045,7 +2061,7 @@ ARRAY
" "
"Functions (Aggregate)","AVG"," "Functions (Aggregate)","AVG","
AVG([DISTINCT] {int | long | decimal | double}): value AVG ( [ DISTINCT ] { int | long | decimal | double } ): value
"," ","
The average (mean) value. If no rows are selected, the result is NULL. The average (mean) value. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements. Aggregates are only allowed in select statements.
...@@ -2072,7 +2088,7 @@ BOOL_OR(NAME LIKE 'W%') ...@@ -2072,7 +2088,7 @@ BOOL_OR(NAME LIKE 'W%')
" "
"Functions (Aggregate)","COUNT"," "Functions (Aggregate)","COUNT","
COUNT(*) | COUNT([DISTINCT] expression): long COUNT(*) | COUNT( [ DISTINCT ] expression ): long
"," ","
The count of all row, or of the non-null values. If no rows are selected, the The count of all row, or of the non-null values. If no rows are selected, the
result is 0. Aggregates are only allowed in select statements. result is 0. Aggregates are only allowed in select statements.
...@@ -2081,8 +2097,9 @@ COUNT(*) ...@@ -2081,8 +2097,9 @@ COUNT(*)
" "
"Functions (Aggregate)","GROUP_CONCAT"," "Functions (Aggregate)","GROUP_CONCAT","
GROUP_CONCAT([DISTINCT] string [ORDER BY {expression [ASC|DESC]}[,...]] GROUP_CONCAT ( [ DISTINCT ] string
[SEPARATOR expression]): string [ ORDER BY { expression [ ASC | DESC ] } [,...] ]
[ SEPARATOR expression ] ): string
"," ","
Concatenates strings with a separator. The default separator is a ',' (without Concatenates strings with a separator. The default separator is a ',' (without
space). If no rows are selected, the result is NULL. Aggregates are only allowed space). If no rows are selected, the result is NULL. Aggregates are only allowed
...@@ -2110,7 +2127,7 @@ MIN(NAME) ...@@ -2110,7 +2127,7 @@ MIN(NAME)
" "
"Functions (Aggregate)","SUM"," "Functions (Aggregate)","SUM","
SUM([DISTINCT] {int | long | decimal | double}): value SUM( [ DISTINCT ] { int | long | decimal | double } ): value
"," ","
The sum of all values. If no rows are selected, the result is NULL. Aggregates The sum of all values. If no rows are selected, the result is NULL. Aggregates
are only allowed in select statements. are only allowed in select statements.
...@@ -2129,7 +2146,7 @@ SELECT SELECTIVITY(FIRSTNAME), SELECTIVITY(NAME) FROM TEST WHERE ROWNUM()<20000 ...@@ -2129,7 +2146,7 @@ SELECT SELECTIVITY(FIRSTNAME), SELECTIVITY(NAME) FROM TEST WHERE ROWNUM()<20000
" "
"Functions (Aggregate)","STDDEV_POP"," "Functions (Aggregate)","STDDEV_POP","
STDDEV_POP([DISTINCT] double): double STDDEV_POP( [ DISTINCT ] double ): double
"," ","
The population standard deviation. If no rows are selected, the result is NULL. The population standard deviation. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements. Aggregates are only allowed in select statements.
...@@ -2138,7 +2155,7 @@ STDDEV_POP(X) ...@@ -2138,7 +2155,7 @@ STDDEV_POP(X)
" "
"Functions (Aggregate)","STDDEV_SAMP"," "Functions (Aggregate)","STDDEV_SAMP","
STDDEV_SAMP([DISTINCT] double): double STDDEV_SAMP( [ DISTINCT ] double ): double
"," ","
The sample standard deviation. If no rows are selected, the result is NULL. The sample standard deviation. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements. Aggregates are only allowed in select statements.
...@@ -2147,7 +2164,7 @@ STDDEV(X) ...@@ -2147,7 +2164,7 @@ STDDEV(X)
" "
"Functions (Aggregate)","VAR_POP"," "Functions (Aggregate)","VAR_POP","
VAR_POP([DISTINCT] double): double VAR_POP( [ DISTINCT ] double ): double
"," ","
The population variance (square of the population standard deviation). If no The population variance (square of the population standard deviation). If no
rows are selected, the result is NULL. Aggregates are only allowed in select rows are selected, the result is NULL. Aggregates are only allowed in select
...@@ -2157,7 +2174,7 @@ VAR_POP(X) ...@@ -2157,7 +2174,7 @@ VAR_POP(X)
" "
"Functions (Aggregate)","VAR_SAMP"," "Functions (Aggregate)","VAR_SAMP","
VAR_SAMP([DISTINCT] double): double VAR_SAMP( [ DISTINCT ] double ): double
"," ","
The sample variance (square of the sample standard deviation). If no rows are The sample variance (square of the sample standard deviation). If no rows are
selected, the result is NULL. Aggregates are only allowed in select statements. selected, the result is NULL. Aggregates are only allowed in select statements.
...@@ -2166,7 +2183,7 @@ VAR_SAMP(X) ...@@ -2166,7 +2183,7 @@ VAR_SAMP(X)
" "
"Functions (Numeric)","ABS"," "Functions (Numeric)","ABS","
ABS({int | long | decimal | double}): value ABS ( { int | long | decimal | double } ): value
"," ","
See also Java Math.abs. Please note that Math.abs(Integer.MIN_VALUE) == See also Java Math.abs. Please note that Math.abs(Integer.MIN_VALUE) ==
Integer.MIN_VALUE and Math.abs(Long.MIN_VALUE) == Long.MIN_VALUE. Integer.MIN_VALUE and Math.abs(Long.MIN_VALUE) == Long.MIN_VALUE.
...@@ -2351,7 +2368,7 @@ POWER(A, B) ...@@ -2351,7 +2368,7 @@ POWER(A, B)
" "
"Functions (Numeric)","RAND"," "Functions (Numeric)","RAND","
RAND([int]): double RAND( [ int ] ): double
"," ","
Calling the function without parameter returns the next a pseudo random number. Calling the function without parameter returns the next a pseudo random number.
Calling it with an parameter seeds the session's random number generator. Calling it with an parameter seeds the session's random number generator.
...@@ -2396,7 +2413,7 @@ CALL SECURE_RAND(16) ...@@ -2396,7 +2413,7 @@ CALL SECURE_RAND(16)
" "
"Functions (Numeric)","SIGN"," "Functions (Numeric)","SIGN","
SIGN({int | long | decimal | double}): int SIGN ( { int | long | decimal | double } ): int
"," ","
Returns -1 if the value is smaller 0, 0 if zero, and otherwise 1. Returns -1 if the value is smaller 0, 0 if zero, and otherwise 1.
"," ","
...@@ -2483,7 +2500,7 @@ BIT_LENGTH(NAME) ...@@ -2483,7 +2500,7 @@ BIT_LENGTH(NAME)
" "
"Functions (String)","LENGTH"," "Functions (String)","LENGTH","
{LENGTH | CHAR_LENGTH | CHARACTER_LENGTH}(string): long { LENGTH | CHAR_LENGTH | CHARACTER_LENGTH } ( string ): long
"," ","
Returns the number of characters in a string. For BLOB, CLOB, BYTES and Returns the number of characters in a string. For BLOB, CLOB, BYTES and
JAVA_OBJECT, the precision is used. JAVA_OBJECT, the precision is used.
...@@ -2501,7 +2518,7 @@ OCTET_LENGTH(NAME) ...@@ -2501,7 +2518,7 @@ OCTET_LENGTH(NAME)
" "
"Functions (String)","CHAR"," "Functions (String)","CHAR","
{CHAR | CHR}(int): string { CHAR | CHR } ( int ): string
"," ","
Returns the character that represents the ASCII value. Returns the character that represents the ASCII value.
"," ","
...@@ -2563,7 +2580,7 @@ INSERT(NAME, 1, 1, ' ') ...@@ -2563,7 +2580,7 @@ INSERT(NAME, 1, 1, ' ')
" "
"Functions (String)","LOWER"," "Functions (String)","LOWER","
{LOWER | LCASE}(string): string { LOWER | LCASE } ( string ): string
"," ","
Converts a string to lowercase. Converts a string to lowercase.
"," ","
...@@ -2571,7 +2588,7 @@ LOWER(NAME) ...@@ -2571,7 +2588,7 @@ LOWER(NAME)
" "
"Functions (String)","UPPER"," "Functions (String)","UPPER","
{UPPER | UCASE}(string): string { UPPER | UCASE } ( string ): string
"," ","
Converts a string to uppercase. Converts a string to uppercase.
"," ","
...@@ -2649,8 +2666,7 @@ RTRIM(NAME) ...@@ -2649,8 +2666,7 @@ RTRIM(NAME)
" "
"Functions (String)","TRIM"," "Functions (String)","TRIM","
TRIM([{LEADING | TRAILING | BOTH} [string] FROM] TRIM ( [ { LEADING | TRAILING | BOTH } [ string ] FROM ] string ): string
string): string
"," ","
Removes all leading spaces, trailing spaces, or spaces at both ends, from a Removes all leading spaces, trailing spaces, or spaces at both ends, from a
string. Other characters can be removed as well. string. Other characters can be removed as well.
...@@ -2730,7 +2746,7 @@ CALL UTF8TOSTRING(STRINGTOUTF8('This is a test')) ...@@ -2730,7 +2746,7 @@ CALL UTF8TOSTRING(STRINGTOUTF8('This is a test'))
" "
"Functions (String)","SUBSTRING"," "Functions (String)","SUBSTRING","
{SUBSTRING | SUBSTR}(string, startInt [, lengthInt]): string { SUBSTRING | SUBSTR } ( string, startInt [, lengthInt ] ): string
"," ","
Returns a substring of a string starting at a position. The length is optional. Returns a substring of a string starting at a position. The length is optional.
Also supported is: SUBSTRING(string FROM start [FOR length]). Also supported is: SUBSTRING(string FROM start [FOR length]).
...@@ -2797,7 +2813,7 @@ CALL XMLTEXT('test') ...@@ -2797,7 +2813,7 @@ CALL XMLTEXT('test')
" "
"Functions (Time and Date)","CURRENT_DATE"," "Functions (Time and Date)","CURRENT_DATE","
{CURRENT_DATE[()] | CURDATE() | SYSDATE | TODAY}: date { CURRENT_DATE [ () ] | CURDATE() | SYSDATE | TODAY }: date
"," ","
Returns the current date. Returns the current date.
"," ","
...@@ -2805,7 +2821,7 @@ CURRENT_DATE() ...@@ -2805,7 +2821,7 @@ CURRENT_DATE()
" "
"Functions (Time and Date)","CURRENT_TIME"," "Functions (Time and Date)","CURRENT_TIME","
{CURRENT_TIME[()] | CURTIME()}: time { CURRENT_TIME [ () ] | CURTIME() }: time
"," ","
Returns the current time. Returns the current time.
"," ","
...@@ -2813,7 +2829,7 @@ CURRENT_TIME() ...@@ -2813,7 +2829,7 @@ CURRENT_TIME()
" "
"Functions (Time and Date)","CURRENT_TIMESTAMP"," "Functions (Time and Date)","CURRENT_TIMESTAMP","
{CURRENT_TIMESTAMP[([int])] | NOW([int])}: timestamp { CURRENT_TIMESTAMP [ ( [ int ] ) ] | NOW( [ int ] ) }: timestamp
"," ","
Returns the current timestamp. The precision parameter for nanoseconds precision Returns the current timestamp. The precision parameter for nanoseconds precision
is optional. is optional.
...@@ -2872,10 +2888,9 @@ DAY_OF_YEAR(CREATED) ...@@ -2872,10 +2888,9 @@ DAY_OF_YEAR(CREATED)
" "
"Functions (Time and Date)","EXTRACT"," "Functions (Time and Date)","EXTRACT","
EXTRACT( EXTRACT ( { YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR
{YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR | DOY | | DOY | HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS }
HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS} FROM timestamp ): int
FROM timestamp): int
"," ","
Returns a specific value from a timestamps. Returns a specific value from a timestamps.
"," ","
...@@ -2883,8 +2898,8 @@ EXTRACT(SECOND FROM CURRENT_TIMESTAMP) ...@@ -2883,8 +2898,8 @@ EXTRACT(SECOND FROM CURRENT_TIMESTAMP)
" "
"Functions (Time and Date)","FORMATDATETIME"," "Functions (Time and Date)","FORMATDATETIME","
FORMATDATETIME(timestamp, formatString [, localeString FORMATDATETIME ( timestamp, formatString
[, timeZoneString]]): string [ , localeString [ , timeZoneString ] ] ): string
"," ","
Formats a date, time or timestamp as a string. The most important format Formats a date, time or timestamp as a string. The most important format
characters are: y year, M month, d day, H hour, m minute, s second For details characters are: y year, M month, d day, H hour, m minute, s second For details
...@@ -2927,7 +2942,8 @@ MONTHNAME(CREATED) ...@@ -2927,7 +2942,8 @@ MONTHNAME(CREATED)
" "
"Functions (Time and Date)","PARSEDATETIME"," "Functions (Time and Date)","PARSEDATETIME","
PARSEDATETIME(string, formatString [, localeString [, timeZoneString]]): string PARSEDATETIME(string, formatString
[, localeString [, timeZoneString]]): string
"," ","
Parses a string and returns a timestamp. The most important format characters Parses a string and returns a timestamp. The most important format characters
are: y year, M month, d day, H hour, m minute, s second For details of the are: y year, M month, d day, H hour, m minute, s second For details of the
...@@ -3041,7 +3057,7 @@ CONVERT(NAME, INT) ...@@ -3041,7 +3057,7 @@ CONVERT(NAME, INT)
" "
"Functions (System)","CURRVAL"," "Functions (System)","CURRVAL","
CURRVAL([schemaName, ] sequenceString): long CURRVAL( [ schemaName, ] sequenceString ): long
"," ","
Returns the current (last) value of the sequence, independent of the session. If Returns the current (last) value of the sequence, independent of the session. If
the sequence was just created, the method returns (start - interval). If the the sequence was just created, the method returns (start - interval). If the
...@@ -3052,9 +3068,7 @@ CURRVAL('TEST_SEQ') ...@@ -3052,9 +3068,7 @@ CURRVAL('TEST_SEQ')
" "
"Functions (System)","CSVREAD"," "Functions (System)","CSVREAD","
CSVREAD(fileNameString [, columnNamesString [, charsetString CSVREAD(fileNameString [, columnsString [, csvOptions ] ] ): resultSetValue
[, fieldSeparatorString [, fieldDelimiterString [, escapeCharacterString
[, nullString]]]]]]): resultSet
"," ","
Returns the result set of reading the CSV (comma separated values) file. For Returns the result set of reading the CSV (comma separated values) file. For
each parameter, NULL means the default value should be used. each parameter, NULL means the default value should be used.
...@@ -3084,9 +3098,7 @@ SELECT ""Last Name"" FROM CSVREAD('address.csv'); ...@@ -3084,9 +3098,7 @@ SELECT ""Last Name"" FROM CSVREAD('address.csv');
" "
"Functions (System)","CSVWRITE"," "Functions (System)","CSVWRITE","
CSVWRITE(fileNameString, queryString [, charsetString [, fieldSeparatorString CSVWRITE ( fileNameString, queryString [, csvOptions [, lineSepString] ] ): int
[, fieldDelimiterString [, escapeCharacterString [, nullString
[, lineSeparatorString]]]]]]): int
"," ","
Writes a CSV (comma separated values). The file is overwritten if it exists. For Writes a CSV (comma separated values). The file is overwritten if it exists. For
each parameter, NULL means the default value should be used. The default charset each parameter, NULL means the default value should be used. The default charset
...@@ -3186,7 +3198,7 @@ LOCK_TIMEOUT() ...@@ -3186,7 +3198,7 @@ LOCK_TIMEOUT()
"Functions (System)","LINK_SCHEMA"," "Functions (System)","LINK_SCHEMA","
LINK_SCHEMA(targetSchemaString, driverString, urlString, LINK_SCHEMA(targetSchemaString, driverString, urlString,
userString, passwordString, sourceSchemaString): resultSet userString, passwordString, sourceSchemaString): resultSetValue
"," ","
Creates table links for all tables in a schema. If tables with the same name Creates table links for all tables in a schema. If tables with the same name
already exist, they are dropped first. The target schema is created already exist, they are dropped first. The target schema is created
...@@ -3218,7 +3230,7 @@ MEMORY_USED() ...@@ -3218,7 +3230,7 @@ MEMORY_USED()
" "
"Functions (System)","NEXTVAL"," "Functions (System)","NEXTVAL","
NEXTVAL([schemaName, ] sequenceString): long NEXTVAL ( [ schemaName, ] sequenceString ): long
"," ","
Returns the next value of the sequence. Used values are never re-used, even when Returns the next value of the sequence. Used values are never re-used, even when
the transaction is rolled back. If the schema name is not set, the current the transaction is rolled back. If the schema name is not set, the current
...@@ -3284,7 +3296,7 @@ SELECT X, SET(@I, IFNULL(@I, 0)+X) RUNNING_TOTAL FROM SYSTEM_RANGE(1, 10) ...@@ -3284,7 +3296,7 @@ SELECT X, SET(@I, IFNULL(@I, 0)+X) RUNNING_TOTAL FROM SYSTEM_RANGE(1, 10)
" "
"Functions (System)","TABLE"," "Functions (System)","TABLE","
TABLE|TABLE_DISTINCT( { name dataType = expression } [,..]): result set { TABLE | TABLE_DISTINCT } ( { name dataType = expression } [,...] ): resultSetValue
"," ","
Returns the result set. TABLE_DISTINCT removes duplicate rows. Returns the result set. TABLE_DISTINCT removes duplicate rows.
"," ","
...@@ -3304,7 +3316,7 @@ CALL TRANSACTION_ID() ...@@ -3304,7 +3316,7 @@ CALL TRANSACTION_ID()
" "
"Functions (System)","USER"," "Functions (System)","USER","
{USER | CURRENT_USER}(): string { USER | CURRENT_USER } (): string
"," ","
Returns the name of the current user of this session. Returns the name of the current user of this session.
"," ","
......
...@@ -24,9 +24,14 @@ Data Types ...@@ -24,9 +24,14 @@ Data Types
<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>
<!-- railroad-start -->
${item.railroad}
<!-- railroad-end -->
<!-- syntax-start
<pre> <pre>
${item.syntax} ${item.syntax}
</pre> </pre>
syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <b>Example:</b>
<p class="notranslate">${item.example}</p> <p class="notranslate">${item.example}</p>
......
...@@ -54,9 +54,14 @@ Functions ...@@ -54,9 +54,14 @@ Functions
<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>
<!-- railroad-start -->
${item.railroad}
<!-- railroad-end -->
<!-- syntax-start
<pre> <pre>
${item.syntax} ${item.syntax}
</pre> </pre>
syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <b>Example:</b>
<p class="notranslate">${item.example}</p> <p class="notranslate">${item.example}</p>
......
...@@ -52,9 +52,14 @@ SQL Grammar ...@@ -52,9 +52,14 @@ SQL Grammar
<c:forEach var="item" items="commands"> <c:forEach var="item" items="commands">
<h3 id="${item.link}" class="notranslate">${item.topic}</h3> <h3 id="${item.link}" class="notranslate">${item.topic}</h3>
<!-- railroad-start -->
${item.railroad}
<!-- railroad-end -->
<!-- syntax-start
<pre> <pre>
${item.syntax} ${item.syntax}
</pre> </pre>
syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <b>Example:</b>
<p class="notranslate">${item.example}</p> <p class="notranslate">${item.example}</p>
...@@ -62,9 +67,14 @@ ${item.syntax} ...@@ -62,9 +67,14 @@ ${item.syntax}
<c:forEach var="item" items="otherGrammar"> <c:forEach var="item" items="otherGrammar">
<h3 id="${item.link}" class="notranslate">${item.topic}</h3> <h3 id="${item.link}" class="notranslate">${item.topic}</h3>
<!-- railroad-start -->
${item.railroad}
<!-- railroad-end -->
<!-- syntax-start
<pre> <pre>
${item.syntax} ${item.syntax}
</pre> </pre>
syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <b>Example:</b>
<p class="notranslate">${item.example}</p> <p class="notranslate">${item.example}</p>
......
...@@ -210,3 +210,90 @@ td.content { ...@@ -210,3 +210,90 @@ td.content {
.compareN { .compareN {
color: #800; color: #800;
} }
.railroad {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
}
.c {
padding: 1px 3px;
margin: 0px 0px;
border: 2px solid;
-moz-border-radius: 0.4em;
border-radius: 0.4em;
background-color: #fff;
}
.ts {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ts.png);
width: 16px;
}
.ls {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ls.png);
width: 16px;
}
.ks {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ks.png);
width: 16px;
}
.te {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-te.png);
width: 16px;
}
.le {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-le.png);
width: 16px;
}
.ke {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ke.png);
width: 16px;
}
.d {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-d.png);
background-repeat: repeat-x;
min-width: 16px;
}
...@@ -127,3 +127,90 @@ em.u { ...@@ -127,3 +127,90 @@ em.u {
.compareN { .compareN {
color: #800; color: #800;
} }
.railroad {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
}
.c {
padding: 1px 3px;
margin: 0px 0px;
border: 2px solid;
-moz-border-radius: 0.4em;
border-radius: 0.4em;
background-color: #fff;
}
.ts {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ts.png);
width: 16px;
}
.ls {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ls.png);
width: 16px;
}
.ks {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ks.png);
width: 16px;
}
.te {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-te.png);
width: 16px;
}
.le {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-le.png);
width: 16px;
}
.ke {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-ke.png);
width: 16px;
}
.d {
border: 0px;
padding: 0px;
margin: 0px;
border-collapse: collapse;
vertical-align: top;
height: 24px;
background-image: url(images/div-d.png);
background-repeat: repeat-x;
min-width: 16px;
}
...@@ -8120,7 +8120,7 @@ Bugfixes ...@@ -8120,7 +8120,7 @@ Bugfixes
Page store: new storage mechanism Page store: new storage mechanism
@roadmap_1009_li @roadmap_1009_li
[Requires page store] Support large updates (use the transaction log for rollback). [Requires page store] Support large updates (use the transaction log for rollback instead of persistent UndoLog.file).
@roadmap_1010_li @roadmap_1010_li
[Requires page store] Shutdown compact [Requires page store] Shutdown compact
......
...@@ -8120,7 +8120,7 @@ H2 コンソール アプリケーション ...@@ -8120,7 +8120,7 @@ H2 コンソール アプリケーション
#Page store: new storage mechanism #Page store: new storage mechanism
@roadmap_1009_li @roadmap_1009_li
#[Requires page store] Support large updates (use the transaction log for rollback). #[Requires page store] Support large updates (use the transaction log for rollback instead of persistent UndoLog.file).
@roadmap_1010_li @roadmap_1010_li
#[Requires page store] Shutdown compact #[Requires page store] Shutdown compact
......
...@@ -2705,7 +2705,7 @@ roadmap_1005_li=Enable the system property h2.pageStore by default. ...@@ -2705,7 +2705,7 @@ roadmap_1005_li=Enable the system property h2.pageStore by default.
roadmap_1006_h2=Priority 1 roadmap_1006_h2=Priority 1
roadmap_1007_li=Bugfixes roadmap_1007_li=Bugfixes
roadmap_1008_li=Page store\: new storage mechanism roadmap_1008_li=Page store\: new storage mechanism
roadmap_1009_li=[Requires page store] Support large updates (use the transaction log for rollback). roadmap_1009_li=[Requires page store] Support large updates (use the transaction log for rollback instead of persistent UndoLog.file).
roadmap_1010_li=[Requires page store] Shutdown compact roadmap_1010_li=[Requires page store] Shutdown compact
roadmap_1011_li=More tests with MULTI_THREADED\=1 roadmap_1011_li=More tests with MULTI_THREADED\=1
roadmap_1012_li=RECOVER\=1 should automatically recover, \=2 should run the recovery tool if required roadmap_1012_li=RECOVER\=1 should automatically recover, \=2 should run the recovery tool if required
......
...@@ -31,6 +31,11 @@ import org.h2.util.StringUtils; ...@@ -31,6 +31,11 @@ import org.h2.util.StringUtils;
public class Bnf { public class Bnf {
private final Random random = new Random(); private final Random random = new Random();
/**
* The rule map. The key is lowercase, and all spaces
* are replaces with underscore.
*/
private final HashMap<String, RuleHead> ruleMap = New.hashMap(); private final HashMap<String, RuleHead> ruleMap = New.hashMap();
private String syntax; private String syntax;
private String currentToken; private String currentToken;
...@@ -68,10 +73,11 @@ public class Bnf { ...@@ -68,10 +73,11 @@ public class Bnf {
private RuleHead addRule(String topic, String section, Rule rule) { private RuleHead addRule(String topic, String section, Rule rule) {
RuleHead head = new RuleHead(section, topic, rule); RuleHead head = new RuleHead(section, topic, rule);
if (ruleMap.get(StringUtils.toLowerEnglish(topic)) != null) { String key = StringUtils.toLowerEnglish(topic.trim().replace(' ', '_'));
if (ruleMap.get(key) != null) {
throw new AssertionError("already exists: " + topic); throw new AssertionError("already exists: " + topic);
} }
ruleMap.put(StringUtils.toLowerEnglish(topic), head); ruleMap.put(key, head);
return head; return head;
} }
...@@ -88,9 +94,7 @@ public class Bnf { ...@@ -88,9 +94,7 @@ public class Bnf {
if (section.startsWith("System")) { if (section.startsWith("System")) {
continue; continue;
} }
String topic = StringUtils.toLowerEnglish(rs.getString("TOPIC").trim()); String topic = rs.getString("TOPIC");
topic = StringUtils.replaceAll(topic, " ", "_");
// topic = StringUtils.replaceAll(topic, "_", "");
syntax = rs.getString("SYNTAX").trim(); syntax = rs.getString("SYNTAX").trim();
currentTopic = section; currentTopic = section;
if (section.startsWith("Function")) { if (section.startsWith("Function")) {
...@@ -131,6 +135,32 @@ public class Bnf { ...@@ -131,6 +135,32 @@ public class Bnf {
addFixedRule("@digit@", RuleFixed.DIGIT); addFixedRule("@digit@", RuleFixed.DIGIT);
} }
/**
* Get the HTML railroad for a given syntax.
*
* @param syntax the syntax
* @return the HTML formatted railroad
*/
public String getRailroadHtml(String syntax) {
syntax = StringUtils.replaceAll(syntax, "\n ", " ");
String[] syntaxList = StringUtils.arraySplit(syntax, '\n', true);
StringBuilder buff = new StringBuilder();
for (String s : syntaxList) {
this.syntax = s;
tokens = tokenize();
index = 0;
Rule rule = parseRule();
rule.setLinks(ruleMap);
String html = rule.getHtmlRailroad(this, false);
html = StringUtils.replaceAll(html, "</code></td><td class=\"d\"><code class=\"c\">", " ");
if (buff.length() > 0) {
buff.append("<br />");
}
buff.append(html);
}
return buff.toString();
}
/** /**
* Get the HTML documentation for a given syntax. * Get the HTML documentation for a given syntax.
* *
...@@ -138,40 +168,77 @@ public class Bnf { ...@@ -138,40 +168,77 @@ public class Bnf {
* @return the HTML formatted text * @return the HTML formatted text
*/ */
public String getSyntaxHtml(String bnf) { public String getSyntaxHtml(String bnf) {
bnf = StringUtils.replaceAll(bnf, "\n ", "\n");
StringTokenizer tokenizer = getTokenizer(bnf); StringTokenizer tokenizer = getTokenizer(bnf);
StringBuilder buff = new StringBuilder(); StringBuilder buff = new StringBuilder();
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
String s = tokenizer.nextToken(); String s = tokenizer.nextToken();
if (s.length() == 1 || StringUtils.toUpperEnglish(s).equals(s)) { if (s.length() == 1 || StringUtils.toUpperEnglish(s).equals(s)) {
buff.append(s); buff.append(StringUtils.xmlText(s));
continue; continue;
} }
RuleHead found = null; buff.append(getLink(s));
for (int i = 0; i < s.length(); i++) { }
String test = StringUtils.toLowerEnglish(s.substring(i)); String s = buff.toString();
RuleHead r = ruleMap.get(test); // ensure it works within XHTML comments
if (r != null) { s = StringUtils.replaceAll(s, "--", "&#45;-");
found = r; return s;
break; }
}
} /**
if (found == null || found.getRule() instanceof RuleFixed) { * Convert convert ruleLink to rule_link.
buff.append(s); *
continue; * @param token the token
} * @return the rule map key
String page = "grammar.html"; */
if (found.getSection().startsWith("Data Types")) { static String getRuleMapKey(String token) {
page = "datatypes.html"; StringBuilder buff = new StringBuilder();
} else if (found.getSection().startsWith("Functions")) { for (char ch : token.toCharArray()) {
page = "functions.html"; if (Character.isUpperCase(ch)) {
buff.append('_').append(Character.toLowerCase(ch));
} else {
buff.append(ch);
} }
String link = StringUtils.urlEncode(found.getTopic().toLowerCase());
buff.append("<a href=\"").append(page).append("#").
append(link).append("\">").append(s).append("</a>");
} }
return buff.toString(); return buff.toString();
} }
/**
* Get the HTML link for the given token, or the token itself if no link
* exists.
*
* @param token the token
* @return the HTML link
*/
String getLink(String token) {
RuleHead found = null;
String key = getRuleMapKey(token);
for (int i = 0; i < token.length(); i++) {
String test = StringUtils.toLowerEnglish(key.substring(i));
RuleHead r = ruleMap.get(test);
if (r != null) {
found = r;
break;
}
}
if (found == null) {
return token;
}
String page = "grammar.html";
if (found.getSection().startsWith("Data Types")) {
page = "datatypes.html";
} else if (found.getSection().startsWith("Functions")) {
page = "functions.html";
} else if (token.equals("@func@")) {
return "<a href=\"functions.html\">Function</a>";
} else if (found.getRule() instanceof RuleFixed) {
return found.getRule().getHtmlRailroad(this, false);
}
String link = found.getTopic().toLowerCase().replace(' ', '_');
link = page + "#" + StringUtils.urlEncode(link);
return "<a href=\"" + link + "\">" + token + "</a>";
}
private Rule parseRule() { private Rule parseRule() {
read(); read();
return parseOr(); return parseOr();
...@@ -216,9 +283,9 @@ public class Bnf { ...@@ -216,9 +283,9 @@ public class Bnf {
} }
} else if ("@commaDots@".equals(currentToken)) { } else if ("@commaDots@".equals(currentToken)) {
r = new RuleList(new RuleElement(",", currentTopic), lastRepeat, false); r = new RuleList(new RuleElement(",", currentTopic), lastRepeat, false);
r = new RuleRepeat(r); r = new RuleRepeat(r, true);
} else if ("@dots@".equals(currentToken)) { } else if ("@dots@".equals(currentToken)) {
r = new RuleRepeat(lastRepeat); r = new RuleRepeat(lastRepeat, false);
} else { } else {
r = new RuleElement(currentToken, currentTopic); r = new RuleElement(currentToken, currentTopic);
} }
......
...@@ -62,4 +62,13 @@ public interface Rule { ...@@ -62,4 +62,13 @@ public interface Rule {
*/ */
boolean matchRemove(Sentence sentence); boolean matchRemove(Sentence sentence);
/**
* Get the HTML railroad.
*
* @param config the configuration
* @param topLevel true if line break are permitted
* @return the railroad
*/
String getHtmlRailroad(Bnf config, boolean topLevel);
} }
...@@ -33,6 +33,16 @@ public class RuleElement implements Rule { ...@@ -33,6 +33,16 @@ public class RuleElement implements Rule {
return name; return name;
} }
public String getHtmlRailroad(Bnf config, boolean topLevel) {
String x;
if (keyword) {
x = StringUtils.xmlText(name.trim());
} else {
x = config.getLink(name.trim());
}
return "<code class=\"c\">" + x + "</code>";
}
public String random(Bnf config, int level) { public String random(Bnf config, int level) {
if (keyword) { if (keyword) {
return name.length() > 1 ? " " + name + " " : name; return name.length() > 1 ? " " + name + " " : name;
...@@ -58,17 +68,8 @@ public class RuleElement implements Rule { ...@@ -58,17 +68,8 @@ public class RuleElement implements Rule {
if (keyword) { if (keyword) {
return; return;
} }
StringBuilder buff = new StringBuilder(); String test = Bnf.getRuleMapKey(name);
for (char c : name.toCharArray()) { for (int i = 0; i < test.length(); i++) {
if (Character.isUpperCase(c)) {
buff.append('_');
buff.append(Character.toLowerCase(c));
} else {
buff.append(c);
}
}
String test = buff.toString();
for (int i = 0; i < name.length(); i++) {
String t = test.substring(i); String t = test.substring(i);
RuleHead r = ruleMap.get(t); RuleHead r = ruleMap.get(t);
if (r != null) { if (r != null) {
......
...@@ -59,6 +59,41 @@ public class RuleFixed implements Rule { ...@@ -59,6 +59,41 @@ public class RuleFixed implements Rule {
} }
} }
public String getHtmlRailroad(Bnf config, boolean topLevel) {
return getHtmlText();
}
public String getHtmlText() {
switch(type) {
case YMD:
return "2000-01-01";
case HMS:
return "12:00";
case NANOS:
return "0";
case ANY_UNTIL_EOL:
case ANY_EXCEPT_SINGLE_QUOTE:
case ANY_EXCEPT_DOUBLE_QUOTE:
case ANY_WORD:
case ANY_EXCEPT_2_DOLLAR:
case ANY_UNTIL_END: {
return "anything";
}
case HEX_START:
return "0x";
case CONCAT:
return "||";
case AZ_UNDERSCORE:
return "A-Z | _";
case AF:
return "A-F";
case DIGIT:
return "0-9";
default:
throw new AssertionError("type="+type);
}
}
public String random(Bnf config, int level) { public String random(Bnf config, int level) {
Random r = config.getRandom(); Random r = config.getRandom();
switch(type) { switch(type) {
......
...@@ -53,6 +53,40 @@ public class RuleList implements Rule { ...@@ -53,6 +53,40 @@ public class RuleList implements Rule {
return buff.toString(); return buff.toString();
} }
public String getHtmlRailroad(Bnf config, boolean topLevel) {
StringBuilder buff = new StringBuilder();
if (or) {
buff.append("<table class=\"railroad\">");
int i = 0;
for (Rule r : list) {
String a = i == 0 ? "t" : i == list.size() - 1 ? "l" : "k";
i++;
buff.append("<tr class=\"railroad\"><td class=\"" + a + "s\"></td><td class=\"d\">");
buff.append(r.getHtmlRailroad(config, false));
buff.append("</td><td class=\"" + a + "e\"></td></tr>");
}
buff.append("</table>");
} else {
if (!topLevel) {
buff.append("<table class=\"railroad\">");
buff.append("<tr class=\"railroad\">");
}
for (Rule r : list) {
if (!topLevel) {
buff.append("<td class=\"d\">");
}
buff.append(r.getHtmlRailroad(config, false));
if (!topLevel) {
buff.append("</td>");
}
}
if (!topLevel) {
buff.append("</tr></table>");
}
}
return buff.toString();
}
public String random(Bnf config, int level) { public String random(Bnf config, int level) {
if (or) { if (or) {
if (level > 10) { if (level > 10) {
......
...@@ -23,6 +23,16 @@ public class RuleOptional implements Rule { ...@@ -23,6 +23,16 @@ public class RuleOptional implements Rule {
return "[" + rule.toString() + "]"; return "[" + rule.toString() + "]";
} }
public String getHtmlRailroad(Bnf config, boolean topLevel) {
StringBuilder buff = new StringBuilder();
buff.append("<table class=\"railroad\">");
buff.append("<tr class=\"railroad\"><td class=\"ts\"></td><td class=\"d\">&nbsp;</td><td class=\"te\"></td></tr>");
buff.append("<tr class=\"railroad\"><td class=\"ls\"></td><td class=\"d\">");
buff.append(rule.getHtmlRailroad(config, false));
buff.append("</td><td class=\"le\"></td></tr></table>");
return buff.toString();
}
public String name() { public String name() {
return null; return null;
} }
......
...@@ -13,16 +13,41 @@ import java.util.HashMap; ...@@ -13,16 +13,41 @@ import java.util.HashMap;
*/ */
public class RuleRepeat implements Rule { public class RuleRepeat implements Rule {
private Rule rule; private static final boolean RAILROAD_DOTS = true;
RuleRepeat(Rule rule) { private final Rule rule;
private final boolean comma;
RuleRepeat(Rule rule, boolean comma) {
this.rule = rule; this.rule = rule;
this.comma = comma;
} }
public String toString() { public String toString() {
return "..."; return "...";
} }
public String getHtmlRailroad(Bnf config, boolean topLevel) {
StringBuilder buff = new StringBuilder();
if (RAILROAD_DOTS) {
buff.append("<code class=\"c\">");
if (comma) {
buff.append(", ");
}
buff.append("...</code>");
} else {
buff.append("<table class=\"railroad\">");
buff.append("<tr class=\"railroad\"><td class=\"te\"></td>");
buff.append("<td class=\"d\">");
buff.append(rule.getHtmlRailroad(config, false));
buff.append("</td><td class=\"ts\"></td></tr>");
buff.append("<tr class=\"railroad\"><td class=\"ls\"></td>");
buff.append("<td class=\"d\">&nbsp;</td>");
buff.append("<td class=\"le\"></td></tr></table>");
}
return buff.toString();
}
public String name() { public String name() {
return rule.name(); return rule.name();
} }
......
...@@ -4,25 +4,25 @@ ...@@ -4,25 +4,25 @@
# Initial Developer: H2 Group) # Initial Developer: H2 Group)
"SECTION","TOPIC","SYNTAX","TEXT" "SECTION","TOPIC","SYNTAX","TEXT"
"Commands (DML)","SELECT"," "Commands (DML)","SELECT","
{SELECT selectPart FROM fromPart | FROM fromPart SELECT selectPart} SELECT [ TOP term ] [ DISTINCT | ALL ] selectExpression [,...]
[WHERE expression] [GROUP BY expression [,...]] [HAVING expression] FROM tableExpression [,...] [ WHERE expression ]
[{UNION [ALL] | MINUS | EXCEPT | INTERSECT} select] [ GROUP BY expression [,...] ] [ HAVING expression ]
[ORDER BY order [,...]] [LIMIT expression [OFFSET expression] [ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } select ] [ ORDER BY order [,...] ]
[SAMPLE_SIZE rowCountInt]] [FOR UPDATE] [ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ]
"," [ FOR UPDATE ]","
Selects data from a table or multiple tables." "
"Commands (DML)","INSERT"," "Commands (DML)","INSERT","
INSERT INTO tableName [(columnName [,...])] INSERT INTO tableName [ ( columnName [,...] ) ]
{VALUES {( [{DEFAULT | expression} [,...]] )} [,...] | select} { VALUES { ( [ { DEFAULT | expression } [,...] ] ) } [,...] | select }
"," ","
Inserts a new row / new rows into a table." Inserts a new row / new rows into a table."
"Commands (DML)","UPDATE"," "Commands (DML)","UPDATE","
UPDATE tableName SET {columnName= {DEFAULT | expression} } [,...] UPDATE tableName SET { columnName= { DEFAULT | expression } } [,...]
[WHERE expression] [ WHERE expression ]
"," ","
Updates data in a table." Updates data in a table."
"Commands (DML)","DELETE"," "Commands (DML)","DELETE","
DELETE FROM tableName [WHERE expression] DELETE FROM tableName [ WHERE expression ]
"," ","
Deletes rows form a table." Deletes rows form a table."
"Commands (DML)","BACKUP"," "Commands (DML)","BACKUP","
...@@ -34,31 +34,32 @@ CALL expression ...@@ -34,31 +34,32 @@ CALL expression
"," ","
Calculates a simple expression." Calculates a simple expression."
"Commands (DML)","EXPLAIN"," "Commands (DML)","EXPLAIN","
EXPLAIN [PLAN FOR] {select | insert | update | delete} EXPLAIN [ PLAN FOR ] { select | insert | update | delete }
"," ","
Shows the execution plan for a statement." Shows the execution plan for a statement."
"Commands (DML)","MERGE"," "Commands (DML)","MERGE","
MERGE INTO tableName [(columnName [,...])] [KEY(columnName [,...])] MERGE INTO tableName [ ( columnName [,...] ) ]
{VALUES {( [{DEFAULT | expression} [,...]] )} [,...] | select} [ KEY ( columnName [,...] ) ]
{ VALUES { ( [ { DEFAULT | expression } [,...] ] ) } [,...] | select }
"," ","
Updates existing rows, and insert rows that don't exist." Updates existing rows, and insert rows that don't exist."
"Commands (DML)","RUNSCRIPT"," "Commands (DML)","RUNSCRIPT","
RUNSCRIPT FROM fileNameString RUNSCRIPT FROM fileNameString
[COMPRESSION {DEFLATE|LZF|ZIP|GZIP}] [ COMPRESSION { DEFLATE | LZF | ZIP | GZIP } ]
[CIPHER cipher PASSWORD string] [ CIPHER cipher PASSWORD string ]
[CHARSET charsetString] [ CHARSET charsetString ]
"," ","
Runs a SQL script from a file." Runs a SQL script from a file."
"Commands (DML)","SCRIPT"," "Commands (DML)","SCRIPT","
SCRIPT [SIMPLE] [NODATA] [NOPASSWORDS] [NOSETTINGS] [DROP] SCRIPT [ SIMPLE ] [ NODATA ] [ NOPASSWORDS ] [ NOSETTINGS ]
[BLOCKSIZE blockSizeInt] [TO fileNameString [ DROP ] [ BLOCKSIZE blockSizeInt ]
[COMPRESSION {DEFLATE|LZF|ZIP|GZIP}] [ TO fileNameString [ COMPRESSION { DEFLATE | LZF | ZIP | GZIP } ]
[CIPHER cipher PASSWORD string]] [ CIPHER cipher PASSWORD string ] ]
"," ","
Creates a SQL script with or without the insert statements." Creates a SQL script from the database."
"Commands (DML)","SHOW"," "Commands (DML)","SHOW","
SHOW { SCHEMAS | TABLES [FROM schemaName] | SHOW { SCHEMAS | TABLES [ FROM schemaName ] |
COLUMNS FROM tableName [FROM schemaName] } COLUMNS FROM tableName [ FROM schemaName ] }
"," ","
Lists the schemas, tables, or the columns of a table." Lists the schemas, tables, or the columns of a table."
"Commands (DDL)","ALTER INDEX RENAME"," "Commands (DDL)","ALTER INDEX RENAME","
...@@ -66,21 +67,21 @@ ALTER INDEX indexName RENAME TO newIndexName ...@@ -66,21 +67,21 @@ ALTER INDEX indexName RENAME TO newIndexName
"," ","
Renames an index." Renames an index."
"Commands (DDL)","ALTER SEQUENCE"," "Commands (DDL)","ALTER SEQUENCE","
ALTER SEQUENCE sequenceName [RESTART WITH long] [INCREMENT BY long] ALTER SEQUENCE sequenceName [ RESTART WITH long ] [ INCREMENT BY long ]
"," ","
Changes the next value and the increment of a sequence." Changes the next value and the increment of a sequence."
"Commands (DDL)","ALTER TABLE ADD"," "Commands (DDL)","ALTER TABLE ADD","
ALTER TABLE tableName ADD name dataType [DEFAULT expression] ALTER TABLE tableName ADD name dataType [ DEFAULT expression ]
[[NOT] NULL] [AUTO_INCREMENT | IDENTITY] [BEFORE columnName] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] [ BEFORE columnName ]
"," ","
Adds a new column to a table." Adds a new column to a table."
"Commands (DDL)","ALTER TABLE ADD CONSTRAINT"," "Commands (DDL)","ALTER TABLE ADD CONSTRAINT","
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 COLUMN","
ALTER TABLE tableName ALTER COLUMN columnName dataType ALTER TABLE tableName ALTER COLUMN columnName dataType
[DEFAULT expression] [NOT [NULL]] [AUTO_INCREMENT | IDENTITY] [ DEFAULT expression ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ]
"," ","
Changes the data type of a column." Changes the data type of a column."
"Commands (DDL)","ALTER TABLE ALTER COLUMN RENAME"," "Commands (DDL)","ALTER TABLE ALTER COLUMN RENAME","
...@@ -112,13 +113,12 @@ ALTER TABLE tableName DROP COLUMN columnName ...@@ -112,13 +113,12 @@ ALTER TABLE tableName DROP COLUMN columnName
"," ","
Removes a column from a table." Removes a column from a table."
"Commands (DDL)","ALTER TABLE DROP CONSTRAINT"," "Commands (DDL)","ALTER TABLE DROP CONSTRAINT","
ALTER TABLE tableName DROP ALTER TABLE tableName DROP { CONSTRAINT [ IF EXISTS ] constraintName | PRIMARY KEY }
{CONSTRAINT [IF EXISTS] constraintName | PRIMARY KEY}
"," ","
Removes a constraint or a primary key from a table." Removes a constraint or a primary key from a table."
"Commands (DDL)","ALTER TABLE SET"," "Commands (DDL)","ALTER TABLE SET","
ALTER TABLE tableName SET REFERENTIAL_INTEGRITY ALTER TABLE tableName SET REFERENTIAL_INTEGRITY
{FALSE | TRUE [CHECK|NOCHECK]} { FALSE | TRUE [ CHECK | NOCHECK ] }
"," ","
Disables or enables referential integrity checking for a table." Disables or enables referential integrity checking for a table."
"Commands (DDL)","ALTER TABLE RENAME"," "Commands (DDL)","ALTER TABLE RENAME","
...@@ -126,7 +126,7 @@ ALTER TABLE tableName RENAME TO newName ...@@ -126,7 +126,7 @@ ALTER TABLE tableName RENAME TO newName
"," ","
Renames a table." Renames a table."
"Commands (DDL)","ALTER USER ADMIN"," "Commands (DDL)","ALTER USER ADMIN","
ALTER USER userName ADMIN {TRUE | FALSE} ALTER USER userName ADMIN { TRUE | FALSE }
"," ","
Switches the admin flag of a user on or off." Switches the admin flag of a user on or off."
"Commands (DDL)","ALTER USER RENAME"," "Commands (DDL)","ALTER USER RENAME","
...@@ -134,7 +134,7 @@ ALTER USER userName RENAME TO newUserName ...@@ -134,7 +134,7 @@ ALTER USER userName RENAME TO newUserName
"," ","
Renames a user." Renames a user."
"Commands (DDL)","ALTER USER SET PASSWORD"," "Commands (DDL)","ALTER USER SET PASSWORD","
ALTER USER userName SET {PASSWORD string | SALT bytes HASH bytes} ALTER USER userName SET { PASSWORD string | SALT bytes HASH bytes }
"," ","
Changes the password of a user." Changes the password of a user."
"Commands (DDL)","ALTER VIEW"," "Commands (DDL)","ALTER VIEW","
...@@ -142,136 +142,135 @@ ALTER VIEW viewName RECOMPILE ...@@ -142,136 +142,135 @@ ALTER VIEW viewName RECOMPILE
"," ","
Recompiles a view after the underlying tables have been changed or created." Recompiles a view after the underlying tables have been changed or created."
"Commands (DDL)","ANALYZE"," "Commands (DDL)","ANALYZE","
ANALYZE [SAMPLE_SIZE rowCountInt] ANALYZE [ SAMPLE_SIZE rowCountInt ]
"," ","
Updates the selectivity statistics of all tables." Updates the selectivity statistics of all tables."
"Commands (DDL)","COMMENT"," "Commands (DDL)","COMMENT","
COMMENT ON { { TABLE | VIEW | CONSTANT | CONSTRAINT | ALIAS | INDEX | ROLE COMMENT ON
| SCHEMA | SEQUENCE | TRIGGER | USER | DOMAIN } [schemaName.]objectName } { { COLUMN [ schemaName. ] tableName.columnName }
| { COLUMN [schemaName.]tableName.columnName } IS expression | { { TABLE | VIEW | CONSTANT | CONSTRAINT | ALIAS | INDEX | ROLE
| SCHEMA | SEQUENCE | TRIGGER | USER | DOMAIN } [ schemaName. ] objectName } }
IS expression
"," ","
Sets the comment of a database object." Sets the comment of a database object."
"Commands (DDL)","CREATE AGGREGATE"," "Commands (DDL)","CREATE AGGREGATE","
CREATE AGGREGATE [IF NOT EXISTS] newAggregateName FOR className CREATE AGGREGATE [ IF NOT EXISTS ] newAggregateName FOR className
"," ","
Creates a new user-defined aggregate function." Creates a new user-defined aggregate function."
"Commands (DDL)","CREATE ALIAS"," "Commands (DDL)","CREATE ALIAS","
CREATE ALIAS [IF NOT EXISTS] newFunctionAliasName [DETERMINISTIC] CREATE ALIAS [ IF NOT EXISTS ] newFunctionAliasName [ DETERMINISTIC ]
FOR classAndMethodName FOR classAndMethodName
"," ","
Creates a new function alias." Creates a new function alias."
"Commands (DDL)","CREATE CONSTANT"," "Commands (DDL)","CREATE CONSTANT","
CREATE CONSTANT [IF NOT EXISTS] newConstantName VALUE expression CREATE CONSTANT [ IF NOT EXISTS ] newConstantName VALUE expression
"," ","
Creates a new constant." Creates a new constant."
"Commands (DDL)","CREATE DOMAIN"," "Commands (DDL)","CREATE DOMAIN","
CREATE DOMAIN [IF NOT EXISTS] newDomainName AS dataType [DEFAULT expression] CREATE DOMAIN [ IF NOT EXISTS ] newDomainName AS dataType
[[NOT] NULL] [SELECTIVITY selectivity] [CHECK condition] [ DEFAULT expression ] [ [ NOT ] NULL ] [ SELECTIVITY selectivity ]
[ CHECK condition ]
"," ","
Creates a new data type (domain)." Creates a new data type (domain)."
"Commands (DDL)","CREATE INDEX"," "Commands (DDL)","CREATE INDEX","
CREATE {[UNIQUE] [HASH] INDEX [IF NOT EXISTS] newIndexName CREATE { [ UNIQUE ] [ HASH ] INDEX [ IF NOT EXISTS ] newIndexName
| PRIMARY KEY [HASH]} ON tableName(indexColumn [,...]) | PRIMARY KEY [ HASH ] }
ON tableName ( indexColumn [,...] )
"," ","
Creates a new index." Creates a new index."
"Commands (DDL)","CREATE LINKED TABLE"," "Commands (DDL)","CREATE LINKED TABLE","
CREATE [[GLOBAL | LOCAL] TEMPORARY] LINKED TABLE [IF NOT EXISTS] CREATE [ [ GLOBAL | LOCAL ] TEMPORARY ] LINKED TABLE [ IF NOT EXISTS ]
name(driverString, urlString, userString, passwordString, name ( driverString, urlString, userString, passwordString,
[originalSchemaString,] originalTableString) [EMIT UPDATES | READONLY] [ originalSchemaString, ] originalTableString ) [ EMIT UPDATES | READONLY ]
"," ","
Creates a table link to an external table." Creates a table link to an external table."
"Commands (DDL)","CREATE ROLE"," "Commands (DDL)","CREATE ROLE","
CREATE ROLE [IF NOT EXISTS] newRoleName CREATE ROLE [ IF NOT EXISTS ] newRoleName
"," ","
Creates a new role." Creates a new role."
"Commands (DDL)","CREATE SCHEMA"," "Commands (DDL)","CREATE SCHEMA","
CREATE SCHEMA [IF NOT EXISTS] name [AUTHORIZATION ownerUserName] CREATE SCHEMA [ IF NOT EXISTS ] name [ AUTHORIZATION ownerUserName ]
"," ","
Creates a new schema." Creates a new schema."
"Commands (DDL)","CREATE SEQUENCE"," "Commands (DDL)","CREATE SEQUENCE","
CREATE SEQUENCE [IF NOT EXISTS] newSequenceName [START WITH long] CREATE SEQUENCE [ IF NOT EXISTS ] newSequenceName [ START WITH long ]
[INCREMENT BY long] [CACHE long] [ INCREMENT BY long ] [ CACHE long ]
"," ","
Creates a new sequence." Creates a new sequence."
"Commands (DDL)","CREATE TABLE"," "Commands (DDL)","CREATE TABLE","
CREATE [CACHED | MEMORY | TEMP | [GLOBAL | LOCAL] TEMPORARY] CREATE [ CACHED | MEMORY | TEMP | [ GLOBAL | LOCAL ] TEMPORARY ]
TABLE [IF NOT EXISTS] name TABLE [ IF NOT EXISTS ]
{ ( {name dataType [{AS computedColumnExpression | DEFAULT expression}] name { ( { columnDefinition | constraint } [,...] ) [ AS select ] }
[[NOT] NULL] [{AUTO_INCREMENT | IDENTITY}[(startInt [, incrementInt])]] | { AS select } [ NOT PERSISTENT ]
[SELECTIVITY selectivity] [PRIMARY KEY [HASH] | UNIQUE] | constraint} [,...] )
[AS select] [NOT PERSISTENT] } | { AS select }
"," ","
Creates a new table." Creates a new table."
"Commands (DDL)","CREATE TRIGGER"," "Commands (DDL)","CREATE TRIGGER","
CREATE TRIGGER [IF NOT EXISTS] newTriggerName CREATE TRIGGER [ IF NOT EXISTS ] newTriggerName { BEFORE | AFTER }
{BEFORE | AFTER} {INSERT | UPDATE | DELETE} [,...] { INSERT | UPDATE | DELETE } [,...] ON tableName [ FOR EACH ROW ]
ON tableName [ QUEUE int ] [ NOWAIT ] CALL triggeredClassName
[FOR EACH ROW] [QUEUE int] [NOWAIT]
CALL triggeredClassName
"," ","
Creates a new trigger." Creates a new trigger."
"Commands (DDL)","CREATE USER"," "Commands (DDL)","CREATE USER","
CREATE USER [IF NOT EXISTS] newUserName CREATE USER [ IF NOT EXISTS ] newUserName
{PASSWORD string | SALT bytes HASH bytes} { PASSWORD string | SALT bytes HASH bytes } [ ADMIN ]
[ADMIN]
"," ","
Creates a new user." Creates a new user."
"Commands (DDL)","CREATE VIEW"," "Commands (DDL)","CREATE VIEW","
CREATE [FORCE] VIEW [IF NOT EXISTS] newViewName [(columnName [,..])] CREATE [ FORCE ] VIEW [ IF NOT EXISTS ] newViewName
AS select [ ( columnName [,...] ) ] AS select
"," ","
Creates a new view." Creates a new view."
"Commands (DDL)","DROP AGGREGATE"," "Commands (DDL)","DROP AGGREGATE","
DROP AGGREGATE [IF EXISTS] aggregateName DROP AGGREGATE [ IF EXISTS ] aggregateName
"," ","
Drops an existing user-defined aggregate function." Drops an existing user-defined aggregate function."
"Commands (DDL)","DROP ALIAS"," "Commands (DDL)","DROP ALIAS","
DROP ALIAS [IF EXISTS] functionAliasName DROP ALIAS [ IF EXISTS ] existingFunctionAliasName
"," ","
Drops an existing function alias." Drops an existing function alias."
"Commands (DDL)","DROP ALL OBJECTS"," "Commands (DDL)","DROP ALL OBJECTS","
DROP ALL OBJECTS [DELETE FILES] DROP ALL OBJECTS [ DELETE FILES ]
"," ","
Drops all existing views, tables, sequences, schemas, function aliases, roles, Drops all existing views, tables, sequences, schemas, function aliases, roles,
user-defined aggregate functions, domains, and users (except the current user)." user-defined aggregate functions, domains, and users (except the current user)."
"Commands (DDL)","DROP CONSTANT"," "Commands (DDL)","DROP CONSTANT","
DROP CONSTANT [IF EXISTS] constantName DROP CONSTANT [ IF EXISTS ] constantName
"," ","
Drops a constant." Drops a constant."
"Commands (DDL)","DROP DOMAIN"," "Commands (DDL)","DROP DOMAIN","
DROP DOMAIN [IF EXISTS] domainName DROP DOMAIN [ IF EXISTS ] domainName
"," ","
Drops a data type (domain)." Drops a data type (domain)."
"Commands (DDL)","DROP INDEX"," "Commands (DDL)","DROP INDEX","
DROP INDEX [IF EXISTS] indexName DROP INDEX [ IF EXISTS ] indexName
"," ","
Drops an index." Drops an index."
"Commands (DDL)","DROP ROLE"," "Commands (DDL)","DROP ROLE","
DROP ROLE [IF EXISTS] roleName DROP ROLE [ IF EXISTS ] roleName
"," ","
Drops a role." Drops a role."
"Commands (DDL)","DROP SCHEMA"," "Commands (DDL)","DROP SCHEMA","
DROP SCHEMA [IF EXISTS] schemaName DROP SCHEMA [ IF EXISTS ] schemaName
"," ","
Drops a schema." Drops a schema."
"Commands (DDL)","DROP SEQUENCE"," "Commands (DDL)","DROP SEQUENCE","
DROP SEQUENCE [IF EXISTS] sequenceName DROP SEQUENCE [ IF EXISTS ] sequenceName
"," ","
Drops a sequence." Drops a sequence."
"Commands (DDL)","DROP TABLE"," "Commands (DDL)","DROP TABLE","
DROP TABLE [IF EXISTS] tableName [,...] DROP TABLE [ IF EXISTS ] tableName [,...]
"," ","
Drops an existing table, or a list of existing tables." Drops an existing table, or a list of existing tables."
"Commands (DDL)","DROP TRIGGER"," "Commands (DDL)","DROP TRIGGER","
DROP TRIGGER [IF EXISTS] triggerName DROP TRIGGER [ IF EXISTS ] triggerName
"," ","
Drops an existing trigger." Drops an existing trigger."
"Commands (DDL)","DROP USER"," "Commands (DDL)","DROP USER","
DROP USER [IF EXISTS] userName DROP USER [ IF EXISTS ] userName
"," ","
Drops a user." Drops a user."
"Commands (DDL)","DROP VIEW"," "Commands (DDL)","DROP VIEW","
DROP VIEW [IF EXISTS] viewName DROP VIEW [ IF EXISTS ] viewName
"," ","
Drops a view." Drops a view."
"Commands (DDL)","TRUNCATE TABLE"," "Commands (DDL)","TRUNCATE TABLE","
...@@ -288,7 +287,7 @@ CHECKPOINT SYNC ...@@ -288,7 +287,7 @@ CHECKPOINT SYNC
Flushes the log, data and index files and forces all system buffers be written Flushes the log, data and index files and forces all system buffers be written
to the underlying device." to the underlying device."
"Commands (Other)","COMMIT"," "Commands (Other)","COMMIT","
COMMIT [WORK] COMMIT [ WORK ]
"," ","
Commits a transaction." Commits a transaction."
"Commands (Other)","COMMIT TRANSACTION"," "Commands (Other)","COMMIT TRANSACTION","
...@@ -296,16 +295,16 @@ COMMIT TRANSACTION transactionName ...@@ -296,16 +295,16 @@ COMMIT TRANSACTION transactionName
"," ","
Sets the resolution of an in-doubt transaction to 'commit'." Sets the resolution of an in-doubt transaction to 'commit'."
"Commands (Other)","GRANT RIGHT"," "Commands (Other)","GRANT RIGHT","
GRANT {SELECT | INSERT | UPDATE | DELETE | ALL} [,...] GRANT { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
ON tableName [,...] TO {PUBLIC | userName | roleName} tableName [,...] TO { PUBLIC | userName | roleName }
"," ","
Grants rights for a table to a user or role." Grants rights for a table to a user or role."
"Commands (Other)","GRANT ROLE"," "Commands (Other)","GRANT ROLE","
GRANT roleName TO {PUBLIC | userName | roleName} GRANT roleName TO { PUBLIC | userName | roleName }
"," ","
Grants a role to a user or role." Grants a role to a user or role."
"Commands (Other)","HELP"," "Commands (Other)","HELP","
HELP [anything [...]] HELP [ anything [...] ]
"," ","
Displays the help pages of SQL commands or keywords." Displays the help pages of SQL commands or keywords."
"Commands (Other)","PREPARE COMMIT"," "Commands (Other)","PREPARE COMMIT","
...@@ -313,17 +312,16 @@ PREPARE COMMIT newTransactionName ...@@ -313,17 +312,16 @@ PREPARE COMMIT newTransactionName
"," ","
Prepares committing a transaction." Prepares committing a transaction."
"Commands (Other)","REVOKE RIGHT"," "Commands (Other)","REVOKE RIGHT","
REVOKE {SELECT | INSERT | UPDATE | DELETE | ALL} [,...] REVOKE { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON tableName
ON tableName [,...] FROM {PUBLIC | userName | roleName} [,...] FROM { PUBLIC | userName | roleName }
"," ","
Removes rights for a table from a user or role." Removes rights for a table from a user or role."
"Commands (Other)","REVOKE ROLE"," "Commands (Other)","REVOKE ROLE","
REVOKE roleName REVOKE roleName FROM { PUBLIC | userName | roleName }
FROM {PUBLIC | userName | roleName}
"," ","
Removes a role from a user or role." Removes a role from a user or role."
"Commands (Other)","ROLLBACK"," "Commands (Other)","ROLLBACK","
ROLLBACK [TO SAVEPOINT savepointName] ROLLBACK [ TO SAVEPOINT savepointName ]
"," ","
Rolls back a transaction." Rolls back a transaction."
"Commands (Other)","ROLLBACK TRANSACTION"," "Commands (Other)","ROLLBACK TRANSACTION","
...@@ -335,15 +333,15 @@ SAVEPOINT savepointName ...@@ -335,15 +333,15 @@ SAVEPOINT savepointName
"," ","
Create a new savepoint." Create a new savepoint."
"Commands (Other)","SET @"," "Commands (Other)","SET @","
SET @variableName [=] expression SET @variableName [ = ] expression
"," ","
Updates a user-defined variable." Updates a user-defined variable."
"Commands (Other)","SET ALLOW_LITERALS"," "Commands (Other)","SET ALLOW_LITERALS","
SET ALLOW_LITERALS {NONE|ALL|NUMBERS} SET ALLOW_LITERALS { NONE | ALL | NUMBERS }
"," ","
This setting can help solve the SQL injection problem." This setting can help solve the SQL injection problem."
"Commands (Other)","SET AUTOCOMMIT"," "Commands (Other)","SET AUTOCOMMIT","
SET AUTOCOMMIT {TRUE | ON | FALSE | OFF} SET AUTOCOMMIT { TRUE | ON | FALSE | OFF }
"," ","
Switches auto commit on or off." Switches auto commit on or off."
"Commands (Other)","SET CACHE_SIZE"," "Commands (Other)","SET CACHE_SIZE","
...@@ -356,13 +354,12 @@ SET CLUSTER serverListString ...@@ -356,13 +354,12 @@ SET CLUSTER serverListString
This command should not be used directly by an application, the statement is This command should not be used directly by an application, the statement is
executed automatically by the system." executed automatically by the system."
"Commands (Other)","SET COLLATION"," "Commands (Other)","SET COLLATION","
SET [DATABASE] COLLATION SET [ DATABASE ] COLLATION
{OFF | collationName { OFF | collationName [ STRENGTH { PRIMARY | SECONDARY | TERTIARY | IDENTICAL } ] }
[STRENGTH {PRIMARY | SECONDARY | TERTIARY | IDENTICAL}]}
"," ","
Sets the collation used for comparing strings." Sets the collation used for comparing strings."
"Commands (Other)","SET COMPRESS_LOB"," "Commands (Other)","SET COMPRESS_LOB","
SET COMPRESS_LOB {NO|LZF|DEFLATE} SET COMPRESS_LOB { NO | LZF | DEFLATE }
"," ","
Sets the compression algorithm for BLOB and CLOB data." Sets the compression algorithm for BLOB and CLOB data."
"Commands (Other)","SET DATABASE_EVENT_LISTENER"," "Commands (Other)","SET DATABASE_EVENT_LISTENER","
...@@ -379,15 +376,15 @@ SET DEFAULT LOCK_TIMEOUT int ...@@ -379,15 +376,15 @@ SET DEFAULT LOCK_TIMEOUT int
Sets the default lock timeout (in milliseconds) in this database that is used Sets the default lock timeout (in milliseconds) in this database that is used
for the new sessions." for the new sessions."
"Commands (Other)","SET DEFAULT_TABLE_TYPE"," "Commands (Other)","SET DEFAULT_TABLE_TYPE","
SET DEFAULT_TABLE_TYPE {MEMORY | CACHED} SET DEFAULT_TABLE_TYPE { MEMORY | CACHED }
"," ","
Sets the default table storage type that is used when creating new tables." Sets the default table storage type that is used when creating new tables."
"Commands (Other)","SET EXCLUSIVE"," "Commands (Other)","SET EXCLUSIVE","
SET EXCLUSIVE {TRUE | FALSE} SET EXCLUSIVE { TRUE | FALSE }
"," ","
Switched the database to exclusive mode and back." Switched the database to exclusive mode and back."
"Commands (Other)","SET IGNORECASE"," "Commands (Other)","SET IGNORECASE","
SET IGNORECASE {TRUE|FALSE} SET IGNORECASE { TRUE | FALSE }
"," ","
If IGNORECASE is enabled, text columns in newly created tables will be If IGNORECASE is enabled, text columns in newly created tables will be
case-insensitive." case-insensitive."
...@@ -424,16 +421,15 @@ SET MAX_OPERATION_MEMORY int ...@@ -424,16 +421,15 @@ SET MAX_OPERATION_MEMORY int
"," ","
Sets the maximum memory used for large operations (delete and insert), in bytes." Sets the maximum memory used for large operations (delete and insert), in bytes."
"Commands (Other)","SET MODE"," "Commands (Other)","SET MODE","
SET MODE {REGULAR | DB2 | DERBY | HSQLDB | SET MODE { REGULAR | DB2 | DERBY | HSQLDB | MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL }
MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL}
"," ","
Changes to another database compatibility mode." Changes to another database compatibility mode."
"Commands (Other)","SET MULTI_THREADED"," "Commands (Other)","SET MULTI_THREADED","
SET MULTI_THREADED {0|1} SET MULTI_THREADED { 0 | 1 }
"," ","
Enabled (1) or disabled (0) multi-threading inside the database engine." Enabled (1) or disabled (0) multi-threading inside the database engine."
"Commands (Other)","SET OPTIMIZE_REUSE_RESULTS"," "Commands (Other)","SET OPTIMIZE_REUSE_RESULTS","
SET OPTIMIZE_REUSE_RESULTS {0|1} SET OPTIMIZE_REUSE_RESULTS { 0 | 1 }
"," ","
Enabled (1) or disabled (0) the result reuse optimization." Enabled (1) or disabled (0) the result reuse optimization."
"Commands (Other)","SET PASSWORD"," "Commands (Other)","SET PASSWORD","
...@@ -445,7 +441,7 @@ SET QUERY_TIMEOUT int ...@@ -445,7 +441,7 @@ SET QUERY_TIMEOUT int
"," ","
Set the query timeout of the current session to the given value." Set the query timeout of the current session to the given value."
"Commands (Other)","SET REFERENTIAL_INTEGRITY"," "Commands (Other)","SET REFERENTIAL_INTEGRITY","
SET REFERENTIAL_INTEGRITY [TRUE|FALSE] SET REFERENTIAL_INTEGRITY { TRUE | FALSE }
"," ","
Disabled or enables referential integrity checking for the whole database." Disabled or enables referential integrity checking for the whole database."
"Commands (Other)","SET SALT HASH"," "Commands (Other)","SET SALT HASH","
...@@ -465,7 +461,7 @@ SET THROTTLE int ...@@ -465,7 +461,7 @@ SET THROTTLE int
"," ","
Sets the throttle for the current connection." Sets the throttle for the current connection."
"Commands (Other)","SET TRACE_LEVEL"," "Commands (Other)","SET TRACE_LEVEL","
SET {TRACE_LEVEL_FILE | TRACE_LEVEL_SYSTEM_OUT} int SET { TRACE_LEVEL_FILE | TRACE_LEVEL_SYSTEM_OUT } int
"," ","
Sets the trace level for file the file or system out stream." Sets the trace level for file the file or system out stream."
"Commands (Other)","SET TRACE_MAX_FILE_SIZE"," "Commands (Other)","SET TRACE_MAX_FILE_SIZE","
...@@ -481,72 +477,71 @@ SET WRITE_DELAY int ...@@ -481,72 +477,71 @@ SET WRITE_DELAY int
"," ","
Set the maximum delay between a commit and flushing the log, in milliseconds." Set the maximum delay between a commit and flushing the log, in milliseconds."
"Commands (Other)","SHUTDOWN"," "Commands (Other)","SHUTDOWN","
SHUTDOWN [IMMEDIATELY|COMPACT|SCRIPT] 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","Comments","
-- anythingUntilEndOfLine -- anythingUntilEndOfLine | // anythingUntilEndOfLine | /* anythingUntilEndComment */
| // anythingUntilEndOfLine
"," ","
Comments can be used anywhere in a command and are ignored by the database." Comments can be used anywhere in a command and are ignored by the database."
Comments can be used anywhere in a command and are ignored by the database." "Other Grammar","Order","
"Other Grammar","Select Part"," { int | expression } [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
[TOP term] [DISTINCT | ALL] selectExpression [,...]
","
The SELECT part of a query."
"Other Grammar","From Part","
"," ","
"," Sorts the result by the given column number, or by an expression."
"Other Grammar","Constraint"," "Other Grammar","Constraint","
"Other Grammar","Constraint"," [ constraintNameDefinition ] {
PRIMARY KEY [HASH] (columnName [,...]) CHECK expression | UNIQUE ( columnName [,...] )
| [CONSTRAINT [IF NOT EXISTS] newConstraintName] { | referentialConstraint }
CHECK expression | PRIMARY KEY [ HASH ] ( columnName [,...] )
| UNIQUE (columnName [,...])
"," ","
Defines a constraint." Defines a constraint."
"Other Grammar","Constraint Name Definition","
CONSTRAINT [ IF NOT EXISTS ] newConstraintName
","
Defines a constraint name."
"Other Grammar","Referential Constraint"," "Other Grammar","Referential Constraint","
"Other Grammar","Referential Constraint"," FOREIGN KEY ( columnName [,...] )
FOREIGN KEY (columnName [,...]) REFERENCES [ refTableName ] [ ( refColumnName [,...] ) ]
REFERENCES [refTableName] [(refColumnName[,...])] [ ON DELETE { CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL } } ]
[ON DELETE {CASCADE | RESTRICT | NO ACTION | SET {DEFAULT|NULL}}] [ ON UPDATE { CASCADE | SET { DEFAULT | NULL } } ]
"," ","
Defines a referential constraint." Defines a referential constraint."
"Other Grammar","Table Expression"," "Other Grammar","Table Expression","
"Other Grammar","Table Expression"," { [ schemaName. ] tableName | ( select ) } [ [ AS ] newTableAlias ]
{[schemaName.] tableName | (select)} [[AS] newTableAlias] [ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
[{{LEFT | RIGHT} [OUTER] | [INNER] | CROSS | NATURAL} JOIN tableExpression [ ON expression ] ]
"," ","
Joins a table." Joins a table."
Joins a table."
"Other Grammar","Order","
{int | expression} [ASC | DESC] [NULLS {FIRST | LAST}]
","
"Other Grammar","Index Column"," "Other Grammar","Index Column","
"Other Grammar","Index Column"," columnName [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
"," ","
Indexes this column in ascending or descending order." Indexes this column in ascending or descending order."
"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"," "Other Grammar","Expression","
"Other Grammar","Expression"," andCondition [ OR andCondition ]
"," ","
Value or condition." Value or condition."
"Other Grammar","And Condition"," "Other Grammar","And Condition","
"Other Grammar","And Condition"," condition [ AND condition ]
"," ","
Value or condition." Value or condition."
"Other Grammar","Condition"," "Other Grammar","Condition","
"Other Grammar","Condition"," operand [ conditionRightHandSide ] | NOT condition | EXISTS ( select )
"," ","
Boolean value or condition." Boolean value or condition."
"Other Grammar","Condition Right Hand Side"," "Other Grammar","Condition Right Hand Side","
"Other Grammar","Condition Right Hand Side"," compare { { { ALL | ANY | SOME } ( select ) } | operand }
compare { {{ALL|ANY|SOME}(select)} | operand } | IS [ NOT ] NULL
| IS [NOT] NULL | BETWEEN operand AND operand
| BETWEEN operand AND operand | IN ( { select | expression [,...] } )
| IN ({select | expression[,...]}) | [ NOT ] LIKE operand [ ESCAPE string ]
| [NOT] LIKE operand [ESCAPE string] | [ NOT ] REGEXP operand
"," ","
The right hand side of a condition." The right hand side of a condition."
"Other Grammar","Compare"," "Other Grammar","Compare","
...@@ -554,63 +549,67 @@ The right hand side of a condition." ...@@ -554,63 +549,67 @@ The right hand side of a condition."
"," ","
Comparison operator." Comparison operator."
"Other Grammar","Operand"," "Other Grammar","Operand","
summand [ || summand] summand [ || summand ]
"," ","
A value or a concatenation of values." A value or a concatenation of values."
"Other Grammar","Summand"," "Other Grammar","Summand","
factor [{+ | -} factor] factor [ { + | - } factor ]
"," ","
A value or a numeric sum." A value or a numeric sum."
"Other Grammar","Factor"," "Other Grammar","Factor","
term [{* | /} term] term [ { * | / } term ]
"," ","
A value or a numeric factor." A value or a numeric factor."
"Other Grammar","Term"," "Other Grammar","Term","
value value
| columnName | columnName
| ?[int] | ?[ int ]
| NEXT VALUE FOR sequenceName | NEXT VALUE FOR sequenceName
| function | function
| {- | +} term | { - | + } term
| (expression) | ( expression )
| select | select
| case | case
| caseWhen | caseWhen
| tableAlias.columnName | tableAlias.columnName
"," ","
A value." A value."
"Other Grammar","Value"," "Other Grammar","Value","
string | dollarQuotedString | hexNumber | int | long | decimal | double | string | dollarQuotedString | hexNumber | int | long | decimal | double
date | time | timestamp | boolean | bytes | array | null | date | time | timestamp | boolean | bytes | array | null
"," ","
A value of any data type, or null." A value of any data type, or null."
"Other Grammar","Case"," "Other Grammar","Case","
CASE expression {WHEN expression THEN expression} CASE expression { WHEN expression THEN expression } [...]
[...] [ELSE expression] END [ ELSE expression ] END
"," ","
Returns the first expression where the value is equal to the test expression." Returns the first expression where the value is equal to the test expression."
"Other Grammar","Case When"," "Other Grammar","Case When","
CASE {WHEN expression THEN expression} CASE { WHEN expression THEN expression} [...]
[...] [ELSE expression] END [ ELSE expression ] END
"," ","
Returns the first expression where the condition is true." Returns the first expression where the condition is true."
"Other Grammar","Csv Options","
charsetString [, fieldSepString [, fieldDelimString [, escString [, nullString]]]]]
","
Optional parameters for CSVREAD and CSVWRITE."
"Other Grammar","Cipher"," "Other Grammar","Cipher","
[AES | XTEA] { AES | XTEA }
"," ","
Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds)." Two algorithms are supported, AES (AES-256) and XTEA (using 32 rounds)."
"Other Grammar","Select Expression"," "Other Grammar","Select Expression","
* | expression [[AS] columnAlias] | tableAlias.* * | expression [ [ AS ] columnAlias ] | tableAlias.*
"," ","
An expression in a SELECT statement." 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
binaryType | otherType | varcharType | varcharIgnorecaseType | charType | binaryType | otherType | varcharType | varcharIgnorecaseType | charType
blobType | clobType | uuidType | arrayType | blobType | clobType | uuidType | arrayType
"," ","
A data type definition." A data type definition."
"Other Grammar","Name"," "Other Grammar","Name","
{ { A-Z|_ } [ { A-Z|_|0-9} [...] ] } | quotedName { { A-Z|_ } [ { A-Z|_|0-9 } [...] ] } | quotedName
"," ","
Names are not case sensitive." Names are not case sensitive."
"Other Grammar","Alias"," "Other Grammar","Alias","
...@@ -630,24 +629,24 @@ $$anythingExceptTwoDollarSigns$$ ...@@ -630,24 +629,24 @@ $$anythingExceptTwoDollarSigns$$
"," ","
A string starts and ends with two dollar signs." A string starts and ends with two dollar signs."
"Other Grammar","Int"," "Other Grammar","Int","
[- | +] digit [...] [ - | + ] digit [...]
"," ","
The maximum integer number is 2147483647, the minimum is -2147483648." The maximum integer number is 2147483647, the minimum is -2147483648."
"Other Grammar","Long"," "Other Grammar","Long","
[- | +] digit [...] [ - | + ] digit [...]
"," ","
Long numbers are between -9223372036854775808 and 9223372036854775807." Long numbers are between -9223372036854775808 and 9223372036854775807."
"Other Grammar","Hex Number"," "Other Grammar","Hex Number","
[+ | -] 0x hex [ + | - ] 0x hex
"," ","
A number written in hexadecimal notation." A number written in hexadecimal notation."
"Other Grammar","Decimal"," "Other Grammar","Decimal","
[- | +] digit [...] [. digit [...] ] [ - | + ] digit [...] [ . digit [...] ]
"," ","
Number with fixed precision and scale." Number with fixed precision and scale."
"Other Grammar","Double"," "Other Grammar","Double","
[- | +] digit [...] [ - | + ] digit [...]
[. digit [...] [E [- | +] exponentDigit [...] ]] [ . digit [...] [ E [ - | + ] exponentDigit [...] ] ]
"," ","
The limitations are the same as for the Java data type Double." The limitations are the same as for the Java data type Double."
"Other Grammar","Date"," "Other Grammar","Date","
...@@ -671,7 +670,7 @@ X'hex' ...@@ -671,7 +670,7 @@ X'hex'
"," ","
A binary value." A binary value."
"Other Grammar","Array"," "Other Grammar","Array","
( expression [,..] ) ( expression [,...] )
"," ","
An array of values." An array of values."
"Other Grammar","Null"," "Other Grammar","Null","
...@@ -679,7 +678,7 @@ NULL ...@@ -679,7 +678,7 @@ NULL
"," ","
NULL is a value without data type and means 'unknown value'." NULL is a value without data type and means 'unknown value'."
"Other Grammar","Hex"," "Other Grammar","Hex","
{{ digit | a-f | A-F } {digit | a-f | A-F }} [...] { { digit | a-f | A-F } { digit | a-f | A-F } } [...]
"," ","
The hexadecimal representation of a number or of bytes." The hexadecimal representation of a number or of bytes."
"Other Grammar","Digit"," "Other Grammar","Digit","
...@@ -711,11 +710,11 @@ IDENTITY ...@@ -711,11 +710,11 @@ IDENTITY
"," ","
Auto-Increment value." Auto-Increment value."
"Data Types","DECIMAL Type"," "Data Types","DECIMAL Type","
{DECIMAL | NUMBER | DEC | NUMERIC} ( precisionInt [, scaleInt] ) { DECIMAL | NUMBER | DEC | NUMERIC } ( precisionInt [ , scaleInt ] )
"," ","
Data type with fixed precision and scale." Data type with fixed precision and scale."
"Data Types","DOUBLE Type"," "Data Types","DOUBLE Type","
{DOUBLE [PRECISION] | FLOAT | FLOAT4 | FLOAT8} { DOUBLE [ PRECISION ] | FLOAT | FLOAT4 | FLOAT8 }
"," ","
Floating point number." Floating point number."
"Data Types","REAL Type"," "Data Types","REAL Type","
...@@ -731,12 +730,11 @@ DATE ...@@ -731,12 +730,11 @@ DATE
"," ","
The format is yyyy-MM-dd." The format is yyyy-MM-dd."
"Data Types","TIMESTAMP Type"," "Data Types","TIMESTAMP Type","
{TIMESTAMP | DATETIME | SMALLDATETIME} { TIMESTAMP | DATETIME | SMALLDATETIME }
"," ","
The format is yyyy-MM-dd hh:mm:ss[." The format is yyyy-MM-dd hh:mm:ss[."
"Data Types","BINARY Type"," "Data Types","BINARY Type","
{BINARY | VARBINARY | LONGVARBINARY | RAW | BYTEA} { BINARY | VARBINARY | LONGVARBINARY | RAW | BYTEA } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
Represents a byte array." Represents a byte array."
"Data Types","OTHER Type"," "Data Types","OTHER Type","
...@@ -744,29 +742,25 @@ OTHER ...@@ -744,29 +742,25 @@ OTHER
"," ","
This type allows storing serialized Java objects." This type allows storing serialized Java objects."
"Data Types","VARCHAR Type"," "Data Types","VARCHAR Type","
{VARCHAR | LONGVARCHAR | { VARCHAR | LONGVARCHAR | VARCHAR2 | NVARCHAR
VARCHAR2 | NVARCHAR | NVARCHAR2 | VARCHAR_CASESENSITIVE} | NVARCHAR2 | VARCHAR_CASESENSITIVE} [ ( precisionInt ) ]
[( precisionInt )]
"," ","
Unicode String." Unicode String."
"Data Types","VARCHAR_IGNORECASE Type"," "Data Types","VARCHAR_IGNORECASE Type","
VARCHAR_IGNORECASE [( precisionInt )] VARCHAR_IGNORECASE [ ( precisionInt ) ]
"," ","
Same as VARCHAR, but not case sensitive when comparing." Same as VARCHAR, but not case sensitive when comparing."
"Data Types","CHAR Type"," "Data Types","CHAR Type","
{CHAR | CHARACTER | NCHAR} { CHAR | CHARACTER | NCHAR } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
This type is supported for compatibility with other databases and older This type is supported for compatibility with other databases and older
applications." applications."
"Data Types","BLOB Type"," "Data Types","BLOB Type","
{BLOB | TINYBLOB | MEDIUMBLOB | LONGBLOB | IMAGE | OID} { BLOB | TINYBLOB | MEDIUMBLOB | LONGBLOB | IMAGE | OID } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
Like BINARY, but intended for very large values such as files or images." Like BINARY, but intended for very large values such as files or images."
"Data Types","CLOB Type"," "Data Types","CLOB Type","
{CLOB | TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT | NTEXT | NCLOB} { CLOB | TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT | NTEXT | NCLOB } [ ( precisionInt ) ]
[( precisionInt )]
"," ","
CLOB is like VARCHAR, but intended for very large values." CLOB is like VARCHAR, but intended for very large values."
"Data Types","UUID Type"," "Data Types","UUID Type","
...@@ -778,7 +772,7 @@ ARRAY ...@@ -778,7 +772,7 @@ ARRAY
"," ","
An array of values." An array of values."
"Functions (Aggregate)","AVG"," "Functions (Aggregate)","AVG","
AVG([DISTINCT] {int | long | decimal | double}): value AVG ( [ DISTINCT ] { int | long | decimal | double } ): value
"," ","
The average (mean) value." The average (mean) value."
"Functions (Aggregate)","BOOL_AND"," "Functions (Aggregate)","BOOL_AND","
...@@ -790,12 +784,13 @@ BOOL_OR(boolean): boolean ...@@ -790,12 +784,13 @@ BOOL_OR(boolean): boolean
"," ","
Returns true if any expression is true." Returns true if any expression is true."
"Functions (Aggregate)","COUNT"," "Functions (Aggregate)","COUNT","
COUNT(*) | COUNT([DISTINCT] expression): long COUNT(*) | COUNT( [ DISTINCT ] expression ): long
"," ","
The count of all row, or of the non-null values." The count of all row, or of the non-null values."
"Functions (Aggregate)","GROUP_CONCAT"," "Functions (Aggregate)","GROUP_CONCAT","
GROUP_CONCAT([DISTINCT] string [ORDER BY {expression [ASC|DESC]}[,...]] GROUP_CONCAT ( [ DISTINCT ] string
[SEPARATOR expression]): string [ ORDER BY { expression [ ASC | DESC ] } [,...] ]
[ SEPARATOR expression ] ): string
"," ","
Concatenates strings with a separator." Concatenates strings with a separator."
"Functions (Aggregate)","MAX"," "Functions (Aggregate)","MAX","
...@@ -807,7 +802,7 @@ MIN(value): value ...@@ -807,7 +802,7 @@ MIN(value): value
"," ","
The lowest value." The lowest value."
"Functions (Aggregate)","SUM"," "Functions (Aggregate)","SUM","
SUM([DISTINCT] {int | long | decimal | double}): value SUM( [ DISTINCT ] { int | long | decimal | double } ): value
"," ","
The sum of all values." The sum of all values."
"Functions (Aggregate)","SELECTIVITY"," "Functions (Aggregate)","SELECTIVITY","
...@@ -815,23 +810,23 @@ SELECTIVITY(value): int ...@@ -815,23 +810,23 @@ SELECTIVITY(value): int
"," ","
Estimates the selectivity (0-100) of a value." Estimates the selectivity (0-100) of a value."
"Functions (Aggregate)","STDDEV_POP"," "Functions (Aggregate)","STDDEV_POP","
STDDEV_POP([DISTINCT] double): double STDDEV_POP( [ DISTINCT ] double ): double
"," ","
The population standard deviation." The population standard deviation."
"Functions (Aggregate)","STDDEV_SAMP"," "Functions (Aggregate)","STDDEV_SAMP","
STDDEV_SAMP([DISTINCT] double): double STDDEV_SAMP( [ DISTINCT ] double ): double
"," ","
The sample standard deviation." The sample standard deviation."
"Functions (Aggregate)","VAR_POP"," "Functions (Aggregate)","VAR_POP","
VAR_POP([DISTINCT] double): double VAR_POP( [ DISTINCT ] double ): double
"," ","
The population variance (square of the population standard deviation)." The population variance (square of the population standard deviation)."
"Functions (Aggregate)","VAR_SAMP"," "Functions (Aggregate)","VAR_SAMP","
VAR_SAMP([DISTINCT] double): double VAR_SAMP( [ DISTINCT ] double ): double
"," ","
The sample variance (square of the sample standard deviation)." The sample variance (square of the sample standard deviation)."
"Functions (Numeric)","ABS"," "Functions (Numeric)","ABS","
ABS({int | long | decimal | double}): value ABS ( { int | long | decimal | double } ): value
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","ACOS"," "Functions (Numeric)","ACOS","
...@@ -923,7 +918,7 @@ POWER(double, double): double ...@@ -923,7 +918,7 @@ POWER(double, double): double
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","RAND"," "Functions (Numeric)","RAND","
RAND([int]): double RAND( [ int ] ): double
"," ","
Calling the function without parameter returns the next a pseudo random number." Calling the function without parameter returns the next a pseudo random number."
"Functions (Numeric)","RANDOM_UUID"," "Functions (Numeric)","RANDOM_UUID","
...@@ -943,7 +938,7 @@ SECURE_RAND(int): bytes ...@@ -943,7 +938,7 @@ SECURE_RAND(int): bytes
"," ","
Generates a number of cryptographically secure random numbers." Generates a number of cryptographically secure random numbers."
"Functions (Numeric)","SIGN"," "Functions (Numeric)","SIGN","
SIGN({int | long | decimal | double}): int SIGN ( { int | long | decimal | double } ): int
"," ","
Returns -1 if the value is smaller 0, 0 if zero, and otherwise 1." Returns -1 if the value is smaller 0, 0 if zero, and otherwise 1."
"Functions (Numeric)","ENCRYPT"," "Functions (Numeric)","ENCRYPT","
...@@ -984,7 +979,7 @@ BIT_LENGTH(string): long ...@@ -984,7 +979,7 @@ BIT_LENGTH(string): long
"," ","
Returns the number of bits in a string." Returns the number of bits in a string."
"Functions (String)","LENGTH"," "Functions (String)","LENGTH","
{LENGTH | CHAR_LENGTH | CHARACTER_LENGTH}(string): long { LENGTH | CHAR_LENGTH | CHARACTER_LENGTH } ( string ): long
"," ","
Returns the number of characters in a string." Returns the number of characters in a string."
"Functions (String)","OCTET_LENGTH"," "Functions (String)","OCTET_LENGTH","
...@@ -992,7 +987,7 @@ OCTET_LENGTH(string): long ...@@ -992,7 +987,7 @@ OCTET_LENGTH(string): long
"," ","
Returns the number of bytes in a string." Returns the number of bytes in a string."
"Functions (String)","CHAR"," "Functions (String)","CHAR","
{CHAR | CHR}(int): string { CHAR | CHR } ( int ): string
"," ","
Returns the character that represents the ASCII value." Returns the character that represents the ASCII value."
"Functions (String)","CONCAT"," "Functions (String)","CONCAT","
...@@ -1021,11 +1016,11 @@ INSERT(originalString, startInt, lengthInt, addString): string ...@@ -1021,11 +1016,11 @@ INSERT(originalString, startInt, lengthInt, addString): string
Inserts a additional string into the original string at a specified start Inserts a additional string into the original string at a specified start
position." position."
"Functions (String)","LOWER"," "Functions (String)","LOWER","
{LOWER | LCASE}(string): string { LOWER | LCASE } ( string ): string
"," ","
Converts a string to lowercase." Converts a string to lowercase."
"Functions (String)","UPPER"," "Functions (String)","UPPER","
{UPPER | UCASE}(string): string { UPPER | UCASE } ( string ): string
"," ","
Converts a string to uppercase." Converts a string to uppercase."
"Functions (String)","LEFT"," "Functions (String)","LEFT","
...@@ -1061,8 +1056,7 @@ RTRIM(string): string ...@@ -1061,8 +1056,7 @@ RTRIM(string): string
"," ","
Removes all trailing spaces from a string." Removes all trailing spaces from a string."
"Functions (String)","TRIM"," "Functions (String)","TRIM","
TRIM([{LEADING | TRAILING | BOTH} [string] FROM] TRIM ( [ { LEADING | TRAILING | BOTH } [ string ] FROM ] string ): string
string): string
"," ","
Removes all leading spaces, trailing spaces, or spaces at both ends, from a Removes all leading spaces, trailing spaces, or spaces at both ends, from a
string." string."
...@@ -1100,7 +1094,7 @@ STRINGTOUTF8(string): bytes ...@@ -1100,7 +1094,7 @@ STRINGTOUTF8(string): bytes
"," ","
Encodes a string to a byte array using the UTF8 encoding format." Encodes a string to a byte array using the UTF8 encoding format."
"Functions (String)","SUBSTRING"," "Functions (String)","SUBSTRING","
{SUBSTRING | SUBSTR}(string, startInt [, lengthInt]): string { SUBSTRING | SUBSTR } ( string, startInt [, lengthInt ] ): string
"," ","
Returns a substring of a string starting at a position." Returns a substring of a string starting at a position."
"Functions (String)","UTF8TOSTRING"," "Functions (String)","UTF8TOSTRING","
...@@ -1132,15 +1126,15 @@ XMLTEXT(valueString): string ...@@ -1132,15 +1126,15 @@ XMLTEXT(valueString): string
"," ","
Creates an XML text element." Creates an XML text element."
"Functions (Time and Date)","CURRENT_DATE"," "Functions (Time and Date)","CURRENT_DATE","
{CURRENT_DATE[()] | CURDATE() | SYSDATE | TODAY}: date { CURRENT_DATE [ () ] | CURDATE() | SYSDATE | TODAY }: date
"," ","
Returns the current date." Returns the current date."
"Functions (Time and Date)","CURRENT_TIME"," "Functions (Time and Date)","CURRENT_TIME","
{CURRENT_TIME[()] | CURTIME()}: time { CURRENT_TIME [ () ] | CURTIME() }: time
"," ","
Returns the current time." Returns the current time."
"Functions (Time and Date)","CURRENT_TIMESTAMP"," "Functions (Time and Date)","CURRENT_TIMESTAMP","
{CURRENT_TIMESTAMP[([int])] | NOW([int])}: timestamp { CURRENT_TIMESTAMP [ ( [ int ] ) ] | NOW( [ int ] ) }: timestamp
"," ","
Returns the current timestamp." Returns the current timestamp."
"Functions (Time and Date)","DATEADD"," "Functions (Time and Date)","DATEADD","
...@@ -1168,15 +1162,14 @@ DAY_OF_YEAR(date): int ...@@ -1168,15 +1162,14 @@ DAY_OF_YEAR(date): int
"," ","
Returns the day of the year (1-366)." Returns the day of the year (1-366)."
"Functions (Time and Date)","EXTRACT"," "Functions (Time and Date)","EXTRACT","
EXTRACT( EXTRACT ( { YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR
{YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR | DOY | | DOY | HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS }
HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS} FROM timestamp ): int
FROM timestamp): int
"," ","
Returns a specific value from a timestamps." Returns a specific value from a timestamps."
"Functions (Time and Date)","FORMATDATETIME"," "Functions (Time and Date)","FORMATDATETIME","
FORMATDATETIME(timestamp, formatString [, localeString FORMATDATETIME ( timestamp, formatString
[, timeZoneString]]): string [ , localeString [ , timeZoneString ] ] ): string
"," ","
Formats a date, time or timestamp as a string." Formats a date, time or timestamp as a string."
"Functions (Time and Date)","HOUR"," "Functions (Time and Date)","HOUR","
...@@ -1196,7 +1189,8 @@ MONTHNAME(date): string ...@@ -1196,7 +1189,8 @@ MONTHNAME(date): string
"," ","
Returns the name of the month (in English)." Returns the name of the month (in English)."
"Functions (Time and Date)","PARSEDATETIME"," "Functions (Time and Date)","PARSEDATETIME","
PARSEDATETIME(string, formatString [, localeString [, timeZoneString]]): string PARSEDATETIME(string, formatString
[, localeString [, timeZoneString]]): string
"," ","
Parses a string and returns a timestamp." Parses a string and returns a timestamp."
"Functions (Time and Date)","QUARTER"," "Functions (Time and Date)","QUARTER","
...@@ -1248,19 +1242,15 @@ CONVERT(value, dataType): value ...@@ -1248,19 +1242,15 @@ CONVERT(value, dataType): value
"," ","
Converts a value to another data type." Converts a value to another data type."
"Functions (System)","CURRVAL"," "Functions (System)","CURRVAL","
CURRVAL([schemaName, ] sequenceString): long CURRVAL( [ schemaName, ] sequenceString ): long
"," ","
Returns the current (last) value of the sequence, independent of the session." Returns the current (last) value of the sequence, independent of the session."
"Functions (System)","CSVREAD"," "Functions (System)","CSVREAD","
CSVREAD(fileNameString [, columnNamesString [, charsetString CSVREAD(fileNameString [, columnsString [, csvOptions ] ] ): resultSetValue
[, fieldSeparatorString [, fieldDelimiterString [, escapeCharacterString
[, nullString]]]]]]): resultSet
"," ","
Returns the result set of reading the CSV (comma separated values) file." Returns the result set of reading the CSV (comma separated values) file."
"Functions (System)","CSVWRITE"," "Functions (System)","CSVWRITE","
CSVWRITE(fileNameString, queryString [, charsetString [, fieldSeparatorString CSVWRITE ( fileNameString, queryString [, csvOptions [, lineSepString] ] ): int
[, fieldDelimiterString [, escapeCharacterString [, nullString
[, lineSeparatorString]]]]]]): int
"," ","
Writes a CSV (comma separated values)." Writes a CSV (comma separated values)."
"Functions (System)","DATABASE"," "Functions (System)","DATABASE","
...@@ -1302,7 +1292,7 @@ LOCK_TIMEOUT(): int ...@@ -1302,7 +1292,7 @@ LOCK_TIMEOUT(): int
Returns the lock timeout of the current session (in milliseconds)." Returns the lock timeout of the current session (in milliseconds)."
"Functions (System)","LINK_SCHEMA"," "Functions (System)","LINK_SCHEMA","
LINK_SCHEMA(targetSchemaString, driverString, urlString, LINK_SCHEMA(targetSchemaString, driverString, urlString,
userString, passwordString, sourceSchemaString): resultSet userString, passwordString, sourceSchemaString): resultSetValue
"," ","
Creates table links for all tables in a schema." Creates table links for all tables in a schema."
"Functions (System)","MEMORY_FREE"," "Functions (System)","MEMORY_FREE","
...@@ -1314,7 +1304,7 @@ MEMORY_USED(): int ...@@ -1314,7 +1304,7 @@ MEMORY_USED(): int
"," ","
Returns the used memory in KB (where 1024 bytes is a KB)." Returns the used memory in KB (where 1024 bytes is a KB)."
"Functions (System)","NEXTVAL"," "Functions (System)","NEXTVAL","
NEXTVAL([schemaName, ] sequenceString): long NEXTVAL ( [ schemaName, ] sequenceString ): long
"," ","
Returns the next value of the sequence." Returns the next value of the sequence."
"Functions (System)","NULLIF"," "Functions (System)","NULLIF","
...@@ -1342,7 +1332,7 @@ SET(@variableName, value): value ...@@ -1342,7 +1332,7 @@ SET(@variableName, value): value
"," ","
Updates a variable with the given value." Updates a variable with the given value."
"Functions (System)","TABLE"," "Functions (System)","TABLE","
TABLE|TABLE_DISTINCT( { name dataType = expression } [,..]): result set { TABLE | TABLE_DISTINCT } ( { name dataType = expression } [,...] ): resultSetValue
"," ","
Returns the result set." Returns the result set."
"Functions (System)","TRANSACTION_ID"," "Functions (System)","TRANSACTION_ID","
...@@ -1350,7 +1340,7 @@ TRANSACTION_ID(): string ...@@ -1350,7 +1340,7 @@ TRANSACTION_ID(): string
"," ","
Returns the current transaction id for this session." Returns the current transaction id for this session."
"Functions (System)","USER"," "Functions (System)","USER","
{USER | CURRENT_USER}(): string { USER | CURRENT_USER } (): string
"," ","
Returns the name of the current user of this session." Returns the name of the current user of this session."
"System Tables","Information Schema"," "System Tables","Information Schema","
......
...@@ -476,4 +476,9 @@ public class DbContextRule implements Rule { ...@@ -476,4 +476,9 @@ public class DbContextRule implements Rule {
} }
return best; return best;
} }
public String getHtmlRailroad(Bnf config, boolean topLevel) {
return null;
}
} }
...@@ -133,7 +133,7 @@ public class PageParser { ...@@ -133,7 +133,7 @@ public class PageParser {
break; break;
} }
case '$': case '$':
if (p.charAt(i + 1) == '{') { if (p.length() > i + 1 && p.charAt(i + 1) == '{') {
i += 2; i += 2;
int j = p.indexOf('}', i); int j = p.indexOf('}', i);
if (j < 0) { if (j < 0) {
......
...@@ -297,9 +297,12 @@ java org.h2.test.TestAll timer ...@@ -297,9 +297,12 @@ java org.h2.test.TestAll timer
/* /*
serialized patches
check if sources.jar is not in installer and zip, but in h2web check if sources.jar is not in installer and zip, but in h2web
documentation: rolling review at history.html documentation: rolling review at history.html
html sql railroads math utils compareTo?
toArray?
mvcc merge problem mvcc merge problem
......
...@@ -59,28 +59,30 @@ public class GenerateDoc { ...@@ -59,28 +59,30 @@ public class GenerateDoc {
Class.forName("org.h2.Driver"); Class.forName("org.h2.Driver");
conn = DriverManager.getConnection("jdbc:h2:mem:"); conn = DriverManager.getConnection("jdbc:h2:mem:");
new File(outDir).mkdirs(); new File(outDir).mkdirs();
new RailroadImages().run(outDir + "/images");
bnf = Bnf.getInstance(null); bnf = Bnf.getInstance(null);
bnf.linkStatements();
session.put("version", Constants.getVersion()); session.put("version", Constants.getVersion());
session.put("versionDate", Constants.BUILD_DATE); session.put("versionDate", Constants.BUILD_DATE);
session.put("stableVersion", Constants.getVersionStable()); session.put("stableVersion", Constants.getVersionStable());
session.put("stableVersionDate", Constants.BUILD_DATE_STABLE); session.put("stableVersionDate", Constants.BUILD_DATE_STABLE);
// 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"); map("commands", help + "LIKE 'Commands%' ORDER BY ID", true);
map("commandsDML", help + "= 'Commands (DML)' ORDER BY ID"); map("commandsDML", help + "= 'Commands (DML)' ORDER BY ID", true);
map("commandsDDL", help + "= 'Commands (DDL)' ORDER BY ID"); map("commandsDDL", help + "= 'Commands (DDL)' ORDER BY ID", true);
map("commandsOther", help + "= 'Commands (Other)' ORDER BY ID"); map("commandsOther", help + "= 'Commands (Other)' ORDER BY ID", true);
map("otherGrammar", help + "= 'Other Grammar' ORDER BY ID"); map("otherGrammar", help + "= 'Other Grammar' ORDER BY ID", true);
map("functionsAggregate", help + "= 'Functions (Aggregate)' ORDER BY ID"); map("functionsAggregate", help + "= 'Functions (Aggregate)' ORDER BY ID", true);
map("functionsNumeric", help + "= 'Functions (Numeric)' ORDER BY ID"); map("functionsNumeric", help + "= 'Functions (Numeric)' ORDER BY ID", true);
map("functionsString", help + "= 'Functions (String)' ORDER BY ID"); map("functionsString", help + "= 'Functions (String)' ORDER BY ID", true);
map("functionsTimeDate", help + "= 'Functions (Time and Date)' ORDER BY ID"); map("functionsTimeDate", help + "= 'Functions (Time and Date)' ORDER BY ID", true);
map("functionsSystem", help + "= 'Functions (System)' ORDER BY ID"); map("functionsSystem", help + "= 'Functions (System)' ORDER BY ID", true);
map("functionsAll", help + "LIKE 'Functions%' ORDER BY SECTION, ID"); map("functionsAll", help + "LIKE 'Functions%' ORDER BY SECTION, ID", true);
map("dataTypes", help + "LIKE 'Data Types%' ORDER BY SECTION, ID"); 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 "
+ "ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX FROM INFORMATION_SCHEMA.COLUMNS " + "ORDER BY ORDINAL_POSITION SEPARATOR ', ') SYNTAX FROM INFORMATION_SCHEMA.COLUMNS "
+ "WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' GROUP BY TABLE_NAME ORDER BY TABLE_NAME"); + "WHERE TABLE_SCHEMA='INFORMATION_SCHEMA' GROUP BY TABLE_NAME ORDER BY TABLE_NAME", false);
processAll(""); processAll("");
conn.close(); conn.close();
} }
...@@ -115,7 +117,7 @@ public class GenerateDoc { ...@@ -115,7 +117,7 @@ public class GenerateDoc {
out.close(); out.close();
} }
private void map(String key, String sql) throws Exception { private void map(String key, String sql, boolean railroads) throws Exception {
ResultSet rs = null; ResultSet rs = null;
Statement stat = null; Statement stat = null;
try { try {
...@@ -133,9 +135,10 @@ public class GenerateDoc { ...@@ -133,9 +135,10 @@ public class GenerateDoc {
} }
String topic = rs.getString("TOPIC"); String topic = rs.getString("TOPIC");
String syntax = rs.getString("SYNTAX").trim(); String syntax = rs.getString("SYNTAX").trim();
syntax = PageParser.escapeHtml(syntax); if (railroads) {
// if enabled, HTML docs get very wide String railroad = bnf.getRailroadHtml(syntax);
// syntax = StringUtils.replaceAll(syntax, "<br />", " "); map.put("railroad", railroad);
}
syntax = bnf.getSyntaxHtml(syntax); syntax = bnf.getSyntaxHtml(syntax);
map.put("syntax", syntax); map.put("syntax", syntax);
......
...@@ -43,6 +43,7 @@ public class MergeDocs { ...@@ -43,6 +43,7 @@ public class MergeDocs {
for (String page : pages) { for (String page : pages) {
text = StringUtils.replaceAll(text, page + "#", "#"); text = StringUtils.replaceAll(text, page + "#", "#");
} }
text = disableRailroads(text);
text = removeHeaderFooter(fileName, text); text = removeHeaderFooter(fileName, text);
buff.append(text); buff.append(text);
} }
...@@ -59,6 +60,14 @@ public class MergeDocs { ...@@ -59,6 +60,14 @@ public class MergeDocs {
writer.close(); writer.close();
} }
private String disableRailroads(String text) {
text = StringUtils.replaceAll(text, "<!-- railroad-start -->", "<!-- railroad-start ");
text = StringUtils.replaceAll(text, "<!-- railroad-end -->", " railroad-end -->");
text = StringUtils.replaceAll(text, "<!-- syntax-start", "<!-- syntax-start -->");
text = StringUtils.replaceAll(text, "syntax-end -->", "<!-- syntax-end -->");
return text;
}
private String removeHeaderFooter(String fileName, String text) { private String removeHeaderFooter(String fileName, String text) {
// String start = "<body"; // String start = "<body";
// String end = "</body>"; // String end = "</body>";
......
/*
* Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.build.doc;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
/**
* Create the images used in the railroad diagrams.
*/
public class RailroadImages {
private static final int SIZE = 64;
private static final int LINE_REPEAT = 32;
private static final int DIV = 4;
private static final int STROKE = 4;
private String outDir;
/**
* This method is called when executing this application from the command
* line.
*
* @param args the command line parameters
*/
public static void main(String[] args) {
new RailroadImages().run("docs/html/images");
}
/**
* Create the images.
*
* @param outDir the target directory
*/
void run(String outDir) {
this.outDir = outDir;
new File(outDir).mkdirs();
BufferedImage img;
Graphics2D g;
img = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_INT_ARGB);
g = img.createGraphics();
g.setColor(Color.BLACK);
g.setStroke(new BasicStroke(STROKE));
g.drawLine(0, SIZE / 2, SIZE, SIZE / 2);
g.dispose();
savePng(img, "div-d.png");
img = new BufferedImage(SIZE, SIZE * LINE_REPEAT, BufferedImage.TYPE_INT_ARGB);
g = img.createGraphics();
g.setColor(Color.BLACK);
g.setStroke(new BasicStroke(STROKE));
g.drawLine(0, SIZE / 2, SIZE, SIZE / 2);
g.drawLine(SIZE / 2, SIZE, SIZE / 2, SIZE * LINE_REPEAT);
// g.drawLine(0, SIZE / 2, SIZE / 2, SIZE);
g.drawArc(-SIZE / 2, SIZE / 2, SIZE, SIZE, 0, 90);
g.dispose();
savePng(img, "div-ts.png");
savePng(flipHorizontal(img), "div-te.png");
img = new BufferedImage(SIZE, SIZE * LINE_REPEAT, BufferedImage.TYPE_INT_ARGB);
g = img.createGraphics();
g.setColor(Color.BLACK);
g.setStroke(new BasicStroke(STROKE));
g.drawArc(SIZE / 2, -SIZE / 2, SIZE, SIZE, 180, 270);
// g.drawLine(SIZE / 2, 0, SIZE, SIZE / 2);
savePng(img, "div-ls.png");
savePng(flipHorizontal(img), "div-le.png");
g.drawLine(SIZE / 2, 0, SIZE / 2, SIZE * LINE_REPEAT);
g.dispose();
savePng(img, "div-ks.png");
savePng(flipHorizontal(img), "div-ke.png");
}
private void savePng(BufferedImage img, String fileName) {
int w = img.getWidth();
int h = img.getHeight();
BufferedImage smaller = new BufferedImage(w / DIV, h / DIV, img.getType());
Graphics2D g = smaller.createGraphics();
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g.drawImage(img, 0, 0, w / DIV, h / DIV, 0, 0, w, h, null);
g.dispose();
try {
ImageIO.write(smaller, "png", new File(outDir + "/" + fileName));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private BufferedImage flipHorizontal(BufferedImage img) {
int w = img.getWidth(), h = img.getHeight();
BufferedImage copy = new BufferedImage(w, h, img.getType());
Graphics2D g = copy.createGraphics();
g.drawImage(img, 0, 0, w, h, w, 0, 0, h, null);
g.dispose();
return copy;
}
}
...@@ -124,7 +124,7 @@ public class XMLParser { ...@@ -124,7 +124,7 @@ public class XMLParser {
} }
private void error(String expected) { private void error(String expected) {
throw new RuntimeException("Expected: " + expected + " got: " + xml.substring(index)); throw new RuntimeException("Expected: " + expected + " got: " + xml.substring(index, Math.min(index + 1000, xml.length())));
} }
private void read(String chars) { private void read(String chars) {
......
...@@ -615,4 +615,6 @@ linkage superfluous disallow scoop moebius inputs copilot dmoebius leod jenkov ...@@ -615,4 +615,6 @@ linkage superfluous disallow scoop moebius inputs copilot dmoebius leod jenkov
jakob poker docware peter unstable measurable scramble reissued recreation jakob poker docware peter unstable measurable scramble reissued recreation
scrambling distinguish official unofficial distinguishable overwrites lastval scrambling distinguish official unofficial distinguishable overwrites lastval
notranslate vince bonfanti alphabetically sysdummy sysibm activation notranslate vince bonfanti alphabetically sysdummy sysibm activation
deactivation concatenating reproducing black deactivation concatenating reproducing black railroads railroad radius moz
\ No newline at end of file imageio argb bilinear rendering stroke interpolation flip diagrams draw
delim
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论