skip to main content
SQL Escape Sequences for JDBC : Scalar Functions
  

Try DataDirect Drivers Now

Scalar Functions

You can use scalar functions in SQL statements with the following syntax:
{fn scalar-function}
where:
scalar-function
is a scalar function supported by the driver as indicated in the following table.
Example:
SELECT id, name FROM emp WHERE name LIKE {fn UCASE('Smith')}
Table 29. Supported Scalar Functions
String Functions
Numeric Functions
Timedate Functions
System Functions
ASCII
CONCAT
INSERT
LCASE
LEFT
LENGTH
LOCATE
LOCATE2
LTRIM
REPEAT
REPLACE
RIGHT
RTRIM
SPACE
SUBSTRING
UCASE
ABS
ACOS
ASIN
ATAN
CEILING
COS
COT
DEGREES
EXP
FLOOR
LOG
LOG10
MODP
PI
POWER
RADIANS
RAND
ROUND
SIGN
SIN
SQRT
TAN
CURDATE
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURTIME
DAYOFMONTH
EXTRACT
HOUR
MINUTE
MONTH
NOW
QUARTER
SECOND
TIMESTAMPADD 1
TIMESTAMPDIFF
WEEK
YEAR
DBNAME
IFNULL

1 Apache Spark SQL is limited to adding only days to a timestamp.