This section lists the scalar functions that ODBC supports. Any given data store may not support all these functions. To check which scalar functions are supported by a driver, use the SQLGetInfo ODBC function. Refer to the documentation for your data store to find out which functions are supported, and to the Microsoft ODBC Programmer's Reference descriptions of the functions.

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 | HOUR | |

LCASE | COS | MINUTE | |

LEFT | COT | MONTH | |

LENGTH | DEGREES | MONTHNAME | |

LOCATE | EXP | NOW | |

LOWER | FLOOR | QUARTER | |

LTRIM | LOG | SECOND | |

OCTET_LENGTH | LOG10 | WEEK | |

RAWTOHEX | MOD | YEAR | |

REPEAT | PI | CURRENT_DATE | |

REPLACE | POWER | CURRENT_TIME | |

RIGHT | RADIANS | CURRENT_ TIMESTAMP | |

RTRIM | RAND | ||

SOUNDEX | ROUND | ||

SPACE | ROUNDMAGIC | ||

SUBSTR | SIGN | ||

SUBSTRING | SIN | ||

UCASE | SORT | ||

UPPER | TAN | ||

TRUNCATE |

For more information about ODBC data types, refer to the Microsoft ODBC Programmer's Reference.

In this section: