You can specify functions in JDBC escape syntax, by using the fn keyword.
{fn functionCall}
where functionCall is the name of one of the following scalar functions:
abs(NumericExpression)
The JDBC escape syntax {fn abs(NumericExpression)} is equivalent to the built-in syntax ABSOLUTE(NumericExpression). For more information, see ABS or ABSVAL function.
acos(number)
The JDBC escape syntax {fn acos(number)} is equivalent to the built-in syntax ACOS(number). For more information, see ACOS function.
asin(number)
The JDBC escape syntax {fn asin(number)} is equivalent to the built-in syntax ASIN(number). For more information, see ASIN function.
atan(number)
The JDBC escape syntax {fn atan(number)} is equivalent to the built-in syntax ATAN(number). For more information, see ATAN function.
ceiling(number)
The JDBC escape syntax {fn ceiling(number)} is equivalent to the built-in syntax CEILING(number). For more information, see CEIL or CEILING function.
concat(CharacterExpression, CharacterExpression)
Character string formed by appending the second string to the first string. If either string is null, the result is NULL. The JDBC escape syntax {fn concat (CharacterExpression, CharacterExpression) is equivalent to the built-in syntax { CharacterExpression || CharacterExpression }. For more information, see Concatenation operator.
cos(number)
The JDBC escape syntax {fn cos(number)} is equivalent to the built-in syntax COS(number). For more information, see COS function.
degrees(number)
The JDBC escape syntax {fn degrees(number)} is equivalent to the built-in syntax DEGREES(number). For more information, see DEGREES function.
exp(number)
The JDBC escape syntax {fn exp(number)} is equivalent to the built-in syntax EXP(number). For more information, see EXP function.
floor(number)
The JDBC escape syntax {fn floor(number)} is equivalent to the built-in syntax FLOOR(number). For more information, see FLOOR function.
locate(CharacterExpression,CharacterExpression [, startIndex] )
The JDBC escape syntax {fn locate(CharacterExpression,CharacterExpression [, startIndex] )} is equivalent to the built-in syntax LOCATE(CharacterExpression, CharacterExpression [, StartPosition] ). For more information, see LOCATE function.
log(number)
The JDBC escape syntax {fn log(number)} is equivalent to the built-in syntax LOG(number). For more information, see LN or LOG function.
log10(number)
The JDBC escape syntax {fn log10(number)} is equivalent to the built-in syntax LOG10(number). For more information, see LOG10 function.
mod(integer_type, integer_type)
For more information, see MOD function.
pi()
The JDBC escape syntax {fn pi()} is equivalent to the built-in syntax PI(). For more information, see PI function.
radians(number)
The JDBC escape syntax {fn radians(number)} is equivalent to the built-in syntax RADIANS(number). For more information, see RADIANS function.
sin(number)
The JDBC escape syntax {fn sin(number)} is equivalent to the built-in syntax SIN(number). For more information, see SIN function.
sqrt(FloatingPointExpression)
The JDBC escape syntax {fn sqrt (FloatingPointExpression)} is equivalent to the built-in syntax SQRT(FloatingPointExpression). For more information, see SQRT function.
substring(CharacterExpression, startIndex, length)
tan(number)
The JDBC escape syntax {fn tan(number)} is equivalent to the built-in syntax TAN(number). For more information, see TAN function.
The TIMESTAMPADD is a JDBC escaped function, and is only accessible 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.
You should not put a datetime column inside of a timestamp arithmetic function in WHERE clauses because the optimizer will not use any index on the column.
The TIMESTAMPDIFF is a JDBC escaped function, and is only accessible 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.
You should not put a datetime column inside of a timestamp arithmetic function in WHERE clauses because the optimizer will not use any index on the column.
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'))}