Scalar functions
- Last Updated: August 19, 2019
- 1 minute read
- DataDirect Connectors
- ODBC
- Aha! 8.0
- Amazon Redshift 8.0
- Apache Cassandra 8.0
- Apache Hive 8.0
- Apache Spark SQL 8.0
- Autonomous Rest Connector 8.0
- Cloudera Impala 7.1
- dBase 7.1
- + 24
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
| 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 |