This section lists the scalar functions that ODBC supports. Your database system may not support all these functions. Refer to the documentation for your database system to find out which functions are supported. Also, depending on the driver that you are using, all the scalar functions may not be supported. To check which scalar functions are supported by a driver, use the SQLGetInfo ODBC function.

You can use these scalar functions in SQL statements using the following syntax:

{fn scalar-function}

where scalar-function is one of the functions listed in the following tables. For example:

SELECT {fn UCASE(NAME)} FROM EMP

Table 1. Scalar Functions
String Functions Numeric Functions Timedate Functions System Functions
ASCII ABS CURDATE CURSESSIONID
BIT_LENGTH ACOS CURTIME CURRENT_USER
CHAR ASIN DATEDIFF DATABASE
CHAR_LENGTH ATAN DAYNAME IDENTITY
CONCAT ATAN2 DAYOFMONTH USER
DIFFERENCE BITAND DAYOFWEEK
HEXTORAW BITOR DAYOFYEAR
INSERT CEILING EXTRACT
LCASE COS HOUR
LEFT COT MINUTE
LENGTH DEGREES MONTH
LOCATE EXP MONTHNAME
LOWER FLOOR NOW
LTRIM LOG QUARTER
OCTET_LENGTH LOG10 SECOND
RAWTOHEX MOD WEEK
REPEAT PI YEAR
REPLACE POWER CURRENT_DATE
RIGHT RADIANS CURRENT_TIME
RTRIM RAND CURRENT_ TIMESTAMP
SOUNDEX ROUND
SPACE ROUNDMAGIC
SUBSTR SIGN
SUBSTRING SIN
UCASE SQRT
UPPER TAN
TRUNCATE