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

HTML railroad diagrams

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