SQLGetFunctions - Get functions
SQLGetFunctions() queries whether a specific function is supported. This allows applications to adapt to varying levels of support when using different drivers.
SQLConnect() must be called, and a connection to the data source (database server) must exist before calling this function.
Syntax
SQLRETURN SQLGetFunctions (SQLHDBC hdbc, SQLSMALLINT fFunction, SQLSMALLINT *pfSupported);
Function arguments
Table 1. SQLGetFunctions arguments Data type Argument Use Description SQLHDBC hdbc Input Database connection handle. SQLSMALLINT fFunction Input Function being queried. SQLSMALLINT * pfSupported Output Pointer to location where this function returns SQL_TRUE or SQL_FALSE depending on whether the function being queried is supported.
Usage
The following list shows the valid value for the fFunction argument and whether the corresponding function is supported. Note that the values marked with an asterisk are not supported when connected to a remote system.
SQL_API_ALLOCCONNECT = TRUE SQL_API_ALLOCENV = TRUE SQL_API_ALLOCHANDLE = TRUE SQL_API_ALLOCSTMT = TRUE SQL_API_BINDCOL = TRUE SQL_API_BINDFILETOCOL = TRUE SQL_API_BINDFILETOPARAM = TRUE SQL_API_BINDPARAM = TRUE SQL_API_BINDPARAMETER = TRUE SQL_API_CANCEL = TRUE SQL_API_CLOSECURSOR = TRUE SQL_API_COLATTRIBUTES = TRUE SQL_API_COLUMNS = TRUE SQL_API_CONNECT = TRUE SQL_API_COPYDESC = TRUE SQL_API_DATASOURCES = TRUE SQL_API_DESCRIBECOL = TRUE SQL_API_DESCRIBEPARAM = TRUE SQL_API_DISCONNECT = TRUE SQL_API_DRIVERCONNECT = TRUE SQL_API_ENDTRAN = TRUE SQL_API_ERROR = TRUE SQL_API_EXECDIRECT = TRUE SQL_API_EXECUTE = TRUE SQL_API_EXTENDEDFETCH = TRUE SQL_API_FETCH = TRUE SQL_API_FOREIGNKEYS = TRUE SQL_API_FREECONNECT = TRUE SQL_API_FREEENV = TRUE SQL_API_FREEHANDLE = TRUE SQL_API_FREESTMT = TRUE SQL_API_GETCOL = TRUE SQL_API_GETCONNECTATTR = TRUE SQL_API_GETCONNECTOPTION = TRUE SQL_API_GETCURSORNAME = TRUE SQL_API_GETDATA = TRUE SQL_API_GETDESCFIELD = TRUE SQL_API_GETDESCREC = TRUE SQL_API_GETDIAGFIELD = TRUE SQL_API_GETDIAGREC = TRUE SQL_API_GETENVATTR = TRUE SQL_API_GETFUNCTIONS = TRUE SQL_API_GETINFO = TRUE SQL_API_GETLENGTH = TRUE SQL_API_GETPOSITION = TRUE SQL_API_GETSTMTATTR = TRUE SQL_API_GETSTMTOPTION = TRUE SQL_API_GETSUBSTRING = TRUE SQL_API_GETTYPEINFO = TRUE SQL_API_LANGUAGES = TRUE SQL_API_MORERESULTS = TRUE SQL_API_NATIVESQL = TRUE SQL_API_NUMPARAMS = TRUE SQL_API_NUMRESULTCOLS = TRUE SQL_API_PARAMDATA = TRUE SQL_API_PARAMOPTIONS = TRUE SQL_API_PREPARE = TRUE SQL_API_PRIMARYKEYS = TRUE SQL_API_PROCEDURECOLUMNS = TRUE SQL_API_PROCEDURES = TRUE SQL_API_PUTDATA = TRUE SQL_API_RELEASEENV = TRUE SQL_API_ROWCOUNT = TRUE SQL_API_SETCONNECTATTR = TRUE SQL_API_COLATTRIBUTES = TRUE SQL_API_COLUMNS = TRUE SQL_API_CONNECT = TRUE SQL_API_COPYDESC = TRUE SQL_API_DATASOURCES = TRUE SQL_API_DESCRIBECOL = TRUE SQL_API_DESCRIBEPARAM = TRUE SQL_API_DISCONNECT = TRUE SQL_API_DRIVERCONNECT = TRUE SQL_API_ENDTRAN = TRUE SQL_API_ERROR = TRUE SQL_API_EXECDIRECT = TRUE SQL_API_EXECUTE = TRUE SQL_API_EXTENDEDFETCH = TRUE SQL_API_FETCH = TRUE SQL_API_FOREIGNKEYS = TRUE SQL_API_FREECONNECT = TRUE SQL_API_FREEENV = TRUE SQL_API_FREEHANDLE = TRUE SQL_API_FREESTMT = TRUE SQL_API_GETCOL = TRUE SQL_API_GETCONNECTATTR = TRUE SQL_API_GETCONNECTOPTION = TRUE SQL_API_GETCURSORNAME = TRUE SQL_API_GETDATA = TRUE SQL_API_GETDESCFIELD = TRUE SQL_API_GETDESCREC = TRUE SQL_API_GETDIAGFIELD = TRUE SQL_API_GETDIAGREC = TRUE SQL_API_GETENVATTR = TRUE SQL_API_GETFUNCTIONS = TRUE SQL_API_GETINFO = TRUE SQL_API_GETLENGTH = TRUE SQL_API_GETPOSITION = TRUE SQL_API_GETSTMTATTR = TRUE SQL_API_GETSTMTOPTION = TRUE SQL_API_GETSUBSTRING = TRUE SQL_API_GETTYPEINFO = TRUE SQL_API_LANGUAGES = TRUE SQL_API_MORERESULTS = TRUE SQL_API_NATIVESQL = TRUE SQL_API_NUMPARAMS = TRUE SQL_API_NUMRESULTCOLS = TRUE SQL_API_PARAMDATA = TRUE SQL_API_PARAMOPTIONS = TRUE SQL_API_PREPARE = TRUE SQL_API_PRIMARYKEYS = TRUE SQL_API_PROCEDURECOLUMNS = TRUE SQL_API_PROCEDURES = TRUE SQL_API_PUTDATA = TRUE SQL_API_RELEASEENV = TRUE SQL_API_ROWCOUNT = TRUE SQL_API_SETCONNECTATTR = TRUE SQL_API_SETCONNECTOPTION = TRUE SQL_API_SETCURSORNAME = TRUE SQL_API_SETDESCFIELD = TRUE SQL_API_SETDESCREC = TRUE SQL_API_SETENVATTR = TRUE SQL_API_SETPARAM = TRUE SQL_API_SETSTMTATTR = TRUE SQL_API_SETSTMTOPTION = TRUE SQL_API_SPECIALCOLUMNS = TRUE * SQL_API_STATISTICS = TRUE * SQL_API_TABLES = TRUE SQL_API_TRANSACT = TRUE
Return codes
- SQL_SUCCESS
- SQL_ERROR
- SQL_INVALID_HANDLE
Diagnostics
Table 2. SQLGetFunctions SQLSTATEs SQLSTATE Description Explanation 40003 * Statement completion unknown The communication link between the CLI and the data source fails before the function completes processing. 58004 System error Unrecoverable system error. HY001 Memory allocation failure The driver is unable to allocate memory required to support the processing or completion of the function. HY009 Argument value that is not valid. The argument pfSupported is a null pointer. HY010 Function sequence error. Connection handles must not be allocated yet. SQLGetFunctions is called before SQLConnect. HY013 * Memory management problem The driver is unable to access memory required to support the processing or completion of the function.
Parent topic:
DB2 UDB CLI functions