You can specify functions in JDBC escape syntax by using the
`fn` keyword.

{ fnfunctionCall}

where *functionCall* is the name of one of the scalar functions listed
below. The functions are of the following types:

- Numeric functions
- String functions
- Date and time functions
- System function

- abs
- Returns the absolute value of a number.
**abs (***numericExpression*)The JDBC escape syntax

`{fn abs(`is equivalent to the built-in syntax*numericExpression*)}`ABS(`. For more information, see ABS or ABSVAL function.*numericExpression*) - acos
- Returns the arc cosine of a specified number.
**acos (***number*)The JDBC escape syntax

`{fn acos(`is equivalent to the built-in syntax*number*)}`ACOS(`. For more information, see ACOS function.*number*) - asin
- Returns the arc sine of a specified number.
**asin (***number*)The JDBC escape syntax

`{fn asin(`is equivalent to the built-in syntax*number*)}`ASIN(`. For more information, see ASIN function.*number*) - atan
- Returns the arc tangent of a specified number.
**atan (***number*)The JDBC escape syntax

`{fn atan(`is equivalent to the built-in syntax*number*)}`ATAN(`. For more information, see ATAN function.*number*) - atan2
- Returns the arc tangent in radians of
.*y*/*x***atan2 (***y*,*x*)The JDBC escape syntax

`{fn atan2(`is equivalent to the built-in syntax*y*,*x*)}`ATAN2(`. For more information, see ATAN2 function.*y*,*x*) - ceiling
- Rounds the specified number up, and returns the smallest number that is
greater than or equal to the specified number.
**ceiling (***number*)The JDBC escape syntax

`{fn ceiling(`is equivalent to the built-in syntax*number*)}`CEILING(`. For more information, see CEIL or CEILING function.*number*) - cos
- Returns the cosine of a specified number.
**cos (***number*)The JDBC escape syntax

`{fn cos(`is equivalent to the built-in syntax*number*)}`COS(`. For more information, see COS function.*number*) - cot
- Returns the cotangent of a specified number.
**cot (***number*)The JDBC escape syntax

`{fn cot(`is equivalent to the built-in syntax*number*)}`COT(`. For more information, see COT function.*number*) - degrees
- Converts a specified number from radians to degrees.
**degrees (***number*)The JDBC escape syntax

`{fn degrees(`is equivalent to the built-in syntax*number*)}`DEGREES(`. For more information, see DEGREES function.*number*) - exp
- Returns e raised to the power of the specified number.
**exp (***number*)The JDBC escape syntax

`{fn exp(`is equivalent to the built-in syntax*number*)}`EXP(`. For more information, see EXP function.*number*) - floor
- Rounds the specified number down, and returns the largest number that
is less than or equal to the specified number.
**floor (***number*)The JDBC escape syntax

`{fn floor(`is equivalent to the built-in syntax*number*)}`FLOOR(`. For more information, see FLOOR function.*number*) - log
- Returns the natural logarithm (base e) of the specified number.
**log (***number*)The JDBC escape syntax

`{fn log(`is equivalent to the built-in syntax*number*)}`LOG(`. For more information, see LN or LOG function.*number*) - log10
- Returns the base-10 logarithm of the specified number.
**log10 (***number*)The JDBC escape syntax

`{fn log10(`is equivalent to the built-in syntax*number*)}`LOG10(`. For more information, see LOG10 function.*number*) - mod
- Returns the remainder (modulus) of argument 1 divided by argument 2.
The result is negative only if argument 1 is negative.
**mod (***integerExpression*,*integerExpression*)The JDBC escape syntax

`{fn mod(`is equivalent to the built-in syntax*integerExpression*,*integerExpression*)}`MOD(`. For more information, see MOD function.*integerExpression*,*integerExpression*) - pi
- Returns a value that is closer than any other value to pi.
**pi ( )**The JDBC escape syntax

`{fn pi()}`is equivalent to the built-in syntax`PI()`. For more information, see PI function. - radians
- Converts a specified number from degrees to radians.
**radians (***number*)The JDBC escape syntax

`{fn radians(`is equivalent to the built-in syntax*number*)}`RADIANS(`. For more information, see RADIANS function.*number*) - rand
- Returns a random number given a seed number.
**rand (***seed*)The JDBC escape syntax

`{fn rand(`is equivalent to the built-in syntax*seed*)}`RAND(`. For more information, see RAND function.*seed*) - sign
- Returns an integer that represents the sign of a specified number (+1 if the
number is positive, -1 if it is negative, 0 if it is 0).
**sign (***number*)The JDBC escape syntax

`{fn sign(`is equivalent to the built-in syntax*number*)}`SIGN(`. For more information, see SIGN function.*number*) - sin
- Returns the sine of a specified number.
**sin (***number*)The JDBC escape syntax

`{fn sin(`is equivalent to the built-in syntax*number*)}`SIN(`. For more information, see SIN function.*number*) - sqrt
- Returns the square root of a floating-point number.
**sqrt (***number*)The JDBC escape syntax

`{fn sqrt(`is equivalent to the built-in syntax*number*)}`SQRT(`. For more information, see SQRT function.*number*) - tan
- Returns the tangent of a specified number.
**tan (***number*)The JDBC escape syntax

`{fn tan(`is equivalent to the built-in syntax*number*)}`TAN(`. For more information, see TAN function.*number*)

- concat
- Returns the concatenation of character strings; that is, the character
string formed by appending the second string to the first string. If either
string is null, the result is NULL.
**concat (***characterExpression*,*characterExpression*)The JDBC escape syntax

`{fn concat(`is equivalent to the built-in syntax*characterExpression*,*characterExpression*)}. For more information, see Concatenation operator.*characterExpression*||*characterExpression* - lcase
- Returns a string in which all alphabetic characters in the argument have
been converted to lowercase.
**lcase (***characterExpression*)The JDBC escape syntax

`{fn lcase(`is equivalent to the built-in syntax*characterExpression*)}`LCASE(`. For more information, see LCASE or LOWER function.*characterExpression*) - length
- Returns the number of characters in a character string expression.
**length (***characterExpression*)The JDBC escape syntax

`{fn length(`is equivalent to the built-in syntax*characterExpression*)}`LENGTH(`. For more information, see LENGTH function.*characterExpression*) - locate
- Returns the position in the second
*characterExpression*of the first occurrence of the first*characterExpression*. Searches from the beginning of the second*characterExpression*, unless the*startIndex*parameter is specified.**locate (***characterExpression*,*characterExpression*[ ,*startIndex*] )The JDBC escape syntax

`{fn locate(`is equivalent to the built-in syntax*characterExpression*,*characterExpression*[,*startIndex*] )}`LOCATE(`. For more information, see LOCATE function.*characterExpression*,*characterExpression*[,*startPosition*] ) - ltrim
- Removes blanks from the beginning of a character string expression.
**ltrim (***characterExpression*)The JDBC escape syntax

`{fn ltrim(`is equivalent to the built-in syntax*characterExpression*)}`LTRIM(`. For more information, see LTRIM function.*characterExpression*) - rtrim
- Removes blanks from the end of a character string expression.
**rtrim (***characterExpression*)The JDBC escape syntax

`{fn rtrim(`is equivalent to the built-in syntax*characterExpression*)}`RTRIM(`. For more information, see RTRIM function.*characterExpression*) - substring
- Forms a character string by extracting
*length*characters from the*characterExpression*beginning at*startIndex*. The index of the first character in the*characterExpression*is 1.**substring (***characterExpression*,*startIndex*,*length*)The JDBC escape syntax

`{fn substring(`is equivalent to the built-in syntax*characterExpression*,*startIndex*,*length*)}`SUBSTR(`. For more information, see SUBSTR function.*characterExpression*,*startIndex*,*length*) - ucase
- Returns a string in which all alphabetic characters in the argument have
been converted to uppercase.
**ucase (***characterExpression*)The JDBC escape syntax

`{fn ucase(`is equivalent to the built-in syntax*characterExpression*)}`UCASE(`. For more information, see UCASE or UPPER function.*characterExpression*)

- curdate
- Returns the current date.
**curdate ( )**The JDBC escape syntax

`{fn curdate()}`is equivalent to the built-in syntax`CURRENT_DATE`. For more information, see CURRENT_DATE function. - curtime
- Returns the current time.
**curtime ( )**The JDBC escape syntax

`{fn curtime()}`is equivalent to the built-in syntax`CURRENT_TIME`. For more information, see CURRENT_TIME function. - hour
- Returns the hour part of a time value.
**hour (***expression*)The JDBC escape syntax

`{fn hour(`is equivalent to the built-in syntax*expression*)}`HOUR(`. For more information, see HOUR function.*expression*) - minute
- Returns the minute part of a time value.
**minute (***expression*)The JDBC escape syntax

`{fn minute(`is equivalent to the built-in syntax*expression*)}`MINUTE(`. For more information, see MINUTE function.*expression*) - month
- Returns the month part of a date value.
**month (***expression*)The JDBC escape syntax

`{fn month(`is equivalent to the built-in syntax*expression*)}`MONTH(`. For more information, see MONTH function.*expression*) - second
- Returns the seconds part of a time value.
**second (***expression*)The JDBC escape syntax

`{fn second(`is equivalent to the built-in syntax*expression*)}`SECOND(`. For more information, see SECOND function.*expression*) - TIMESTAMPADD
- Use the
`TIMESTAMPADD`function to add the value of an interval to a timestamp. The function applies the integer to the specified timestamp based on the interval type and returns the sum as a new timestamp. You can subtract from the timestamp by using negative integers.`TIMESTAMPADD`is a JDBC escaped function and is accessible only by using the JDBC escape function syntax.**TIMESTAMPADD (***interval*,*integerExpression*,*timestampExpression*)To perform

`TIMESTAMPADD`on dates and times, it is necessary to convert the dates and times to timestamps. Dates are converted to timestamps by putting 00:00:00.0 in the time-of-day fields. Times are converted to timestamps by putting the current date in the date fields.Do not put a datetime column inside a timestamp arithmetic function in WHERE clauses, because the optimizer will not use any index on the column.

- TIMESTAMPDIFF
- Use the
`TIMESTAMPDIFF`function to find the difference between two timestamp values at a specified interval. For example, the function can return the number of minutes between two specified timestamps.The

`TIMESTAMPDIFF`is a JDBC escaped function and is accessible only by using the JDBC escape function syntax.**TIMESTAMPDIFF (***interval*,*timestampExpression1*,*timestampExpression2*)To perform

`TIMESTAMPDIFF`on dates and times, it is necessary to convert the dates and times to timestamps. Dates are converted to timestamps by putting 00:00:00.0 in the time-of-day fields. Times are converted to timestamps by putting the current date in the date fields.Do not put a datetime column inside a timestamp arithmetic function in WHERE clauses, because the optimizer will not use any index on the column.

- year
- Returns the year part of a date value.
**year (***expression*)The JDBC escape syntax

`{fn year(`is equivalent to the built-in syntax*expression*)}`YEAR(`. For more information, see YEAR function.*expression*)

- SQL_TSI_DAY
- SQL_TSI_FRAC_SECOND
- SQL_TSI_HOUR
- SQL_TSI_MINUTE
- SQL_TSI_MONTH
- SQL_TSI_QUARTER
- SQL_TSI_SECOND
- SQL_TSI_WEEK
- SQL_TSI_YEAR

To return a timestamp value one month later than the current timestamp, use the following syntax:

{fn TIMESTAMPADD( SQL_TSI_MONTH, 1, CURRENT_TIMESTAMP)}

To return the number of weeks between now and the specified time on January 1, 2008, use the following syntax:

{fn TIMESTAMPDIFF(SQL_TSI_WEEK, CURRENT_TIMESTAMP, timestamp('2008-01-01-12.00.00.000000'))}

- user
- Returns the authorization identifier or name of the current user. If there
is no current user, it returns APP.
**user ( )**The JDBC escape syntax

`{fn user()}`is equivalent to the built-in syntax`USER`. For more information, see USER function.