ODBC Scalar Overview

Following is a list of ODBC Scalar functions that are supported by the Client Access AS/400 ODBC driver source. To activate, surround the function with the ODBC escape character.

Here is an example of calling an ODBC scalar function:

SELECT {fn CONCAT(EMPNAME,'-HELLO')},EMPNO from EMPLOYEES;

In the above example, the '{' is the ODBC escape character which tells the driver to replace the ODBC function call with the proper DB2 syntax. The 'fn' denotes that this is an ODBC defined function to translate. CONCAT is the function to call and EMPNAME and '-HELLO' are the operant values.

** Note that these are the ODBC Defined functions, not DB2 functions. The ODBC defined functions map to DB2 defined functions. There are functions that are not defined by ODBC that are available for you to use. These functions are defined in the AS/400 DB2 SQL Reference. All DB2 functions are supported by the ODBC interface. Do not use the escape grammar with DB2 built in functions.