提交 11095888 authored 作者: Thomas Mueller's avatar Thomas Mueller

HTML railroad diagrams

上级 135c9b5b
...@@ -9,7 +9,7 @@ FROM tableExpression [,...] [ WHERE expression ] ...@@ -9,7 +9,7 @@ FROM tableExpression [,...] [ WHERE expression ]
[ GROUP BY expression [,...] ] [ HAVING expression ] [ GROUP BY expression [,...] ] [ HAVING expression ]
[ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } select ] [ ORDER BY order [,...] ] [ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } select ] [ ORDER BY order [,...] ]
[ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ] [ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ]
[ FOR UPDATE ]"," [ 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). GROUP BY groups the the result by the given expression(s).
...@@ -36,7 +36,7 @@ SELECT * FROM (SELECT ID, COUNT(*) FROM TEST ...@@ -36,7 +36,7 @@ SELECT * FROM (SELECT ID, COUNT(*) FROM TEST
"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.
"," ","
...@@ -88,7 +88,7 @@ EXPLAIN SELECT * FROM TEST WHERE ID=1 ...@@ -88,7 +88,7 @@ EXPLAIN SELECT * FROM TEST WHERE ID=1
"Commands (DML)","MERGE"," "Commands (DML)","MERGE","
MERGE INTO tableName [ ( columnName [,...] ) ] MERGE INTO tableName [ ( columnName [,...] ) ]
[ KEY ( columnName [,...] ) ] [ KEY ( columnName [,...] ) ]
{ VALUES { ( [ { DEFAULT | expression } [,...] ] ) } [,...] | select } { 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
...@@ -100,10 +100,8 @@ MERGE INTO TEST KEY(ID) VALUES(2, 'World') ...@@ -100,10 +100,8 @@ 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 ] [ CHARSET charsetString ]
[ CIPHER cipher PASSWORD string ]
[ 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
...@@ -529,8 +527,8 @@ CREATE SEQUENCE SEQ_ID ...@@ -529,8 +527,8 @@ 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 ] TABLE [ IF NOT EXISTS ]
name { ( { columnDefinition | constraint } [,...] ) [ AS select ] } name { { ( { columnDefinition | constraint } [,...] ) [ AS select ] }
| { AS select } [ NOT PERSISTENT ] | { AS select } } [ NOT PERSISTENT ]
"," ","
Creates a new table. Creates a new table.
...@@ -816,8 +814,8 @@ PREPARE COMMIT XID_TEST ...@@ -816,8 +814,8 @@ PREPARE COMMIT XID_TEST
" "
"Commands (Other)","REVOKE RIGHT"," "Commands (Other)","REVOKE RIGHT","
REVOKE { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON tableName REVOKE { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
[,...] FROM { PUBLIC | userName | roleName } tableName [,...] FROM { PUBLIC | userName | roleName }
"," ","
Removes rights for a table from a user or role. Removes rights for a table from a user or role.
...@@ -1489,7 +1487,7 @@ CREATE TABLE(ID BIGINT IDENTITY); ...@@ -1489,7 +1487,7 @@ CREATE TABLE(ID BIGINT IDENTITY);
" "
"Other Grammar","Expression"," "Other Grammar","Expression","
andCondition [ OR andCondition ] andCondition [ { OR andCondition } [...] ]
"," ","
Value or condition. Value or condition.
"," ","
...@@ -1497,7 +1495,7 @@ ID=1 OR NAME='Hi' ...@@ -1497,7 +1495,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.
"," ","
...@@ -1543,7 +1541,7 @@ Comparison operator. The operator != is the same as <>. ...@@ -1543,7 +1541,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.
"," ","
...@@ -1551,7 +1549,7 @@ A value or a concatenation of values. ...@@ -1551,7 +1549,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.
"," ","
...@@ -1559,7 +1557,7 @@ ID + 20 ...@@ -1559,7 +1557,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.
"," ","
...@@ -1695,7 +1693,7 @@ $$John's car$$ ...@@ -1695,7 +1693,7 @@ $$John's car$$
" "
"Other Grammar","Int"," "Other Grammar","Int","
[ - | + ] digit [...] [ + | - ] number
"," ","
The maximum integer number is 2147483647, the minimum is -2147483648. The maximum integer number is 2147483647, the minimum is -2147483648.
"," ","
...@@ -1703,7 +1701,7 @@ The maximum integer number is 2147483647, the minimum is -2147483648. ...@@ -1703,7 +1701,7 @@ The maximum integer number is 2147483647, the minimum is -2147483648.
" "
"Other Grammar","Long"," "Other Grammar","Long","
[ - | + ] digit [...] [ + | - ] number
"," ","
Long numbers are between -9223372036854775808 and 9223372036854775807. Long numbers are between -9223372036854775808 and 9223372036854775807.
"," ","
...@@ -1719,7 +1717,7 @@ A number written in hexadecimal notation. ...@@ -1719,7 +1717,7 @@ A number written in hexadecimal notation.
" "
"Other Grammar","Decimal"," "Other Grammar","Decimal","
[ - | + ] digit [...] [ . digit [...] ] [ + | - ] number [ . number ]
"," ","
Number with fixed precision and scale. Number with fixed precision and scale.
"," ","
...@@ -1727,14 +1725,21 @@ Number with fixed precision and scale. ...@@ -1727,14 +1725,21 @@ Number with fixed precision and scale.
" "
"Other Grammar","Double"," "Other Grammar","Double","
[ - | + ] digit [...] [ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
[ . 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.
"," ","
-1.4e-10 -1.4e-10
" "
"Other Grammar","Number","
digit [...]
","
The maximum length of the number depends on the data type used.
","
100
"
"Other Grammar","Date"," "Other Grammar","Date","
DATE 'yyyy-MM-dd' DATE 'yyyy-MM-dd'
"," ","
...@@ -2061,37 +2066,43 @@ ARRAY ...@@ -2061,37 +2066,43 @@ ARRAY
" "
"Functions (Aggregate)","AVG"," "Functions (Aggregate)","AVG","
AVG ( [ DISTINCT ] { int | long | decimal | double } ): value AVG ( [ DISTINCT ] { int | long | decimal | double } )
"," ","
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.
The returned value is of the same data type as the parameter.
"," ","
AVG(X) AVG(X)
" "
"Functions (Aggregate)","BOOL_AND"," "Functions (Aggregate)","BOOL_AND","
BOOL_AND(boolean): boolean BOOL_AND(boolean)
"," ","
Returns true if all expressions are true. If no rows are selected, the result is Returns true if all expressions are true.
NULL. Aggregates are only allowed in select statements. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
"," ","
BOOL_AND(ID>10) BOOL_AND(ID>10)
" "
"Functions (Aggregate)","BOOL_OR"," "Functions (Aggregate)","BOOL_OR","
BOOL_OR(boolean): boolean BOOL_OR(boolean)
"," ","
Returns true if any expression is true. If no rows are selected, the result is Returns true if any expression is true.
NULL. Aggregates are only allowed in select statements. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
"," ","
BOOL_OR(NAME LIKE 'W%') BOOL_OR(NAME LIKE 'W%')
" "
"Functions (Aggregate)","COUNT"," "Functions (Aggregate)","COUNT","
COUNT(*) | COUNT( [ DISTINCT ] expression ): long COUNT( { * | { [ DISTINCT ] expression } } )
"," ","
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.
result is 0. Aggregates are only allowed in select statements. This method returns a long.
If no rows are selected, the result is 0.
Aggregates are only allowed in select statements.
"," ","
COUNT(*) COUNT(*)
" "
...@@ -2099,285 +2110,330 @@ COUNT(*) ...@@ -2099,285 +2110,330 @@ COUNT(*)
"Functions (Aggregate)","GROUP_CONCAT"," "Functions (Aggregate)","GROUP_CONCAT","
GROUP_CONCAT ( [ DISTINCT ] string GROUP_CONCAT ( [ DISTINCT ] string
[ ORDER BY { expression [ ASC | DESC ] } [,...] ] [ ORDER BY { expression [ ASC | DESC ] } [,...] ]
[ SEPARATOR expression ] ): string [ SEPARATOR expression ] )
"," ","
Concatenates strings with a separator. The default separator is a ',' (without Concatenates strings with a separator.
space). If no rows are selected, the result is NULL. Aggregates are only allowed The default separator is a ',' (without space).
in select statements. This method returns a string.
If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
"," ","
GROUP_CONCAT(NAME ORDER BY ID SEPARATOR ', ') GROUP_CONCAT(NAME ORDER BY ID SEPARATOR ', ')
" "
"Functions (Aggregate)","MAX"," "Functions (Aggregate)","MAX","
MAX(value): value MAX(value)
"," ","
The highest value. If no rows are selected, the result is NULL. Aggregates are The highest value.
only allowed in select statements. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
The returned value is of the same data type as the parameter.
"," ","
MAX(NAME) MAX(NAME)
" "
"Functions (Aggregate)","MIN"," "Functions (Aggregate)","MIN","
MIN(value): value MIN(value)
"," ","
The lowest value. If no rows are selected, the result is NULL. Aggregates are The lowest value.
only allowed in select statements. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
The returned value is of the same data type as the parameter.
"," ","
MIN(NAME) MIN(NAME)
" "
"Functions (Aggregate)","SUM"," "Functions (Aggregate)","SUM","
SUM( [ DISTINCT ] { int | long | decimal | double } ): value SUM( [ DISTINCT ] { int | long | decimal | double } )
"," ","
The sum of all values. If no rows are selected, the result is NULL. Aggregates The sum of all values.
are only allowed in select statements. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
The returned value is of the same data type as the parameter.
"," ","
SUM(X) SUM(X)
" "
"Functions (Aggregate)","SELECTIVITY"," "Functions (Aggregate)","SELECTIVITY","
SELECTIVITY(value): int SELECTIVITY(value)
"," ","
Estimates the selectivity (0-100) of a value. The value is defined as (100 * Estimates the selectivity (0-100) of a value.
distinctCount / rowCount). The selectivity of 0 rows is 0 (unknown). Up to 10000 The value is defined as (100 * distinctCount / rowCount).
values are kept in memory. Aggregates are only allowed in select statements. The selectivity of 0 rows is 0 (unknown).
Up to 10000 values are kept in memory.
Aggregates are only allowed in select statements.
"," ","
SELECT SELECTIVITY(FIRSTNAME), SELECTIVITY(NAME) FROM TEST WHERE ROWNUM()<20000 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 )
"," ","
The population standard deviation. If no rows are selected, the result is NULL. The population standard deviation.
This method returns a double.
If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements. Aggregates are only allowed in select statements.
"," ","
STDDEV_POP(X) STDDEV_POP(X)
" "
"Functions (Aggregate)","STDDEV_SAMP"," "Functions (Aggregate)","STDDEV_SAMP","
STDDEV_SAMP( [ DISTINCT ] double ): double STDDEV_SAMP( [ DISTINCT ] double )
"," ","
The sample standard deviation. If no rows are selected, the result is NULL. The sample standard deviation.
This method returns a double.
If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements. Aggregates are only allowed in select statements.
"," ","
STDDEV(X) STDDEV(X)
" "
"Functions (Aggregate)","VAR_POP"," "Functions (Aggregate)","VAR_POP","
VAR_POP( [ DISTINCT ] double ): double VAR_POP( [ DISTINCT ] double )
"," ","
The population variance (square of the population standard deviation). If no The population variance (square of the population standard deviation).
rows are selected, the result is NULL. Aggregates are only allowed in select This method returns a double.
statements. If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
"," ","
VAR_POP(X) VAR_POP(X)
" "
"Functions (Aggregate)","VAR_SAMP"," "Functions (Aggregate)","VAR_SAMP","
VAR_SAMP( [ DISTINCT ] double ): double VAR_SAMP( [ DISTINCT ] double )
"," ","
The sample variance (square of the sample standard deviation). If no rows are The sample variance (square of the sample standard deviation).
selected, the result is NULL. Aggregates are only allowed in select statements. This method returns a double.
If no rows are selected, the result is NULL.
Aggregates are only allowed in select statements.
"," ","
VAR_SAMP(X) VAR_SAMP(X)
" "
"Functions (Numeric)","ABS"," "Functions (Numeric)","ABS","
ABS ( { int | long | decimal | double } ): value ABS ( { int | long | decimal | double } )
"," ","
See also Java Math.abs. Please note that Math.abs(Integer.MIN_VALUE) == See also Java Math.abs.
Integer.MIN_VALUE and Math.abs(Long.MIN_VALUE) == Long.MIN_VALUE. Please note that Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE and Math.abs(Long.MIN_VALUE) == Long.MIN_VALUE.
The returned value is of the same data type as the parameter.
"," ","
ABS(ID) ABS(ID)
" "
"Functions (Numeric)","ACOS"," "Functions (Numeric)","ACOS","
ACOS(double): double ACOS(double)
"," ","
See also Java Math.* functions. See also Java Math.* functions.
This method returns a double.
"," ","
ACOS(D) ACOS(D)
" "
"Functions (Numeric)","ASIN"," "Functions (Numeric)","ASIN","
ASIN(double): double ASIN(double)
"," ","
See also Java Math.* functions. See also Java Math.* functions.
This method returns a double.
"," ","
ASIN(D) ASIN(D)
" "
"Functions (Numeric)","ATAN"," "Functions (Numeric)","ATAN","
ATAN(double): double ATAN(double)
"," ","
See also Java Math.* functions. See also Java Math.* functions.
This method returns a double.
"," ","
ATAN(D) ATAN(D)
" "
"Functions (Numeric)","COS"," "Functions (Numeric)","COS","
COS(double): double COS(double)
"," ","
See also Java Math.* functions. See also Java Math.* functions.
This method returns a double.
"," ","
COS(ANGLE) COS(ANGLE)
" "
"Functions (Numeric)","COT"," "Functions (Numeric)","COT","
COT(double): double COT(double)
"," ","
See also Java Math.* functions. See also Java Math.* functions.
This method returns a double.
"," ","
COT(ANGLE) COT(ANGLE)
" "
"Functions (Numeric)","SIN"," "Functions (Numeric)","SIN","
SIN(double): double SIN(double)
"," ","
See also Java Math.* functions. See also Java Math.* functions.
This method returns a double.
"," ","
SIN(ANGLE) SIN(ANGLE)
" "
"Functions (Numeric)","TAN"," "Functions (Numeric)","TAN","
TAN(double): double TAN(double)
"," ","
See also Java Math.* functions. See also Java Math.* functions.
This method returns a double.
"," ","
TAN(ANGLE) TAN(ANGLE)
" "
"Functions (Numeric)","ATAN2"," "Functions (Numeric)","ATAN2","
ATAN2(double, double): double ATAN2(double, double)
"," ","
See also Java Math.atan2. See also Java Math.atan2.
This method returns a double.
"," ","
ATAN2(X, Y) ATAN2(X, Y)
" "
"Functions (Numeric)","BITAND"," "Functions (Numeric)","BITAND","
BITAND(long, long): long BITAND(long, long)
"," ","
The bitwise AND operation.
This method returns a long.
See also Java operator &. See also Java operator &.
"," ","
BITAND(A, B) BITAND(A, B)
" "
"Functions (Numeric)","BITOR"," "Functions (Numeric)","BITOR","
BITOR(long, long): long BITOR(long, long)
"," ","
The bitwise OR operation.
This method returns a long.
See also Java operator |. See also Java operator |.
"," ","
BITOR(A, B) BITOR(A, B)
" "
"Functions (Numeric)","BITXOR"," "Functions (Numeric)","BITXOR","
BITXOR(long, long): long BITXOR(long, long)
"," ","
The bitwise XOR operation.
This method returns a long.
See also Java operator ^. See also Java operator ^.
"," ","
BITXOR(A, B) BITXOR(A, B)
" "
"Functions (Numeric)","MOD"," "Functions (Numeric)","MOD","
MOD(long, long): long MOD(long, long)
"," ","
The modulo operation.
This method returns a long.
See also Java operator %. See also Java operator %.
"," ","
MOD(A, B) MOD(A, B)
" "
"Functions (Numeric)","CEILING"," "Functions (Numeric)","CEILING","
CEILING(double): double CEILING(double)
"," ","
See also Java Math.ceil. See also Java Math.ceil.
This method returns a double.
"," ","
LOG(A) LOG(A)
" "
"Functions (Numeric)","DEGREES"," "Functions (Numeric)","DEGREES","
DEGREES(double): double DEGREES(double)
"," ","
See also Java Math.toDegrees. See also Java Math.toDegrees.
This method returns a double.
"," ","
DEGREES(A) DEGREES(A)
" "
"Functions (Numeric)","EXP"," "Functions (Numeric)","EXP","
EXP(double): double EXP(double)
"," ","
See also Java Math.exp. See also Java Math.exp.
This method returns a double.
"," ","
EXP(A) EXP(A)
" "
"Functions (Numeric)","FLOOR"," "Functions (Numeric)","FLOOR","
FLOOR(double): double FLOOR(double)
"," ","
See also Java Math.floor. See also Java Math.floor.
This method returns a double.
"," ","
FLOOR(A) FLOOR(A)
" "
"Functions (Numeric)","LOG"," "Functions (Numeric)","LOG","
LOG(double): double LOG(double)
"," ","
See also Java Math.log. See also Java Math.log.
This method returns a double.
"," ","
LOG(A) LOG(A)
" "
"Functions (Numeric)","LOG10"," "Functions (Numeric)","LOG10","
LOG10(double): double LOG10(double)
"," ","
See also Java Math.log10 (in Java 5). See also Java Math.log10 (in Java 5).
This method returns a double.
"," ","
LOG10(A) LOG10(A)
" "
"Functions (Numeric)","RADIANS"," "Functions (Numeric)","RADIANS","
RADIANS(double): double RADIANS(double)
"," ","
See also Java Math.toRadians. See also Java Math.toRadians.
This method returns a double.
"," ","
RADIANS(A) RADIANS(A)
" "
"Functions (Numeric)","SQRT"," "Functions (Numeric)","SQRT","
SQRT(double): double SQRT(double)
"," ","
See also Java Math.sqrt. See also Java Math.sqrt.
This method returns a double.
"," ","
SQRT(A) SQRT(A)
" "
"Functions (Numeric)","PI"," "Functions (Numeric)","PI","
PI(): double PI()
"," ","
See also Java Math.PI. See also Java Math.PI.
This method returns a double.
"," ","
PI() PI()
" "
"Functions (Numeric)","POWER"," "Functions (Numeric)","POWER","
POWER(double, double): double POWER(double, double)
"," ","
See also Java Math.pow. See also Java Math.pow.
This method returns a double.
"," ","
POWER(A, B) POWER(A, B)
" "
"Functions (Numeric)","RAND"," "Functions (Numeric)","RAND","
RAND( [ int ] ): double RAND( [ int ] )
"," ","
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.
This method returns a double.
"," ","
RAND() RAND()
" "
"Functions (Numeric)","RANDOM_UUID"," "Functions (Numeric)","RANDOM_UUID","
RANDOM_UUID(): UUID RANDOM_UUID()
"," ","
Returns a new UUID with 122 pseudo random bits. Returns a new UUID with 122 pseudo random bits.
"," ","
...@@ -2385,35 +2441,38 @@ RANDOM_UUID() ...@@ -2385,35 +2441,38 @@ RANDOM_UUID()
" "
"Functions (Numeric)","ROUND"," "Functions (Numeric)","ROUND","
ROUND(double, digitsInt): double ROUND(double, digitsInt)
"," ","
Rounds to a number of digits. Rounds to a number of digits.
This method returns a double.
"," ","
ROUND(VALUE, 2) ROUND(VALUE, 2)
" "
"Functions (Numeric)","ROUNDMAGIC"," "Functions (Numeric)","ROUNDMAGIC","
ROUNDMAGIC(double): double ROUNDMAGIC(double)
"," ","
This function rounds numbers in a good way, but it is slow. It has a special This function rounds numbers in a good way, but it is slow.
handling for numbers around 0. Only numbers smaller or equal +/-1000000000000 It has a special handling for numbers around 0.
are supported. The value is converted to a String internally, and then the last Only numbers smaller or equal +/-1000000000000 are supported.
last 4 characters are checked. '000x' becomes '0000' and '999x' becomes The value is converted to a String internally, and then the last last 4 characters are checked.
'999999', which is rounded automatically. '000x' becomes '0000' and '999x' becomes '999999', which is rounded automatically.
This method returns a double.
"," ","
ROUNDMAGIC(VALUE/3*3) ROUNDMAGIC(VALUE/3*3)
" "
"Functions (Numeric)","SECURE_RAND"," "Functions (Numeric)","SECURE_RAND","
SECURE_RAND(int): bytes SECURE_RAND(int)
"," ","
Generates a number of cryptographically secure random numbers. Generates a number of cryptographically secure random numbers.
This method returns bytes.
"," ","
CALL SECURE_RAND(16) CALL SECURE_RAND(16)
" "
"Functions (Numeric)","SIGN"," "Functions (Numeric)","SIGN","
SIGN ( { int | long | decimal | double } ): int SIGN ( { int | long | decimal | double } )
"," ","
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.
"," ","
...@@ -2421,62 +2480,69 @@ SIGN(VALUE) ...@@ -2421,62 +2480,69 @@ SIGN(VALUE)
" "
"Functions (Numeric)","ENCRYPT"," "Functions (Numeric)","ENCRYPT","
ENCRYPT(algorithmString, keyBytes, dataBytes): bytes ENCRYPT(algorithmString, keyBytes, dataBytes)
"," ","
Encrypts data using a key. Supported algorithms are XTEA and AES. The block size Encrypts data using a key.
is 16 bytes. Supported algorithms are XTEA and AES.
The block size is 16 bytes.
This method returns bytes.
"," ","
CALL ENCRYPT('AES', '00', STRINGTOUTF8('Test')) CALL ENCRYPT('AES', '00', STRINGTOUTF8('Test'))
" "
"Functions (Numeric)","DECRYPT"," "Functions (Numeric)","DECRYPT","
DECRYPT(algorithmString, keyBytes, dataBytes): bytes DECRYPT(algorithmString, keyBytes, dataBytes)
"," ","
Decrypts data using a key. Supported algorithms are XTEA and AES. The block size Decrypts data using a key.
is 16 bytes. Supported algorithms are XTEA and AES.
The block size is 16 bytes.
This method returns bytes.
"," ","
CALL TRIM(CHAR(0) FROM UTF8TOSTRING( CALL TRIM(CHAR(0) FROM UTF8TOSTRING(
DECRYPT('AES', '00', '3fabb4de8f1ee2e97d7793bab2db1116'))) DECRYPT('AES', '00', '3fabb4de8f1ee2e97d7793bab2db1116')))
" "
"Functions (Numeric)","HASH"," "Functions (Numeric)","HASH","
HASH(algorithmString, dataBytes, iterationInt): bytes HASH(algorithmString, dataBytes, iterationInt)
"," ","
Calculate the hash value using an algorithm, and repeat this process for a Calculate the hash value using an algorithm, and repeat this process for a number of iterations.
number of iterations. Currently, the only algorithm supported is SHA256. Currently, the only algorithm supported is SHA256.
This method returns bytes.
"," ","
CALL HASH('SHA256', STRINGTOUTF8('Password'), 1000) CALL HASH('SHA256', STRINGTOUTF8('Password'), 1000)
" "
"Functions (Numeric)","TRUNCATE"," "Functions (Numeric)","TRUNCATE","
TRUNCATE(double, digitsInt): double TRUNCATE(double, digitsInt)
"," ","
Truncates to a number of digits (to the next value closer to 0). Truncates to a number of digits (to the next value closer to 0).
This method returns a double.
"," ","
TRUNCATE(VALUE, 2) TRUNCATE(VALUE, 2)
" "
"Functions (Numeric)","COMPRESS"," "Functions (Numeric)","COMPRESS","
COMPRESS(dataBytes [, algorithmString]): bytes COMPRESS(dataBytes [, algorithmString])
"," ","
Compresses the data using the specified compression algorithm. Supported Compresses the data using the specified compression algorithm.
algorithms are: LZF (faster but lower compression; default), and DEFLATE (higher Supported algorithms are: LZF (faster but lower compression; default), and DEFLATE (higher compression).
compression). Compression does not always reduce size. Very small objects and Compression does not always reduce size. Very small objects and objects with little redundancy may get larger.
objects with little redundancy may get larger. This method returns bytes.
"," ","
COMPRESS(STRINGTOUTF8('Test')) COMPRESS(STRINGTOUTF8('Test'))
" "
"Functions (Numeric)","EXPAND"," "Functions (Numeric)","EXPAND","
EXPAND(bytes): bytes EXPAND(bytes)
"," ","
Expands data that was compressed using the COMPRESS function. Expands data that was compressed using the COMPRESS function.
This method returns bytes.
"," ","
UTF8TOSTRING(EXPAND(COMPRESS(STRINGTOUTF8('Test')))) UTF8TOSTRING(EXPAND(COMPRESS(STRINGTOUTF8('Test'))))
" "
"Functions (Numeric)","ZERO"," "Functions (Numeric)","ZERO","
ZERO(): int ZERO()
"," ","
Returns the value 0. This function can be used even if numeric literals are disabled. Returns the value 0. This function can be used even if numeric literals are disabled.
"," ","
...@@ -2484,103 +2550,113 @@ ZERO() ...@@ -2484,103 +2550,113 @@ ZERO()
" "
"Functions (String)","ASCII"," "Functions (String)","ASCII","
ASCII(string): int ASCII(string)
"," ","
Returns the ASCII value of the first character in the string. Returns the ASCII value of the first character in the string.
This method returns an int.
"," ","
ASCII('Hi') ASCII('Hi')
" "
"Functions (String)","BIT_LENGTH"," "Functions (String)","BIT_LENGTH","
BIT_LENGTH(string): long BIT_LENGTH(string)
"," ","
Returns the number of bits in a string. For BLOB, CLOB, BYTES and JAVA_OBJECT, Returns the number of bits in a string.
the precision is used. Each character needs 16 bits. This method returns a long.
For BLOB, CLOB, BYTES and JAVA_OBJECT, the precision is used. Each character needs 16 bits.
"," ","
BIT_LENGTH(NAME) BIT_LENGTH(NAME)
" "
"Functions (String)","LENGTH"," "Functions (String)","LENGTH","
{ LENGTH | CHAR_LENGTH | CHARACTER_LENGTH } ( string ): long { LENGTH | CHAR_LENGTH | CHARACTER_LENGTH } ( string )
"," ","
Returns the number of characters in a string. For BLOB, CLOB, BYTES and Returns the number of characters in a string.
JAVA_OBJECT, the precision is used. This method returns a long.
For BLOB, CLOB, BYTES and JAVA_OBJECT, the precision is used.
"," ","
LENGTH(NAME) LENGTH(NAME)
" "
"Functions (String)","OCTET_LENGTH"," "Functions (String)","OCTET_LENGTH","
OCTET_LENGTH(string): long OCTET_LENGTH(string)
"," ","
Returns the number of bytes in a string. For BLOB, CLOB, BYTES and JAVA_OBJECT, Returns the number of bytes in a string.
the precision is used. Each character needs 2 bytes. This method returns a long.
For BLOB, CLOB, BYTES and JAVA_OBJECT, the precision is used.
Each character needs 2 bytes.
"," ","
OCTET_LENGTH(NAME) OCTET_LENGTH(NAME)
" "
"Functions (String)","CHAR"," "Functions (String)","CHAR","
{ CHAR | CHR } ( int ): string { CHAR | CHR } ( int )
"," ","
Returns the character that represents the ASCII value. Returns the character that represents the ASCII value.
This method returns a string.
"," ","
CHAR(65) CHAR(65)
" "
"Functions (String)","CONCAT"," "Functions (String)","CONCAT","
CONCAT(string, string [,...]): string CONCAT(string, string [,...])
"," ","
Combines strings. Combines strings.
This method returns a string.
"," ","
CONCAT(NAME, '!') CONCAT(NAME, '!')
" "
"Functions (String)","DIFFERENCE"," "Functions (String)","DIFFERENCE","
DIFFERENCE(string, string): int DIFFERENCE(string, string)
"," ","
Returns the difference between the sounds of two strings. Returns the difference between the sounds of two strings.
This method returns an int.
"," ","
DIFFERENCE(T1.NAME, T2.NAME) DIFFERENCE(T1.NAME, T2.NAME)
" "
"Functions (String)","HEXTORAW"," "Functions (String)","HEXTORAW","
HEXTORAW(string): string HEXTORAW(string)
"," ","
Converts a hex representation of a string to a string. 4 hex characters per Converts a hex representation of a string to a string.
string character are used. 4 hex characters per string character are used.
"," ","
HEXTORAW(DATA) HEXTORAW(DATA)
" "
"Functions (String)","RAWTOHEX"," "Functions (String)","RAWTOHEX","
RAWTOHEX(string): string RAWTOHEX(string)
"," ","
Converts a string to the hex representation. 4 hex characters per string Converts a string to the hex representation.
character are used. 4 hex characters per string character are used.
This method returns a string.
"," ","
RAWTOHEX(DATA) RAWTOHEX(DATA)
" "
"Functions (String)","INSTR"," "Functions (String)","INSTR","
INSTR(string, searchString, [, startInt]): int INSTR(string, searchString, [, startInt])
"," ","
Returns the location of a search string in a string (s). If a start position is Returns the location of a search string in a string (s).
used, the characters before it are ignored. If position is negative, the If a start position is used, the characters before it are ignored.
rightmost location is returned. 0 is returned if the search string is not found. If position is negative, the rightmost location is returned.
0 is returned if the search string is not found.
"," ","
INSTR(EMAIL,'@') INSTR(EMAIL,'@')
" "
"Functions (String)","INSERT Function"," "Functions (String)","INSERT Function","
INSERT(originalString, startInt, lengthInt, addString): string INSERT(originalString, startInt, lengthInt, addString)
"," ","
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. The length specifies the number of characters that are removed at the The length specifies the number of characters that are removed at the start position in the original string.
start position in the original string. This method returns a string.
"," ","
INSERT(NAME, 1, 1, ' ') INSERT(NAME, 1, 1, ' ')
" "
"Functions (String)","LOWER"," "Functions (String)","LOWER","
{ LOWER | LCASE } ( string ): string { LOWER | LCASE } ( string )
"," ","
Converts a string to lowercase. Converts a string to lowercase.
"," ","
...@@ -2588,7 +2664,7 @@ LOWER(NAME) ...@@ -2588,7 +2664,7 @@ LOWER(NAME)
" "
"Functions (String)","UPPER"," "Functions (String)","UPPER","
{ UPPER | UCASE } ( string ): string { UPPER | UCASE } ( string )
"," ","
Converts a string to uppercase. Converts a string to uppercase.
"," ","
...@@ -2596,7 +2672,7 @@ UPPER(NAME) ...@@ -2596,7 +2672,7 @@ UPPER(NAME)
" "
"Functions (String)","LEFT"," "Functions (String)","LEFT","
LEFT(string, int): string LEFT(string, int)
"," ","
Returns the leftmost number of characters. Returns the leftmost number of characters.
"," ","
...@@ -2604,7 +2680,7 @@ LEFT(NAME, 3) ...@@ -2604,7 +2680,7 @@ LEFT(NAME, 3)
" "
"Functions (String)","RIGHT"," "Functions (String)","RIGHT","
RIGHT(string, int): string RIGHT(string, int)
"," ","
Returns the rightmost number of characters. Returns the rightmost number of characters.
"," ","
...@@ -2612,17 +2688,18 @@ RIGHT(NAME, 3) ...@@ -2612,17 +2688,18 @@ RIGHT(NAME, 3)
" "
"Functions (String)","LOCATE"," "Functions (String)","LOCATE","
LOCATE(searchString, string [, startInt]): int LOCATE(searchString, string [, startInt])
"," ","
Returns the location of a search string in a string. If a start position is Returns the location of a search string in a string.
used, the characters before it are ignored. If position is negative, the If a start position is used, the characters before it are ignored.
rightmost location is returned. 0 is returned if the search string is not found. If position is negative, the rightmost location is returned.
0 is returned if the search string is not found.
"," ","
LOCATE('.', NAME) LOCATE('.', NAME)
" "
"Functions (String)","POSITION"," "Functions (String)","POSITION","
POSITION(searchString, string): int POSITION(searchString, string)
"," ","
Returns the location of a search string in a string. See also LOCATE. Returns the location of a search string in a string. See also LOCATE.
"," ","
...@@ -2630,27 +2707,27 @@ POSITION('.', NAME) ...@@ -2630,27 +2707,27 @@ POSITION('.', NAME)
" "
"Functions (String)","LPAD"," "Functions (String)","LPAD","
LPAD(string, int[, paddingString]): string LPAD(string, int[, paddingString])
"," ","
Left pad the string to the specified length. If the length is shorter than the Left pad the string to the specified length.
string, it will be truncated at the end. If the padding string is not set, If the length is shorter than the string, it will be truncated at the end.
spaces will be used. If the padding string is not set, spaces will be used.
"," ","
LPAD(AMOUNT, 10, '*') LPAD(AMOUNT, 10, '*')
" "
"Functions (String)","RPAD"," "Functions (String)","RPAD","
RPAD(string, int[, paddingString]): string RPAD(string, int[, paddingString])
"," ","
Right pad the string to the specified length. If the length is shorter than the Right pad the string to the specified length.
string, it will be truncated. If the padding string is not set, spaces will be If the length is shorter than the string, it will be truncated.
used. If the padding string is not set, spaces will be used.
"," ","
RPAD(TEXT, 10, '-') RPAD(TEXT, 10, '-')
" "
"Functions (String)","LTRIM"," "Functions (String)","LTRIM","
LTRIM(string): string LTRIM(string)
"," ","
Removes all leading spaces from a string. Removes all leading spaces from a string.
"," ","
...@@ -2658,7 +2735,7 @@ LTRIM(NAME) ...@@ -2658,7 +2735,7 @@ LTRIM(NAME)
" "
"Functions (String)","RTRIM"," "Functions (String)","RTRIM","
RTRIM(string): string RTRIM(string)
"," ","
Removes all trailing spaces from a string. Removes all trailing spaces from a string.
"," ","
...@@ -2666,25 +2743,25 @@ RTRIM(NAME) ...@@ -2666,25 +2743,25 @@ RTRIM(NAME)
" "
"Functions (String)","TRIM"," "Functions (String)","TRIM","
TRIM ( [ { LEADING | TRAILING | BOTH } [ string ] FROM ] string ): string TRIM ( [ { LEADING | TRAILING | BOTH } [ string ] FROM ] 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. Other characters can be removed as well. Other characters can be removed as well.
"," ","
TRIM(BOTH '_' FROM NAME) TRIM(BOTH '_' FROM NAME)
" "
"Functions (String)","REGEXP_REPLACE"," "Functions (String)","REGEXP_REPLACE","
REGEXP_REPLACE(inputString, regexString, replacementString): string REGEXP_REPLACE(inputString, regexString, replacementString)
"," ","
Replaces each substring that matches a regular expression. For details, see the Replaces each substring that matches a regular expression.
Java String.replaceAll() method. For details, see the Java String.replaceAll() method.
"," ","
REGEXP_REPLACE('Hello World', ' +', ' ') REGEXP_REPLACE('Hello World', ' +', ' ')
" "
"Functions (String)","REPEAT"," "Functions (String)","REPEAT","
REPEAT(string, int): string REPEAT(string, int)
"," ","
Returns a string repeated some number of times. Returns a string repeated some number of times.
"," ","
...@@ -2692,26 +2769,26 @@ REPEAT(NAME || ' ', 10) ...@@ -2692,26 +2769,26 @@ REPEAT(NAME || ' ', 10)
" "
"Functions (String)","REPLACE"," "Functions (String)","REPLACE","
REPLACE(string, searchString [, replacementString]): string REPLACE(string, searchString [, replacementString])
"," ","
Replaces all occurrences of a search string in a text with another string. If no Replaces all occurrences of a search string in a text with another string.
replacement is specified, the search string is just removed from the original If no replacement is specified, the search string is removed from the original string.
string.
"," ","
REPLACE(NAME, ' ') REPLACE(NAME, ' ')
" "
"Functions (String)","SOUNDEX"," "Functions (String)","SOUNDEX","
SOUNDEX(string): string SOUNDEX(string)
"," ","
Returns a four character code representing the sound of a string. See also Returns a four character code representing the sound of a string.
http://www.archives.gov/genealogy/census/soundex.html . See also http://www.archives.gov/genealogy/census/soundex.html .
This method returns a string.
"," ","
SOUNDEX(NAME) SOUNDEX(NAME)
" "
"Functions (String)","SPACE"," "Functions (String)","SPACE","
SPACE(int): string SPACE(int)
"," ","
Returns a string consisting of a number of spaces. Returns a string consisting of a number of spaces.
"," ","
...@@ -2719,43 +2796,46 @@ SPACE(80) ...@@ -2719,43 +2796,46 @@ SPACE(80)
" "
"Functions (String)","STRINGDECODE"," "Functions (String)","STRINGDECODE","
STRINGDECODE(string): string STRINGDECODE(string)
"," ","
Converts a encoded string using the Java string literal encoding format. Special Converts a encoded string using the Java string literal encoding format.
characters are \b, \t, \n, \f, \r, \"", \\, \<octal>, \u<unicode>. Special characters are \b, \t, \n, \f, \r, \"", \\, \<octal>, \u<unicode>.
This method returns a string.
"," ","
CALL STRINGENCODE(STRINGDECODE('Lines 1\nLine 2')) CALL STRINGENCODE(STRINGDECODE('Lines 1\nLine 2'))
" "
"Functions (String)","STRINGENCODE"," "Functions (String)","STRINGENCODE","
STRINGENCODE(string): string STRINGENCODE(string)
"," ","
Encodes special characters in a string using the Java string literal encoding Encodes special characters in a string using the Java string literal encoding format.
format. Special characters are \b, \t, \n, \f, \r, \"", \\, \<octal>, Special characters are \b, \t, \n, \f, \r, \"", \\, \<octal>, \u<unicode>.
\u<unicode>. This method returns a string.
"," ","
CALL STRINGENCODE(STRINGDECODE('Lines 1\nLine 2')) CALL STRINGENCODE(STRINGDECODE('Lines 1\nLine 2'))
" "
"Functions (String)","STRINGTOUTF8"," "Functions (String)","STRINGTOUTF8","
STRINGTOUTF8(string): bytes STRINGTOUTF8(string)
"," ","
Encodes a string to a byte array using the UTF8 encoding format. Encodes a string to a byte array using the UTF8 encoding format.
This method returns bytes.
"," ","
CALL UTF8TOSTRING(STRINGTOUTF8('This is a test')) CALL UTF8TOSTRING(STRINGTOUTF8('This is a test'))
" "
"Functions (String)","SUBSTRING"," "Functions (String)","SUBSTRING","
{ SUBSTRING | SUBSTR } ( string, startInt [, lengthInt ] ): string { SUBSTRING | SUBSTR } ( string, startInt [, lengthInt ] )
"," ","
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]).
"," ","
SUBSTR(NAME, 1) SUBSTR(NAME, 1)
" "
"Functions (String)","UTF8TOSTRING"," "Functions (String)","UTF8TOSTRING","
UTF8TOSTRING(bytes): string UTF8TOSTRING(bytes)
"," ","
Decodes a byte array in the UTF8 format to a string. Decodes a byte array in the UTF8 format to a string.
"," ","
...@@ -2763,41 +2843,46 @@ CALL UTF8TOSTRING(STRINGTOUTF8('This is a test')) ...@@ -2763,41 +2843,46 @@ CALL UTF8TOSTRING(STRINGTOUTF8('This is a test'))
" "
"Functions (String)","XMLATTR"," "Functions (String)","XMLATTR","
XMLATTR(nameString, valueString): string XMLATTR(nameString, valueString)
"," ","
Creates an XML attribute element of the form name=""value"". The value is Creates an XML attribute element of the form name=""value"".
encoded as XML text. The value is encoded as XML text.
This method returns a string.
"," ","
CALL XMLNODE('a', XMLATTR('href', 'http://h2database.com')) CALL XMLNODE('a', XMLATTR('href', 'http://h2database.com'))
" "
"Functions (String)","XMLNODE"," "Functions (String)","XMLNODE","
XMLNODE(elementString [, attributesString [, contentString]]): string XMLNODE(elementString [, attributesString [, contentString]])
"," ","
Create an XML node element. Create an XML node element.
This method returns a string.
"," ","
CALL XMLNODE('a', XMLATTR('href', 'http://h2database.com'), 'H2') CALL XMLNODE('a', XMLATTR('href', 'http://h2database.com'), 'H2')
" "
"Functions (String)","XMLCOMMENT"," "Functions (String)","XMLCOMMENT","
XMLCOMMENT(commentString): string XMLCOMMENT(commentString)
"," ","
Creates an XML comment. Two dashes (--) are converted to - -. Creates an XML comment.
Two dashes (--) are converted to - -.
This method returns a string.
"," ","
CALL XMLCOMMENT('Test') CALL XMLCOMMENT('Test')
" "
"Functions (String)","XMLCDATA"," "Functions (String)","XMLCDATA","
XMLCDATA(valueString): string XMLCDATA(valueString)
"," ","
Creates an XML CDATA element. If the value contains ']]>', an XML text element Creates an XML CDATA element.
is created instead. If the value contains ']]>', an XML text element is created instead.
This method returns a string.
"," ","
CALL XMLCDATA('data') CALL XMLCDATA('data')
" "
"Functions (String)","XMLSTARTDOC"," "Functions (String)","XMLSTARTDOC","
XMLSTARTDOC(): string XMLSTARTDOC()
"," ","
The string '<?xml version=""1.0""?>' is returned. The string '<?xml version=""1.0""?>' is returned.
"," ","
...@@ -2805,15 +2890,16 @@ CALL XMLSTARTDOC() ...@@ -2805,15 +2890,16 @@ CALL XMLSTARTDOC()
" "
"Functions (String)","XMLTEXT"," "Functions (String)","XMLTEXT","
XMLTEXT(valueString): string XMLTEXT(valueString)
"," ","
Creates an XML text element. Creates an XML text element.
This method returns a string.
"," ","
CALL XMLTEXT('test') 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 }
"," ","
Returns the current date. Returns the current date.
"," ","
...@@ -2821,7 +2907,7 @@ CURRENT_DATE() ...@@ -2821,7 +2907,7 @@ CURRENT_DATE()
" "
"Functions (Time and Date)","CURRENT_TIME"," "Functions (Time and Date)","CURRENT_TIME","
{ CURRENT_TIME [ () ] | CURTIME() }: time { CURRENT_TIME [ () ] | CURTIME() }
"," ","
Returns the current time. Returns the current time.
"," ","
...@@ -2829,34 +2915,38 @@ CURRENT_TIME() ...@@ -2829,34 +2915,38 @@ 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 ] ) }
"," ","
Returns the current timestamp. The precision parameter for nanoseconds precision Returns the current timestamp.
is optional. The precision parameter for nanoseconds precision is optional.
"," ","
CURRENT_TIMESTAMP() CURRENT_TIMESTAMP()
" "
"Functions (Time and Date)","DATEADD"," "Functions (Time and Date)","DATEADD","
DATEADD(unitString, addInt, timestamp): timestamp DATEADD(unitString, addInt, timestamp)
"," ","
Adds units to a timestamp. The string indicates the unit. Use negative values to Adds units to a timestamp. The string indicates the unit.
subtract units. The same units as in the EXTRACT function are supported. Use negative values to subtract units.
The same units as in the EXTRACT function are supported.
This method returns a timestamp.
"," ","
DATEADD('MONTH', 1, DATE '2001-01-31') DATEADD('MONTH', 1, DATE '2001-01-31')
" "
"Functions (Time and Date)","DATEDIFF"," "Functions (Time and Date)","DATEDIFF","
DATEDIFF(unitString, aTimestamp, bTimestamp): long DATEDIFF(unitString, aTimestamp, bTimestamp)
"," ","
Returns the difference between two timestamps. The string indicates the unit. Returns the difference between two timestamps.
This method returns a long.
The string indicates the unit.
The same units as in the EXTRACT function are supported. The same units as in the EXTRACT function are supported.
"," ","
DATEDIFF('YEAR', T1.CREATED, T2.CREATED) DATEDIFF('YEAR', T1.CREATED, T2.CREATED)
" "
"Functions (Time and Date)","DAYNAME"," "Functions (Time and Date)","DAYNAME","
DAYNAME(date): string DAYNAME(date)
"," ","
Returns the name of the day (in English). Returns the name of the day (in English).
"," ","
...@@ -2864,7 +2954,7 @@ DAYNAME(CREATED) ...@@ -2864,7 +2954,7 @@ DAYNAME(CREATED)
" "
"Functions (Time and Date)","DAY_OF_MONTH"," "Functions (Time and Date)","DAY_OF_MONTH","
DAY_OF_MONTH(date): int DAY_OF_MONTH(date)
"," ","
Returns the day of the month (1-31). Returns the day of the month (1-31).
"," ","
...@@ -2872,7 +2962,7 @@ DAY_OF_MONTH(CREATED) ...@@ -2872,7 +2962,7 @@ DAY_OF_MONTH(CREATED)
" "
"Functions (Time and Date)","DAY_OF_WEEK"," "Functions (Time and Date)","DAY_OF_WEEK","
DAY_OF_WEEK(date): int DAY_OF_WEEK(date)
"," ","
Returns the day of the week (1 means Sunday). Returns the day of the week (1 means Sunday).
"," ","
...@@ -2880,7 +2970,7 @@ DAY_OF_WEEK(CREATED) ...@@ -2880,7 +2970,7 @@ DAY_OF_WEEK(CREATED)
" "
"Functions (Time and Date)","DAY_OF_YEAR"," "Functions (Time and Date)","DAY_OF_YEAR","
DAY_OF_YEAR(date): int DAY_OF_YEAR(date)
"," ","
Returns the day of the year (1-366). Returns the day of the year (1-366).
"," ","
...@@ -2890,27 +2980,30 @@ DAY_OF_YEAR(CREATED) ...@@ -2890,27 +2980,30 @@ DAY_OF_YEAR(CREATED)
"Functions (Time and Date)","EXTRACT"," "Functions (Time and Date)","EXTRACT","
EXTRACT ( { YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR EXTRACT ( { YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR
| DOY | HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS } | DOY | HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS }
FROM timestamp ): int FROM timestamp )
"," ","
Returns a specific value from a timestamps. Returns a specific value from a timestamps.
This method returns an int.
"," ","
EXTRACT(SECOND FROM CURRENT_TIMESTAMP) EXTRACT(SECOND FROM CURRENT_TIMESTAMP)
" "
"Functions (Time and Date)","FORMATDATETIME"," "Functions (Time and Date)","FORMATDATETIME","
FORMATDATETIME ( timestamp, formatString FORMATDATETIME ( timestamp, formatString
[ , localeString [ , timeZoneString ] ] ): string [ , localeString [ , timeZoneString ] ] )
"," ","
Formats a date, time or timestamp as a string. The most important format Formats a date, time or timestamp as a string.
characters are: y year, M month, d day, H hour, m minute, s second For details The most important format characters are:
of the format, see java.text.SimpleDateFormat. y year, M month, d day, H hour, m minute, s second.
For details of the format, see java.text.SimpleDateFormat.
This method returns a string.
"," ","
CALL FORMATDATETIME(TIMESTAMP '2001-02-03 04:05:06', CALL FORMATDATETIME(TIMESTAMP '2001-02-03 04:05:06',
'EEE, d MMM yyyy HH:mm:ss z', 'en', 'GMT') 'EEE, d MMM yyyy HH:mm:ss z', 'en', 'GMT')
" "
"Functions (Time and Date)","HOUR"," "Functions (Time and Date)","HOUR","
HOUR(timestamp): int HOUR(timestamp)
"," ","
Returns the hour (0-23) from a timestamp. Returns the hour (0-23) from a timestamp.
"," ","
...@@ -2918,7 +3011,7 @@ HOUR(CREATED) ...@@ -2918,7 +3011,7 @@ HOUR(CREATED)
" "
"Functions (Time and Date)","MINUTE"," "Functions (Time and Date)","MINUTE","
MINUTE(timestamp): int MINUTE(timestamp)
"," ","
Returns the minute (0-59) from a timestamp. Returns the minute (0-59) from a timestamp.
"," ","
...@@ -2926,7 +3019,7 @@ MINUTE(CREATED) ...@@ -2926,7 +3019,7 @@ MINUTE(CREATED)
" "
"Functions (Time and Date)","MONTH"," "Functions (Time and Date)","MONTH","
MONTH(timestamp): int MONTH(timestamp)
"," ","
Returns the month (1-12) from a timestamp. Returns the month (1-12) from a timestamp.
"," ","
...@@ -2934,7 +3027,7 @@ MONTH(CREATED) ...@@ -2934,7 +3027,7 @@ MONTH(CREATED)
" "
"Functions (Time and Date)","MONTHNAME"," "Functions (Time and Date)","MONTHNAME","
MONTHNAME(date): string MONTHNAME(date)
"," ","
Returns the name of the month (in English). Returns the name of the month (in English).
"," ","
...@@ -2943,18 +3036,19 @@ MONTHNAME(CREATED) ...@@ -2943,18 +3036,19 @@ MONTHNAME(CREATED)
"Functions (Time and Date)","PARSEDATETIME"," "Functions (Time and Date)","PARSEDATETIME","
PARSEDATETIME(string, formatString PARSEDATETIME(string, formatString
[, localeString [, timeZoneString]]): string [, localeString [, timeZoneString]])
"," ","
Parses a string and returns a timestamp. The most important format characters Parses a string and returns a timestamp.
are: y year, M month, d day, H hour, m minute, s second For details of the The most important format characters are:
format, see java.text.SimpleDateFormat. y year, M month, d day, H hour, m minute, s second.
For details of the format, see java.text.SimpleDateFormat.
"," ","
CALL PARSEDATETIME('Sat, 3 Feb 2001 03:05:06 GMT', CALL PARSEDATETIME('Sat, 3 Feb 2001 03:05:06 GMT',
'EEE, d MMM yyyy HH:mm:ss z', 'en', 'GMT') 'EEE, d MMM yyyy HH:mm:ss z', 'en', 'GMT')
" "
"Functions (Time and Date)","QUARTER"," "Functions (Time and Date)","QUARTER","
QUARTER(timestamp): int QUARTER(timestamp)
"," ","
Returns the quarter (1-4) from a timestamp. Returns the quarter (1-4) from a timestamp.
"," ","
...@@ -2962,7 +3056,7 @@ QUARTER(CREATED) ...@@ -2962,7 +3056,7 @@ QUARTER(CREATED)
" "
"Functions (Time and Date)","SECOND"," "Functions (Time and Date)","SECOND","
SECOND(timestamp): int SECOND(timestamp)
"," ","
Returns the second (0-59) from a timestamp. Returns the second (0-59) from a timestamp.
"," ","
...@@ -2970,16 +3064,16 @@ SECOND(CREATED) ...@@ -2970,16 +3064,16 @@ SECOND(CREATED)
" "
"Functions (Time and Date)","WEEK"," "Functions (Time and Date)","WEEK","
WEEK(timestamp): int WEEK(timestamp)
"," ","
Returns the week (1-53) from a timestamp. This method uses the current system Returns the week (1-53) from a timestamp.
locale. This method uses the current system locale.
"," ","
WEEK(CREATED) WEEK(CREATED)
" "
"Functions (Time and Date)","YEAR"," "Functions (Time and Date)","YEAR","
YEAR(timestamp): int YEAR(timestamp)
"," ","
Returns the year from a timestamp. Returns the year from a timestamp.
"," ","
...@@ -2987,15 +3081,16 @@ YEAR(CREATED) ...@@ -2987,15 +3081,16 @@ YEAR(CREATED)
" "
"Functions (System)","ARRAY_GET"," "Functions (System)","ARRAY_GET","
ARRAY_GET(arrayExpression, indexExpression): varchar ARRAY_GET(arrayExpression, indexExpression)
"," ","
Returns one element of an array. Returns one element of an array.
This method returns a string.
"," ","
CALL ARRAY_GET(('Hello', 'World'), 2) CALL ARRAY_GET(('Hello', 'World'), 2)
" "
"Functions (System)","ARRAY_LENGTH"," "Functions (System)","ARRAY_LENGTH","
ARRAY_GET(arrayExpression): int ARRAY_GET(arrayExpression)
"," ","
Returns the length of an array. Returns the length of an array.
"," ","
...@@ -3003,7 +3098,7 @@ CALL ARRAY_LENGTH(('Hello', 'World')) ...@@ -3003,7 +3098,7 @@ CALL ARRAY_LENGTH(('Hello', 'World'))
" "
"Functions (System)","AUTOCOMMIT"," "Functions (System)","AUTOCOMMIT","
AUTOCOMMIT(): boolean AUTOCOMMIT()
"," ","
Returns true if auto commit is switched on for this session. Returns true if auto commit is switched on for this session.
"," ","
...@@ -3011,12 +3106,11 @@ AUTOCOMMIT() ...@@ -3011,12 +3106,11 @@ AUTOCOMMIT()
" "
"Functions (System)","CANCEL_SESSION"," "Functions (System)","CANCEL_SESSION","
CANCEL_SESSION(sessionInt): boolean CANCEL_SESSION(sessionInt)
"," ","
Cancels the currently executing statement of another session. The method only Cancels the currently executing statement of another session.
works if the multithreaded kernel is enabled (see SET MULTI_THREADED). Returns The method only works if the multithreaded kernel is enabled (see SET MULTI_THREADED).
true if the statement was canceled, false if the session is closed or no Returns true if the statement was canceled, false if the session is closed or no statement is currently executing.
statement is currently executing.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
...@@ -3024,15 +3118,16 @@ CANCEL_SESSION(3) ...@@ -3024,15 +3118,16 @@ CANCEL_SESSION(3)
" "
"Functions (System)","CASEWHEN Function"," "Functions (System)","CASEWHEN Function","
CASEWHEN(boolean, aValue, bValue): value CASEWHEN(boolean, aValue, bValue)
"," ","
Returns 'a' if the boolean expression is true, otherwise 'b'. Returns 'a' if the boolean expression is true, otherwise 'b'.
Returns the same data type as the parameter.
"," ","
CASEWHEN(ID=1, 'A', 'B') CASEWHEN(ID=1, 'A', 'B')
" "
"Functions (System)","CAST"," "Functions (System)","CAST","
CAST(value AS dataType): value CAST(value AS dataType)
"," ","
Converts a value to another data type. When converting a text to a number, the default Java conversion Converts a value to another data type. When converting a text to a number, the default Java conversion
rules are used (prefixes 0x or # for hexadecimal numbers, prefix 0 for octal numbers). rules are used (prefixes 0x or # for hexadecimal numbers, prefix 0 for octal numbers).
...@@ -3041,7 +3136,7 @@ CAST(NAME AS INT) ...@@ -3041,7 +3136,7 @@ CAST(NAME AS INT)
" "
"Functions (System)","COALESCE"," "Functions (System)","COALESCE","
COALESCE(aValue, bValue [,...]): value COALESCE(aValue, bValue [,...])
"," ","
Returns the first value that is not null. Returns the first value that is not null.
"," ","
...@@ -3049,7 +3144,7 @@ COALESCE(A, B, C) ...@@ -3049,7 +3144,7 @@ COALESCE(A, B, C)
" "
"Functions (System)","CONVERT"," "Functions (System)","CONVERT","
CONVERT(value, dataType): value CONVERT(value, dataType)
"," ","
Converts a value to another data type. Converts a value to another data type.
"," ","
...@@ -3057,21 +3152,22 @@ CONVERT(NAME, INT) ...@@ -3057,21 +3152,22 @@ CONVERT(NAME, INT)
" "
"Functions (System)","CURRVAL"," "Functions (System)","CURRVAL","
CURRVAL( [ schemaName, ] sequenceString ): long CURRVAL( [ schemaName, ] sequenceString )
"," ","
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.
the sequence was just created, the method returns (start - interval). If the If the sequence was just created, the method returns (start - interval).
schema name is not set, the current schema is used. If the schema name is not If the schema name is not set, the current schema is used.
set, the sequence name is converted to uppercase (for compatibility). If the schema name is not set, the sequence name is converted to uppercase (for compatibility).
This method returns a long.
"," ","
CURRVAL('TEST_SEQ') CURRVAL('TEST_SEQ')
" "
"Functions (System)","CSVREAD"," "Functions (System)","CSVREAD","
CSVREAD(fileNameString [, columnsString [, csvOptions ] ] ): resultSetValue CSVREAD(fileNameString [, columnsString [, csvOptions ] ] )
"," ","
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.
each parameter, NULL means the default value should be used. For each parameter, NULL means the default value should be used.
If the column names are specified (a list of column names separated with the If the column names are specified (a list of column names separated with the
fieldSeparator), those are used they are read from the file, otherwise fieldSeparator), those are used they are read from the file, otherwise
...@@ -3098,7 +3194,7 @@ SELECT ""Last Name"" FROM CSVREAD('address.csv'); ...@@ -3098,7 +3194,7 @@ SELECT ""Last Name"" FROM CSVREAD('address.csv');
" "
"Functions (System)","CSVWRITE"," "Functions (System)","CSVWRITE","
CSVWRITE ( fileNameString, queryString [, csvOptions [, lineSepString] ] ): int CSVWRITE ( fileNameString, queryString [, csvOptions [, lineSepString] ] )
"," ","
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
...@@ -3119,7 +3215,7 @@ CALL CSVWRITE('test2.csv', 'SELECT * FROM TEST', 'UTF-8', '|'); ...@@ -3119,7 +3215,7 @@ CALL CSVWRITE('test2.csv', 'SELECT * FROM TEST', 'UTF-8', '|');
" "
"Functions (System)","DATABASE"," "Functions (System)","DATABASE","
DATABASE(): string DATABASE()
"," ","
Returns the name of the database. Returns the name of the database.
"," ","
...@@ -3127,7 +3223,7 @@ CALL DATABASE(); ...@@ -3127,7 +3223,7 @@ CALL DATABASE();
" "
"Functions (System)","DATABASE_PATH"," "Functions (System)","DATABASE_PATH","
DATABASE_PATH(): string DATABASE_PATH()
"," ","
Returns the directory of the database files and the database name, if it is file Returns the directory of the database files and the database name, if it is file
based. Returns NULL otherwise. based. Returns NULL otherwise.
...@@ -3136,7 +3232,7 @@ CALL DATABASE_PATH(); ...@@ -3136,7 +3232,7 @@ CALL DATABASE_PATH();
" "
"Functions (System)","FILE_READ"," "Functions (System)","FILE_READ","
FILE_READ(fileNameString [,encodingString]): value FILE_READ(fileNameString [,encodingString])
"," ","
Returns the contents of a file. If only one parameter is supplied, the data are Returns the contents of a file. If only one parameter is supplied, the data are
returned as a BLOB. If two parameters are used, the data is returned as a CLOB returned as a BLOB. If two parameters are used, the data is returned as a CLOB
...@@ -3149,7 +3245,7 @@ SELECT FILE_READ('http://localhost:8182/stylesheet.css', NULL) CSS; ...@@ -3149,7 +3245,7 @@ SELECT FILE_READ('http://localhost:8182/stylesheet.css', NULL) CSS;
" "
"Functions (System)","GREATEST"," "Functions (System)","GREATEST","
GREATEST(aValue, bValue [,...]): value GREATEST(aValue, bValue [,...])
"," ","
Returns the largest value that is not NULL, or NULL if all values are NULL. Returns the largest value that is not NULL, or NULL if all values are NULL.
"," ","
...@@ -3157,15 +3253,16 @@ CALL GREATEST(1, 2, 3); ...@@ -3157,15 +3253,16 @@ CALL GREATEST(1, 2, 3);
" "
"Functions (System)","IDENTITY"," "Functions (System)","IDENTITY","
IDENTITY(): long IDENTITY()
"," ","
Returns the last inserted identity value for this session. Returns the last inserted identity value for this session.
This method returns a long.
"," ","
CALL IDENTITY(); CALL IDENTITY();
" "
"Functions (System)","IFNULL"," "Functions (System)","IFNULL","
IFNULL(aValue, bValue): value IFNULL(aValue, bValue)
"," ","
Returns the value of 'a' if it is not null, otherwise 'b'. Returns the value of 'a' if it is not null, otherwise 'b'.
"," ","
...@@ -3173,7 +3270,7 @@ CALL IFNULL(NULL, ''); ...@@ -3173,7 +3270,7 @@ CALL IFNULL(NULL, '');
" "
"Functions (System)","LEAST"," "Functions (System)","LEAST","
LEAST(aValue, bValue [,...]): value LEAST(aValue, bValue [,...])
"," ","
Returns the smallest value that is not NULL, or NULL if all values are NULL. Returns the smallest value that is not NULL, or NULL if all values are NULL.
"," ","
...@@ -3181,15 +3278,16 @@ CALL LEAST(1, 2, 3); ...@@ -3181,15 +3278,16 @@ CALL LEAST(1, 2, 3);
" "
"Functions (System)","LOCK_MODE"," "Functions (System)","LOCK_MODE","
LOCK_MODE(): int LOCK_MODE()
"," ","
Returns the current lock mode. See SET LOCK_MODE. Returns the current lock mode. See SET LOCK_MODE.
This method returns an int.
"," ","
CALL LOCK_MODE(); CALL LOCK_MODE();
" "
"Functions (System)","LOCK_TIMEOUT"," "Functions (System)","LOCK_TIMEOUT","
LOCK_TIMEOUT(): int LOCK_TIMEOUT()
"," ","
Returns the lock timeout of the current session (in milliseconds). Returns the lock timeout of the current session (in milliseconds).
"," ","
...@@ -3198,21 +3296,23 @@ LOCK_TIMEOUT() ...@@ -3198,21 +3296,23 @@ LOCK_TIMEOUT()
"Functions (System)","LINK_SCHEMA"," "Functions (System)","LINK_SCHEMA","
LINK_SCHEMA(targetSchemaString, driverString, urlString, LINK_SCHEMA(targetSchemaString, driverString, urlString,
userString, passwordString, sourceSchemaString): resultSetValue userString, passwordString, sourceSchemaString)
"," ","
Creates table links for all tables in a schema. If tables with the same name Creates table links for all tables in a schema.
already exist, they are dropped first. The target schema is created If tables with the same name already exist, they are dropped first.
automatically if it does not yet exist. The driver name may be empty if the The target schema is created automatically if it does not yet exist.
driver is already loaded. The list of tables linked is returned. The driver name may be empty if the driver is already loaded.
The list of tables linked is returned in the form of a result set.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
CALL LINK_SCHEMA('TEST2', '', 'jdbc:h2:test2', 'sa', 'sa', 'PUBLIC'); CALL LINK_SCHEMA('TEST2', '', 'jdbc:h2:test2', 'sa', 'sa', 'PUBLIC');
" "
"Functions (System)","MEMORY_FREE"," "Functions (System)","MEMORY_FREE","
MEMORY_FREE(): int MEMORY_FREE()
"," ","
Returns the free memory in KB (where 1024 bytes is a KB). Returns the free memory in KB (where 1024 bytes is a KB).
This method returns an int.
The garbage is run before returning the value. The garbage is run before returning the value.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
...@@ -3220,9 +3320,10 @@ MEMORY_FREE() ...@@ -3220,9 +3320,10 @@ MEMORY_FREE()
" "
"Functions (System)","MEMORY_USED"," "Functions (System)","MEMORY_USED","
MEMORY_USED(): int MEMORY_USED()
"," ","
Returns the used memory in KB (where 1024 bytes is a KB). Returns the used memory in KB (where 1024 bytes is a KB).
This method returns an int.
The garbage is run before returning the value. The garbage is run before returning the value.
Admin rights are required to execute this command. Admin rights are required to execute this command.
"," ","
...@@ -3230,18 +3331,18 @@ MEMORY_USED() ...@@ -3230,18 +3331,18 @@ MEMORY_USED()
" "
"Functions (System)","NEXTVAL"," "Functions (System)","NEXTVAL","
NEXTVAL ( [ schemaName, ] sequenceString ): long NEXTVAL ( [ schemaName, ] sequenceString )
"," ","
Returns the next value of the sequence. Used values are never re-used, even when Returns the next value of the sequence.
the transaction is rolled back. If the schema name is not set, the current Used values are never re-used, even when the transaction is rolled back.
schema is used, and the sequence name is converted to uppercase (for If the schema name is not set, the current schema is used, and the sequence name is converted to uppercase (for compatibility).
compatibility). This method returns a long.
"," ","
NEXTVAL('TEST_SEQ') NEXTVAL('TEST_SEQ')
" "
"Functions (System)","NULLIF"," "Functions (System)","NULLIF","
NULLIF(aValue, bValue): value NULLIF(aValue, bValue)
"," ","
Returns NULL if 'a' is equals to 'b', otherwise 'a'. Returns NULL if 'a' is equals to 'b', otherwise 'a'.
"," ","
...@@ -3249,7 +3350,7 @@ NULLIF(A, B) ...@@ -3249,7 +3350,7 @@ NULLIF(A, B)
" "
"Functions (System)","READONLY"," "Functions (System)","READONLY","
READONLY(): boolean READONLY()
"," ","
Returns true if the database is read-only. Returns true if the database is read-only.
"," ","
...@@ -3257,11 +3358,12 @@ READONLY() ...@@ -3257,11 +3358,12 @@ READONLY()
" "
"Functions (System)","ROWNUM"," "Functions (System)","ROWNUM","
ROWNUM(): int ROWNUM()
"," ","
Returns the number of the current row. This function is supported for SELECT Returns the number of the current row.
statements, as well as for DELETE and UPDATE. The first row has the row number This method returns an int.
1, and is calculated before ordering and grouping the result set. This function is supported for SELECT statements, as well as for DELETE and UPDATE.
The first row has the row number 1, and is calculated before ordering and grouping the result set.
To get the row number after ordering and grouping, use a subquery. To get the row number after ordering and grouping, use a subquery.
"," ","
SELECT ROWNUM(), * FROM TEST; SELECT ROWNUM(), * FROM TEST;
...@@ -3269,7 +3371,7 @@ SELECT ROWNUM(), * FROM (SELECT * FROM TEST ORDER BY NAME); ...@@ -3269,7 +3371,7 @@ SELECT ROWNUM(), * FROM (SELECT * FROM TEST ORDER BY NAME);
" "
"Functions (System)","SCHEMA"," "Functions (System)","SCHEMA","
SCHEMA(): string SCHEMA()
"," ","
Returns the name of the default schema for this session. Returns the name of the default schema for this session.
"," ","
...@@ -3277,26 +3379,28 @@ CALL SCHEMA() ...@@ -3277,26 +3379,28 @@ CALL SCHEMA()
" "
"Functions (System)","SESSION_ID"," "Functions (System)","SESSION_ID","
SESSION_ID(): int SESSION_ID()
"," ","
Returns the unique session id number for the current database connection. This Returns the unique session id number for the current database connection.
id stays the same while the connection is open. The database engine may re-use a This id stays the same while the connection is open.
session id after the connection is closed. This method returns an int.
The database engine may re-use a session id after the connection is closed.
"," ","
CALL SESSION_ID() CALL SESSION_ID()
" "
"Functions (System)","SET"," "Functions (System)","SET","
SET(@variableName, value): value SET(@variableName, value)
"," ","
Updates a variable with the given value. The new value is returned. When used in Updates a variable with the given value.
a query, the value is updated in the order the rows are read. The new value is returned.
When used in a query, the value is updated in the order the rows are read.
"," ","
SELECT X, SET(@I, IFNULL(@I, 0)+X) RUNNING_TOTAL FROM SYSTEM_RANGE(1, 10) 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 } [,...] ): resultSetValue { TABLE | TABLE_DISTINCT } ( { name dataType = expression } [,...] )
"," ","
Returns the result set. TABLE_DISTINCT removes duplicate rows. Returns the result set. TABLE_DISTINCT removes duplicate rows.
"," ","
...@@ -3304,19 +3408,20 @@ SELECT * FROM TABLE(ID INT=(1, 2), NAME VARCHAR=('Hello', 'World')) ...@@ -3304,19 +3408,20 @@ SELECT * FROM TABLE(ID INT=(1, 2), NAME VARCHAR=('Hello', 'World'))
" "
"Functions (System)","TRANSACTION_ID"," "Functions (System)","TRANSACTION_ID","
TRANSACTION_ID(): string TRANSACTION_ID()
"," ","
Returns the current transaction id for this session. This method returns NULL if Returns the current transaction id for this session.
there is no uncommitted change, or if the the database is not persisted. This method returns NULL if there is no uncommitted change, or if the the database is not persisted.
Otherwise a value of the following form is returned: Otherwise a value of the following form is returned:
logFileId-position-sessionId. The value is unique across database restarts logFileId-position-sessionId.
(values are not re-used). This method returns a string.
The value is unique across database restarts (values are not re-used).
"," ","
CALL TRANSACTION_ID() CALL TRANSACTION_ID()
" "
"Functions (System)","USER"," "Functions (System)","USER","
{ USER | CURRENT_USER } (): string { USER | CURRENT_USER } ()
"," ","
Returns the name of the current user of this session. Returns the name of the current user of this session.
"," ","
......
...@@ -33,7 +33,7 @@ ${item.syntax} ...@@ -33,7 +33,7 @@ ${item.syntax}
</pre> </pre>
syntax-end --> syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <p>Example:</p>
<p class="notranslate">${item.example}</p> <p class="notranslate">${item.example}</p>
</c:forEach> </c:forEach>
......
...@@ -63,7 +63,7 @@ ${item.syntax} ...@@ -63,7 +63,7 @@ ${item.syntax}
</pre> </pre>
syntax-end --> syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <p>Example:</p>
<p class="notranslate">${item.example}</p> <p class="notranslate">${item.example}</p>
</c:forEach> </c:forEach>
......
...@@ -61,8 +61,9 @@ ${item.syntax} ...@@ -61,8 +61,9 @@ ${item.syntax}
</pre> </pre>
syntax-end --> syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <p>Example:</p>
<p class="notranslate">${item.example}</p> <p class="notranslate">
${item.example}</p>
</c:forEach> </c:forEach>
<c:forEach var="item" items="otherGrammar"> <c:forEach var="item" items="otherGrammar">
...@@ -76,7 +77,7 @@ ${item.syntax} ...@@ -76,7 +77,7 @@ ${item.syntax}
</pre> </pre>
syntax-end --> syntax-end -->
<p>${item.text}</p> <p>${item.text}</p>
<b>Example:</b> <p>Example:</p>
<p class="notranslate">${item.example}</p> <p class="notranslate">${item.example}</p>
</c:forEach> </c:forEach>
...@@ -100,6 +101,7 @@ The range table is a dynamic system table that contains all values from a start ...@@ -100,6 +101,7 @@ The range table is a dynamic system table that contains all values from a start
The table contains one column called X. Both the start and end values are included in the result. The table contains one column called X. Both the start and end values are included in the result.
The table is used as follows: The table is used as follows:
</p> </p>
<p>Example:</p>
<pre> <pre>
SELECT X FROM SYSTEM_RANGE(1, 10); SELECT X FROM SYSTEM_RANGE(1, 10);
</pre> </pre>
......
...@@ -20,7 +20,6 @@ H2 Database Engine ...@@ -20,7 +20,6 @@ H2 Database Engine
Welcome to H2, the free Java SQL database engine. Welcome to H2, the free Java SQL database engine.
</p> </p>
<br />
<p> <p>
<a href="quickstart.html" style="font-size: 16px; font-weight: bold">Quickstart</a> <a href="quickstart.html" style="font-size: 16px; font-weight: bold">Quickstart</a>
<br /> <br />
......
...@@ -32,7 +32,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are: ...@@ -32,7 +32,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<tr><td style="border: 0px; background-color: #eee;"> <tr><td style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 12px 7px;"> <table style="border: 0px; margin: 0px 7px 12px 7px;">
<tr><td style="border: 0px; background-color: #eee;" colspan="2"> <tr><td style="border: 0px; background-color: #eee;" colspan="2">
<h3>Download Beta</h3> <h3 style="margin-top: 1em;">Download Beta</h3>
Version ${version} (${versionDate}): Version ${version} (${versionDate}):
</td></tr> </td></tr>
<tr><td style="border: 0px; background-color: #eee;"> <tr><td style="border: 0px; background-color: #eee;">
...@@ -54,7 +54,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are: ...@@ -54,7 +54,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<td style="border: 0px; background-color: #eee;"> <td style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 12px 7px;"> <table style="border: 0px; margin: 0px 7px 12px 7px;">
<tr><td style="border: 0px; background-color: #eee;"> <tr><td style="border: 0px; background-color: #eee;">
<h3>Support</h3> <h3 style="margin-top: 1em;">Support</h3>
<p> <p>
<a href="http://groups.google.com/group/h2-database">English Google Group</a><br /> <a href="http://groups.google.com/group/h2-database">English Google Group</a><br />
<a href="http://groups.google.co.jp/group/h2-database-jp">Japanese Google Group</a><br /><br /> <a href="http://groups.google.co.jp/group/h2-database-jp">Japanese Google Group</a><br /><br />
...@@ -78,7 +78,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are: ...@@ -78,7 +78,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
</td></tr> </td></tr>
<tr><td colspan="3" style="border: 0px; padding: 5px 0px 15px 0px;"> <tr><td colspan="3" style="border: 0px; padding: 5px 0px 15px 0px;">
<h3>Features</h3> <h3 style="margin-top: 1em;">Features</h3>
<table style="width: 425px;"><tr class="notranslate"> <table style="width: 425px;"><tr class="notranslate">
<th></th> <th></th>
<th>H2</th> <th>H2</th>
...@@ -159,7 +159,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are: ...@@ -159,7 +159,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<tr><td colspan="3" style="border: 0px; background-color: #eee;"> <tr><td colspan="3" style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 0px 7px;"> <table style="border: 0px; margin: 0px 7px 0px 7px;">
<tr><td style="border: 0px; background-color: #eee;"> <tr><td style="border: 0px; background-color: #eee;">
<h3>News</h3> <h3 style="margin-top: 1em;">News</h3>
<p> <p>
<b>Newsfeeds:</b> <b>Newsfeeds:</b>
<a href="http://www.h2database.com/html/newsfeed-atom.xml">Full text (Atom)</a> <a href="http://www.h2database.com/html/newsfeed-atom.xml">Full text (Atom)</a>
...@@ -180,7 +180,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are: ...@@ -180,7 +180,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<tr><td colspan="3" style="border: 0px; background-color: #eee;"> <tr><td colspan="3" style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 5px 7px;"> <table style="border: 0px; margin: 0px 7px 5px 7px;">
<tr><td style="border: 0px; background-color: #eee;"> <tr><td style="border: 0px; background-color: #eee;">
<h3>Contribute</h3> <h3 style="margin-top: 1em;">Contribute</h3>
<p> <p>
You can contribute to the development of H2 by sending feedback and bug You can contribute to the development of H2 by sending feedback and bug
reports, or translate the H2 Console application (for details, start the H2 Console reports, or translate the H2 Console application (for details, start the H2 Console
......
...@@ -49,14 +49,17 @@ h1 { ...@@ -49,14 +49,17 @@ h1 {
h2 { h2 {
font-size: 13pt; font-size: 13pt;
margin-top: 1.5em;
} }
h3 { h3 {
font-size: 10pt; font-size: 11pt;
margin-top: 1.5em;
} }
h4 { h4 {
font-size: 9pt; font-size: 9pt;
margin-top: 1.5em;
} }
hr { hr {
...@@ -218,6 +221,7 @@ td.content { ...@@ -218,6 +221,7 @@ td.content {
border-collapse: collapse; border-collapse: collapse;
vertical-align: top; vertical-align: top;
} }
.c { .c {
padding: 1px 3px; padding: 1px 3px;
margin: 0px 0px; margin: 0px 0px;
...@@ -226,6 +230,7 @@ td.content { ...@@ -226,6 +230,7 @@ td.content {
border-radius: 0.4em; border-radius: 0.4em;
background-color: #fff; background-color: #fff;
} }
.ts { .ts {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
...@@ -236,6 +241,7 @@ td.content { ...@@ -236,6 +241,7 @@ td.content {
background-image: url(images/div-ts.png); background-image: url(images/div-ts.png);
width: 16px; width: 16px;
} }
.ls { .ls {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
...@@ -246,6 +252,7 @@ td.content { ...@@ -246,6 +252,7 @@ td.content {
background-image: url(images/div-ls.png); background-image: url(images/div-ls.png);
width: 16px; width: 16px;
} }
.ks { .ks {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
...@@ -256,6 +263,7 @@ td.content { ...@@ -256,6 +263,7 @@ td.content {
background-image: url(images/div-ks.png); background-image: url(images/div-ks.png);
width: 16px; width: 16px;
} }
.te { .te {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
...@@ -266,6 +274,7 @@ td.content { ...@@ -266,6 +274,7 @@ td.content {
background-image: url(images/div-te.png); background-image: url(images/div-te.png);
width: 16px; width: 16px;
} }
.le { .le {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
...@@ -276,6 +285,7 @@ td.content { ...@@ -276,6 +285,7 @@ td.content {
background-image: url(images/div-le.png); background-image: url(images/div-le.png);
width: 16px; width: 16px;
} }
.ke { .ke {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
...@@ -286,6 +296,7 @@ td.content { ...@@ -286,6 +296,7 @@ td.content {
background-image: url(images/div-ke.png); background-image: url(images/div-ke.png);
width: 16px; width: 16px;
} }
.d { .d {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
......
...@@ -43,14 +43,17 @@ h1 { ...@@ -43,14 +43,17 @@ h1 {
h2 { h2 {
font-size: 13pt; font-size: 13pt;
margin-top: 1.5em;
} }
h3 { h3 {
font-size: 10pt; font-size: 11pt;
margin-top: 1.5em;
} }
h4 { h4 {
font-size: 9pt; font-size: 9pt;
margin-top: 1.5em;
} }
hr { hr {
...@@ -128,89 +131,3 @@ em.u { ...@@ -128,89 +131,3 @@ em.u {
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;
}
...@@ -97,10 +97,6 @@ public class Bnf { ...@@ -97,10 +97,6 @@ public class Bnf {
String topic = rs.getString("TOPIC"); String topic = rs.getString("TOPIC");
syntax = rs.getString("SYNTAX").trim(); syntax = rs.getString("SYNTAX").trim();
currentTopic = section; currentTopic = section;
if (section.startsWith("Function")) {
int end = syntax.indexOf(':');
syntax = syntax.substring(0, end);
}
tokens = tokenize(); tokens = tokenize();
index = 0; index = 0;
Rule rule = parseRule(); Rule rule = parseRule();
......
...@@ -68,9 +68,9 @@ public class RuleFixed implements Rule { ...@@ -68,9 +68,9 @@ public class RuleFixed implements Rule {
case YMD: case YMD:
return "2000-01-01"; return "2000-01-01";
case HMS: case HMS:
return "12:00"; return "12:00:00";
case NANOS: case NANOS:
return "0"; return "000000000";
case ANY_UNTIL_EOL: case ANY_UNTIL_EOL:
case ANY_EXCEPT_SINGLE_QUOTE: case ANY_EXCEPT_SINGLE_QUOTE:
case ANY_EXCEPT_DOUBLE_QUOTE: case ANY_EXCEPT_DOUBLE_QUOTE:
......
...@@ -9,11 +9,12 @@ FROM tableExpression [,...] [ WHERE expression ] ...@@ -9,11 +9,12 @@ FROM tableExpression [,...] [ WHERE expression ]
[ GROUP BY expression [,...] ] [ HAVING expression ] [ GROUP BY expression [,...] ] [ HAVING expression ]
[ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } select ] [ ORDER BY order [,...] ] [ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } select ] [ ORDER BY order [,...] ]
[ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ] [ LIMIT expression [ OFFSET expression ] [ SAMPLE_SIZE rowCountInt ] ]
[ FOR UPDATE ]"," [ 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","
...@@ -40,14 +41,12 @@ Shows the execution plan for a statement." ...@@ -40,14 +41,12 @@ Shows the execution plan for a statement."
"Commands (DML)","MERGE"," "Commands (DML)","MERGE","
MERGE INTO tableName [ ( columnName [,...] ) ] MERGE INTO tableName [ ( columnName [,...] ) ]
[ KEY ( columnName [,...] ) ] [ KEY ( columnName [,...] ) ]
{ VALUES { ( [ { DEFAULT | expression } [,...] ] ) } [,...] | select } { 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 ] [ CHARSET charsetString ]
[ CIPHER cipher PASSWORD string ]
[ CHARSET charsetString ]
"," ","
Runs a SQL script from a file." Runs a SQL script from a file."
"Commands (DML)","SCRIPT"," "Commands (DML)","SCRIPT","
...@@ -200,8 +199,8 @@ Creates a new sequence." ...@@ -200,8 +199,8 @@ 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 ] TABLE [ IF NOT EXISTS ]
name { ( { columnDefinition | constraint } [,...] ) [ AS select ] } name { { ( { columnDefinition | constraint } [,...] ) [ AS select ] }
| { AS select } [ NOT PERSISTENT ] | { AS select } } [ NOT PERSISTENT ]
"," ","
Creates a new table." Creates a new table."
"Commands (DDL)","CREATE TRIGGER"," "Commands (DDL)","CREATE TRIGGER","
...@@ -312,8 +311,8 @@ PREPARE COMMIT newTransactionName ...@@ -312,8 +311,8 @@ 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 } [,...] ON tableName REVOKE { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
[,...] FROM { PUBLIC | userName | roleName } tableName [,...] 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","
...@@ -524,11 +523,11 @@ columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT ...@@ -524,11 +523,11 @@ columnName dataType { DEFAULT expression | AS computedColumnExpression } [ [ NOT
"," ","
Default expressions are used if no explicit value was used when adding a row." Default expressions are used if no explicit value was used when adding a row."
"Other Grammar","Expression"," "Other Grammar","Expression","
andCondition [ OR andCondition ] andCondition [ { OR andCondition } [...] ]
"," ","
Value or condition." Value or condition."
"Other Grammar","And Condition"," "Other Grammar","And Condition","
condition [ AND condition ] condition [ { AND condition } [...] ]
"," ","
Value or condition." Value or condition."
"Other Grammar","Condition"," "Other Grammar","Condition","
...@@ -549,15 +548,15 @@ The right hand side of a condition." ...@@ -549,15 +548,15 @@ 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","
...@@ -629,11 +628,11 @@ $$anythingExceptTwoDollarSigns$$ ...@@ -629,11 +628,11 @@ $$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 [...] [ + | - ] number
"," ","
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 [...] [ + | - ] number
"," ","
Long numbers are between -9223372036854775808 and 9223372036854775807." Long numbers are between -9223372036854775808 and 9223372036854775807."
"Other Grammar","Hex Number"," "Other Grammar","Hex Number","
...@@ -641,14 +640,17 @@ Long numbers are between -9223372036854775808 and 9223372036854775807." ...@@ -641,14 +640,17 @@ Long numbers are between -9223372036854775808 and 9223372036854775807."
"," ","
A number written in hexadecimal notation." A number written in hexadecimal notation."
"Other Grammar","Decimal"," "Other Grammar","Decimal","
[ - | + ] digit [...] [ . digit [...] ] [ + | - ] number [ . number ]
"," ","
Number with fixed precision and scale." Number with fixed precision and scale."
"Other Grammar","Double"," "Other Grammar","Double","
[ - | + ] digit [...] [ + | - ] { { number [ . number ] } | { . number } } [ E [ + | - ] expNumber [...] ] ]
[ . 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","Number","
digit [...]
","
The maximum length of the number depends on the data type used."
"Other Grammar","Date"," "Other Grammar","Date","
DATE 'yyyy-MM-dd' DATE 'yyyy-MM-dd'
"," ","
...@@ -772,575 +774,571 @@ ARRAY ...@@ -772,575 +774,571 @@ 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 } )
"," ","
The average (mean) value." The average (mean) value."
"Functions (Aggregate)","BOOL_AND"," "Functions (Aggregate)","BOOL_AND","
BOOL_AND(boolean): boolean BOOL_AND(boolean)
"," ","
Returns true if all expressions are true." Returns true if all expressions are true."
"Functions (Aggregate)","BOOL_OR"," "Functions (Aggregate)","BOOL_OR","
BOOL_OR(boolean): boolean BOOL_OR(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( { * | { [ DISTINCT ] expression } } )
"," ","
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 GROUP_CONCAT ( [ DISTINCT ] string
[ ORDER BY { expression [ ASC | DESC ] } [,...] ] [ ORDER BY { expression [ ASC | DESC ] } [,...] ]
[ SEPARATOR expression ] ): string [ SEPARATOR expression ] )
"," ","
Concatenates strings with a separator." Concatenates strings with a separator."
"Functions (Aggregate)","MAX"," "Functions (Aggregate)","MAX","
MAX(value): value MAX(value)
"," ","
The highest value." The highest value."
"Functions (Aggregate)","MIN"," "Functions (Aggregate)","MIN","
MIN(value): value MIN(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 } )
"," ","
The sum of all values." The sum of all values."
"Functions (Aggregate)","SELECTIVITY"," "Functions (Aggregate)","SELECTIVITY","
SELECTIVITY(value): int SELECTIVITY(value)
"," ","
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 )
"," ","
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 )
"," ","
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 )
"," ","
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 )
"," ","
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 } )
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","ACOS"," "Functions (Numeric)","ACOS","
ACOS(double): double ACOS(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","ASIN"," "Functions (Numeric)","ASIN","
ASIN(double): double ASIN(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","ATAN"," "Functions (Numeric)","ATAN","
ATAN(double): double ATAN(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","COS"," "Functions (Numeric)","COS","
COS(double): double COS(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","COT"," "Functions (Numeric)","COT","
COT(double): double COT(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","SIN"," "Functions (Numeric)","SIN","
SIN(double): double SIN(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","TAN"," "Functions (Numeric)","TAN","
TAN(double): double TAN(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","ATAN2"," "Functions (Numeric)","ATAN2","
ATAN2(double, double): double ATAN2(double, double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","BITAND"," "Functions (Numeric)","BITAND","
BITAND(long, long): long BITAND(long, long)
"," ","
See also Java operator &." The bitwise AND operation."
"Functions (Numeric)","BITOR"," "Functions (Numeric)","BITOR","
BITOR(long, long): long BITOR(long, long)
"," ","
See also Java operator |." The bitwise OR operation."
"Functions (Numeric)","BITXOR"," "Functions (Numeric)","BITXOR","
BITXOR(long, long): long BITXOR(long, long)
"," ","
See also Java operator ^." The bitwise XOR operation."
"Functions (Numeric)","MOD"," "Functions (Numeric)","MOD","
MOD(long, long): long MOD(long, long)
"," ","
See also Java operator %." The modulo operation."
"Functions (Numeric)","CEILING"," "Functions (Numeric)","CEILING","
CEILING(double): double CEILING(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","DEGREES"," "Functions (Numeric)","DEGREES","
DEGREES(double): double DEGREES(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","EXP"," "Functions (Numeric)","EXP","
EXP(double): double EXP(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","FLOOR"," "Functions (Numeric)","FLOOR","
FLOOR(double): double FLOOR(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","LOG"," "Functions (Numeric)","LOG","
LOG(double): double LOG(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","LOG10"," "Functions (Numeric)","LOG10","
LOG10(double): double LOG10(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","RADIANS"," "Functions (Numeric)","RADIANS","
RADIANS(double): double RADIANS(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","SQRT"," "Functions (Numeric)","SQRT","
SQRT(double): double SQRT(double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","PI"," "Functions (Numeric)","PI","
PI(): double PI()
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","POWER"," "Functions (Numeric)","POWER","
POWER(double, double): double POWER(double, double)
"," ","
See also Java Math." See also Java Math."
"Functions (Numeric)","RAND"," "Functions (Numeric)","RAND","
RAND( [ int ] ): double RAND( [ int ] )
"," ","
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","
RANDOM_UUID(): UUID RANDOM_UUID()
"," ","
Returns a new UUID with 122 pseudo random bits." Returns a new UUID with 122 pseudo random bits."
"Functions (Numeric)","ROUND"," "Functions (Numeric)","ROUND","
ROUND(double, digitsInt): double ROUND(double, digitsInt)
"," ","
Rounds to a number of digits." Rounds to a number of digits."
"Functions (Numeric)","ROUNDMAGIC"," "Functions (Numeric)","ROUNDMAGIC","
ROUNDMAGIC(double): double ROUNDMAGIC(double)
"," ","
This function rounds numbers in a good way, but it is slow." This function rounds numbers in a good way, but it is slow."
"Functions (Numeric)","SECURE_RAND"," "Functions (Numeric)","SECURE_RAND","
SECURE_RAND(int): bytes SECURE_RAND(int)
"," ","
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 } )
"," ","
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","
ENCRYPT(algorithmString, keyBytes, dataBytes): bytes ENCRYPT(algorithmString, keyBytes, dataBytes)
"," ","
Encrypts data using a key." Encrypts data using a key."
"Functions (Numeric)","DECRYPT"," "Functions (Numeric)","DECRYPT","
DECRYPT(algorithmString, keyBytes, dataBytes): bytes DECRYPT(algorithmString, keyBytes, dataBytes)
"," ","
Decrypts data using a key." Decrypts data using a key."
"Functions (Numeric)","HASH"," "Functions (Numeric)","HASH","
HASH(algorithmString, dataBytes, iterationInt): bytes HASH(algorithmString, dataBytes, iterationInt)
"," ","
Calculate the hash value using an algorithm, and repeat this process for a Calculate the hash value using an algorithm, and repeat this process for a number of iterations."
number of iterations."
"Functions (Numeric)","TRUNCATE"," "Functions (Numeric)","TRUNCATE","
TRUNCATE(double, digitsInt): double TRUNCATE(double, digitsInt)
"," ","
Truncates to a number of digits (to the next value closer to 0)." Truncates to a number of digits (to the next value closer to 0)."
"Functions (Numeric)","COMPRESS"," "Functions (Numeric)","COMPRESS","
COMPRESS(dataBytes [, algorithmString]): bytes COMPRESS(dataBytes [, algorithmString])
"," ","
Compresses the data using the specified compression algorithm." Compresses the data using the specified compression algorithm."
"Functions (Numeric)","EXPAND"," "Functions (Numeric)","EXPAND","
EXPAND(bytes): bytes EXPAND(bytes)
"," ","
Expands data that was compressed using the COMPRESS function." Expands data that was compressed using the COMPRESS function."
"Functions (Numeric)","ZERO"," "Functions (Numeric)","ZERO","
ZERO(): int ZERO()
"," ","
Returns the value 0." Returns the value 0."
"Functions (String)","ASCII"," "Functions (String)","ASCII","
ASCII(string): int ASCII(string)
"," ","
Returns the ASCII value of the first character in the string." Returns the ASCII value of the first character in the string."
"Functions (String)","BIT_LENGTH"," "Functions (String)","BIT_LENGTH","
BIT_LENGTH(string): long BIT_LENGTH(string)
"," ","
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 )
"," ","
Returns the number of characters in a string." Returns the number of characters in a string."
"Functions (String)","OCTET_LENGTH"," "Functions (String)","OCTET_LENGTH","
OCTET_LENGTH(string): long OCTET_LENGTH(string)
"," ","
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 )
"," ","
Returns the character that represents the ASCII value." Returns the character that represents the ASCII value."
"Functions (String)","CONCAT"," "Functions (String)","CONCAT","
CONCAT(string, string [,...]): string CONCAT(string, string [,...])
"," ","
Combines strings." Combines strings."
"Functions (String)","DIFFERENCE"," "Functions (String)","DIFFERENCE","
DIFFERENCE(string, string): int DIFFERENCE(string, string)
"," ","
Returns the difference between the sounds of two strings." Returns the difference between the sounds of two strings."
"Functions (String)","HEXTORAW"," "Functions (String)","HEXTORAW","
HEXTORAW(string): string HEXTORAW(string)
"," ","
Converts a hex representation of a string to a string." Converts a hex representation of a string to a string."
"Functions (String)","RAWTOHEX"," "Functions (String)","RAWTOHEX","
RAWTOHEX(string): string RAWTOHEX(string)
"," ","
Converts a string to the hex representation." Converts a string to the hex representation."
"Functions (String)","INSTR"," "Functions (String)","INSTR","
INSTR(string, searchString, [, startInt]): int INSTR(string, searchString, [, startInt])
"," ","
Returns the location of a search string in a string (s)." Returns the location of a search string in a string (s)."
"Functions (String)","INSERT Function"," "Functions (String)","INSERT Function","
INSERT(originalString, startInt, lengthInt, addString): string INSERT(originalString, startInt, lengthInt, addString)
"," ","
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 )
"," ","
Converts a string to lowercase." Converts a string to lowercase."
"Functions (String)","UPPER"," "Functions (String)","UPPER","
{ UPPER | UCASE } ( string ): string { UPPER | UCASE } ( string )
"," ","
Converts a string to uppercase." Converts a string to uppercase."
"Functions (String)","LEFT"," "Functions (String)","LEFT","
LEFT(string, int): string LEFT(string, int)
"," ","
Returns the leftmost number of characters." Returns the leftmost number of characters."
"Functions (String)","RIGHT"," "Functions (String)","RIGHT","
RIGHT(string, int): string RIGHT(string, int)
"," ","
Returns the rightmost number of characters." Returns the rightmost number of characters."
"Functions (String)","LOCATE"," "Functions (String)","LOCATE","
LOCATE(searchString, string [, startInt]): int LOCATE(searchString, string [, startInt])
"," ","
Returns the location of a search string in a string." Returns the location of a search string in a string."
"Functions (String)","POSITION"," "Functions (String)","POSITION","
POSITION(searchString, string): int POSITION(searchString, string)
"," ","
Returns the location of a search string in a string." Returns the location of a search string in a string."
"Functions (String)","LPAD"," "Functions (String)","LPAD","
LPAD(string, int[, paddingString]): string LPAD(string, int[, paddingString])
"," ","
Left pad the string to the specified length." Left pad the string to the specified length."
"Functions (String)","RPAD"," "Functions (String)","RPAD","
RPAD(string, int[, paddingString]): string RPAD(string, int[, paddingString])
"," ","
Right pad the string to the specified length." Right pad the string to the specified length."
"Functions (String)","LTRIM"," "Functions (String)","LTRIM","
LTRIM(string): string LTRIM(string)
"," ","
Removes all leading spaces from a string." Removes all leading spaces from a string."
"Functions (String)","RTRIM"," "Functions (String)","RTRIM","
RTRIM(string): string RTRIM(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 ] string ): string TRIM ( [ { LEADING | TRAILING | BOTH } [ string ] FROM ] 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."
"Functions (String)","REGEXP_REPLACE"," "Functions (String)","REGEXP_REPLACE","
REGEXP_REPLACE(inputString, regexString, replacementString): string REGEXP_REPLACE(inputString, regexString, replacementString)
"," ","
Replaces each substring that matches a regular expression." Replaces each substring that matches a regular expression."
"Functions (String)","REPEAT"," "Functions (String)","REPEAT","
REPEAT(string, int): string REPEAT(string, int)
"," ","
Returns a string repeated some number of times." Returns a string repeated some number of times."
"Functions (String)","REPLACE"," "Functions (String)","REPLACE","
REPLACE(string, searchString [, replacementString]): string REPLACE(string, searchString [, replacementString])
"," ","
Replaces all occurrences of a search string in a text with another string." Replaces all occurrences of a search string in a text with another string."
"Functions (String)","SOUNDEX"," "Functions (String)","SOUNDEX","
SOUNDEX(string): string SOUNDEX(string)
"," ","
Returns a four character code representing the sound of a string." Returns a four character code representing the sound of a string."
"Functions (String)","SPACE"," "Functions (String)","SPACE","
SPACE(int): string SPACE(int)
"," ","
Returns a string consisting of a number of spaces." Returns a string consisting of a number of spaces."
"Functions (String)","STRINGDECODE"," "Functions (String)","STRINGDECODE","
STRINGDECODE(string): string STRINGDECODE(string)
"," ","
Converts a encoded string using the Java string literal encoding format." Converts a encoded string using the Java string literal encoding format."
"Functions (String)","STRINGENCODE"," "Functions (String)","STRINGENCODE","
STRINGENCODE(string): string STRINGENCODE(string)
"," ","
Encodes special characters in a string using the Java string literal encoding Encodes special characters in a string using the Java string literal encoding format."
format."
"Functions (String)","STRINGTOUTF8"," "Functions (String)","STRINGTOUTF8","
STRINGTOUTF8(string): bytes STRINGTOUTF8(string)
"," ","
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 ] )
"," ","
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","
UTF8TOSTRING(bytes): string UTF8TOSTRING(bytes)
"," ","
Decodes a byte array in the UTF8 format to a string." Decodes a byte array in the UTF8 format to a string."
"Functions (String)","XMLATTR"," "Functions (String)","XMLATTR","
XMLATTR(nameString, valueString): string XMLATTR(nameString, valueString)
"," ","
Creates an XML attribute element of the form name=""value""." Creates an XML attribute element of the form name=""value""."
"Functions (String)","XMLNODE"," "Functions (String)","XMLNODE","
XMLNODE(elementString [, attributesString [, contentString]]): string XMLNODE(elementString [, attributesString [, contentString]])
"," ","
Create an XML node element." Create an XML node element."
"Functions (String)","XMLCOMMENT"," "Functions (String)","XMLCOMMENT","
XMLCOMMENT(commentString): string XMLCOMMENT(commentString)
"," ","
Creates an XML comment." Creates an XML comment."
"Functions (String)","XMLCDATA"," "Functions (String)","XMLCDATA","
XMLCDATA(valueString): string XMLCDATA(valueString)
"," ","
Creates an XML CDATA element." Creates an XML CDATA element."
"Functions (String)","XMLSTARTDOC"," "Functions (String)","XMLSTARTDOC","
XMLSTARTDOC(): string XMLSTARTDOC()
"," ","
The string '<?xml version=""1." The string '<?xml version=""1."
"Functions (String)","XMLTEXT"," "Functions (String)","XMLTEXT","
XMLTEXT(valueString): string XMLTEXT(valueString)
"," ","
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 }
"," ","
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() }
"," ","
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 ] ) }
"," ","
Returns the current timestamp." Returns the current timestamp."
"Functions (Time and Date)","DATEADD"," "Functions (Time and Date)","DATEADD","
DATEADD(unitString, addInt, timestamp): timestamp DATEADD(unitString, addInt, timestamp)
"," ","
Adds units to a timestamp." Adds units to a timestamp."
"Functions (Time and Date)","DATEDIFF"," "Functions (Time and Date)","DATEDIFF","
DATEDIFF(unitString, aTimestamp, bTimestamp): long DATEDIFF(unitString, aTimestamp, bTimestamp)
"," ","
Returns the difference between two timestamps." Returns the difference between two timestamps."
"Functions (Time and Date)","DAYNAME"," "Functions (Time and Date)","DAYNAME","
DAYNAME(date): string DAYNAME(date)
"," ","
Returns the name of the day (in English)." Returns the name of the day (in English)."
"Functions (Time and Date)","DAY_OF_MONTH"," "Functions (Time and Date)","DAY_OF_MONTH","
DAY_OF_MONTH(date): int DAY_OF_MONTH(date)
"," ","
Returns the day of the month (1-31)." Returns the day of the month (1-31)."
"Functions (Time and Date)","DAY_OF_WEEK"," "Functions (Time and Date)","DAY_OF_WEEK","
DAY_OF_WEEK(date): int DAY_OF_WEEK(date)
"," ","
Returns the day of the week (1 means Sunday)." Returns the day of the week (1 means Sunday)."
"Functions (Time and Date)","DAY_OF_YEAR"," "Functions (Time and Date)","DAY_OF_YEAR","
DAY_OF_YEAR(date): int DAY_OF_YEAR(date)
"," ","
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 ( { YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR EXTRACT ( { YEAR | YY | MONTH | MM | DAY | DD | DAY_OF_YEAR
| DOY | HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS } | DOY | HOUR | HH | MINUTE | MI | SECOND | SS | MILLISECOND | MS }
FROM timestamp ): int FROM timestamp )
"," ","
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 FORMATDATETIME ( timestamp, formatString
[ , localeString [ , timeZoneString ] ] ): string [ , localeString [ , timeZoneString ] ] )
"," ","
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","
HOUR(timestamp): int HOUR(timestamp)
"," ","
Returns the hour (0-23) from a timestamp." Returns the hour (0-23) from a timestamp."
"Functions (Time and Date)","MINUTE"," "Functions (Time and Date)","MINUTE","
MINUTE(timestamp): int MINUTE(timestamp)
"," ","
Returns the minute (0-59) from a timestamp." Returns the minute (0-59) from a timestamp."
"Functions (Time and Date)","MONTH"," "Functions (Time and Date)","MONTH","
MONTH(timestamp): int MONTH(timestamp)
"," ","
Returns the month (1-12) from a timestamp." Returns the month (1-12) from a timestamp."
"Functions (Time and Date)","MONTHNAME"," "Functions (Time and Date)","MONTHNAME","
MONTHNAME(date): string MONTHNAME(date)
"," ","
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 PARSEDATETIME(string, formatString
[, localeString [, timeZoneString]]): string [, localeString [, timeZoneString]])
"," ","
Parses a string and returns a timestamp." Parses a string and returns a timestamp."
"Functions (Time and Date)","QUARTER"," "Functions (Time and Date)","QUARTER","
QUARTER(timestamp): int QUARTER(timestamp)
"," ","
Returns the quarter (1-4) from a timestamp." Returns the quarter (1-4) from a timestamp."
"Functions (Time and Date)","SECOND"," "Functions (Time and Date)","SECOND","
SECOND(timestamp): int SECOND(timestamp)
"," ","
Returns the second (0-59) from a timestamp." Returns the second (0-59) from a timestamp."
"Functions (Time and Date)","WEEK"," "Functions (Time and Date)","WEEK","
WEEK(timestamp): int WEEK(timestamp)
"," ","
Returns the week (1-53) from a timestamp." Returns the week (1-53) from a timestamp."
"Functions (Time and Date)","YEAR"," "Functions (Time and Date)","YEAR","
YEAR(timestamp): int YEAR(timestamp)
"," ","
Returns the year from a timestamp." Returns the year from a timestamp."
"Functions (System)","ARRAY_GET"," "Functions (System)","ARRAY_GET","
ARRAY_GET(arrayExpression, indexExpression): varchar ARRAY_GET(arrayExpression, indexExpression)
"," ","
Returns one element of an array." Returns one element of an array."
"Functions (System)","ARRAY_LENGTH"," "Functions (System)","ARRAY_LENGTH","
ARRAY_GET(arrayExpression): int ARRAY_GET(arrayExpression)
"," ","
Returns the length of an array." Returns the length of an array."
"Functions (System)","AUTOCOMMIT"," "Functions (System)","AUTOCOMMIT","
AUTOCOMMIT(): boolean AUTOCOMMIT()
"," ","
Returns true if auto commit is switched on for this session." Returns true if auto commit is switched on for this session."
"Functions (System)","CANCEL_SESSION"," "Functions (System)","CANCEL_SESSION","
CANCEL_SESSION(sessionInt): boolean CANCEL_SESSION(sessionInt)
"," ","
Cancels the currently executing statement of another session." Cancels the currently executing statement of another session."
"Functions (System)","CASEWHEN Function"," "Functions (System)","CASEWHEN Function","
CASEWHEN(boolean, aValue, bValue): value CASEWHEN(boolean, aValue, bValue)
"," ","
Returns 'a' if the boolean expression is true, otherwise 'b'." Returns 'a' if the boolean expression is true, otherwise 'b'."
"Functions (System)","CAST"," "Functions (System)","CAST","
CAST(value AS dataType): value CAST(value AS dataType)
"," ","
Converts a value to another data type." Converts a value to another data type."
"Functions (System)","COALESCE"," "Functions (System)","COALESCE","
COALESCE(aValue, bValue [,...]): value COALESCE(aValue, bValue [,...])
"," ","
Returns the first value that is not null." Returns the first value that is not null."
"Functions (System)","CONVERT"," "Functions (System)","CONVERT","
CONVERT(value, dataType): value CONVERT(value, dataType)
"," ","
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 )
"," ","
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 [, columnsString [, csvOptions ] ] ): resultSetValue CSVREAD(fileNameString [, columnsString [, csvOptions ] ] )
"," ","
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 [, csvOptions [, lineSepString] ] ): int CSVWRITE ( fileNameString, queryString [, csvOptions [, lineSepString] ] )
"," ","
Writes a CSV (comma separated values)." Writes a CSV (comma separated values)."
"Functions (System)","DATABASE"," "Functions (System)","DATABASE","
DATABASE(): string DATABASE()
"," ","
Returns the name of the database." Returns the name of the database."
"Functions (System)","DATABASE_PATH"," "Functions (System)","DATABASE_PATH","
DATABASE_PATH(): string DATABASE_PATH()
"," ","
Returns the directory of the database files and the database name, if it is file Returns the directory of the database files and the database name, if it is file
based." based."
"Functions (System)","FILE_READ"," "Functions (System)","FILE_READ","
FILE_READ(fileNameString [,encodingString]): value FILE_READ(fileNameString [,encodingString])
"," ","
Returns the contents of a file." Returns the contents of a file."
"Functions (System)","GREATEST"," "Functions (System)","GREATEST","
GREATEST(aValue, bValue [,...]): value GREATEST(aValue, bValue [,...])
"," ","
Returns the largest value that is not NULL, or NULL if all values are NULL." Returns the largest value that is not NULL, or NULL if all values are NULL."
"Functions (System)","IDENTITY"," "Functions (System)","IDENTITY","
IDENTITY(): long IDENTITY()
"," ","
Returns the last inserted identity value for this session." Returns the last inserted identity value for this session."
"Functions (System)","IFNULL"," "Functions (System)","IFNULL","
IFNULL(aValue, bValue): value IFNULL(aValue, bValue)
"," ","
Returns the value of 'a' if it is not null, otherwise 'b'." Returns the value of 'a' if it is not null, otherwise 'b'."
"Functions (System)","LEAST"," "Functions (System)","LEAST","
LEAST(aValue, bValue [,...]): value LEAST(aValue, bValue [,...])
"," ","
Returns the smallest value that is not NULL, or NULL if all values are NULL." Returns the smallest value that is not NULL, or NULL if all values are NULL."
"Functions (System)","LOCK_MODE"," "Functions (System)","LOCK_MODE","
LOCK_MODE(): int LOCK_MODE()
"," ","
Returns the current lock mode." Returns the current lock mode."
"Functions (System)","LOCK_TIMEOUT"," "Functions (System)","LOCK_TIMEOUT","
LOCK_TIMEOUT(): int LOCK_TIMEOUT()
"," ","
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): resultSetValue userString, passwordString, sourceSchemaString)
"," ","
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","
MEMORY_FREE(): int MEMORY_FREE()
"," ","
Returns the free memory in KB (where 1024 bytes is a KB)." Returns the free memory in KB (where 1024 bytes is a KB)."
"Functions (System)","MEMORY_USED"," "Functions (System)","MEMORY_USED","
MEMORY_USED(): int MEMORY_USED()
"," ","
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 )
"," ","
Returns the next value of the sequence." Returns the next value of the sequence."
"Functions (System)","NULLIF"," "Functions (System)","NULLIF","
NULLIF(aValue, bValue): value NULLIF(aValue, bValue)
"," ","
Returns NULL if 'a' is equals to 'b', otherwise 'a'." Returns NULL if 'a' is equals to 'b', otherwise 'a'."
"Functions (System)","READONLY"," "Functions (System)","READONLY","
READONLY(): boolean READONLY()
"," ","
Returns true if the database is read-only." Returns true if the database is read-only."
"Functions (System)","ROWNUM"," "Functions (System)","ROWNUM","
ROWNUM(): int ROWNUM()
"," ","
Returns the number of the current row." Returns the number of the current row."
"Functions (System)","SCHEMA"," "Functions (System)","SCHEMA","
SCHEMA(): string SCHEMA()
"," ","
Returns the name of the default schema for this session." Returns the name of the default schema for this session."
"Functions (System)","SESSION_ID"," "Functions (System)","SESSION_ID","
SESSION_ID(): int SESSION_ID()
"," ","
Returns the unique session id number for the current database connection." Returns the unique session id number for the current database connection."
"Functions (System)","SET"," "Functions (System)","SET","
SET(@variableName, value): value SET(@variableName, 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 } [,...] ): resultSetValue { TABLE | TABLE_DISTINCT } ( { name dataType = expression } [,...] )
"," ","
Returns the result set." Returns the result set."
"Functions (System)","TRANSACTION_ID"," "Functions (System)","TRANSACTION_ID","
TRANSACTION_ID(): string TRANSACTION_ID()
"," ","
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 } ()
"," ","
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","
......
...@@ -617,4 +617,4 @@ scrambling distinguish official unofficial distinguishable overwrites lastval ...@@ -617,4 +617,4 @@ 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 railroads railroad radius moz deactivation concatenating reproducing black railroads railroad radius moz
imageio argb bilinear rendering stroke interpolation flip diagrams draw imageio argb bilinear rendering stroke interpolation flip diagrams draw
delim overlap subselect delim overlap subselect bitwise
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论