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.

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_COLATTRIBUTE      = TRUE
SQL_API_COLATTRIBUTEW     = TRUE
SQL_API_COLATTRIBUTES     = TRUE
SQL_API_COLATTRIBUTESW    = TRUE
SQL_API_COLUMNS           = TRUE
SQL_API_COLUMNSW          = TRUE
SQL_API_CONNECT           = TRUE
SQL_API_CONNECTW          = TRUE
SQL_API_COPYDESC          = TRUE
SQL_API_DATASOURCES       = TRUE
SQL_API_DATASOURCESW      = TRUE
SQL_API_DESCRIBECOL       = TRUE
SQL_API_DESCRIBECOLW      = TRUE
SQL_API_DESCRIBEPARAM     = TRUE
SQL_API_DISCONNECT        = TRUE
SQL_API_DRIVERCONNECT     = TRUE
SQL_API_DRIVERCONNECTW    = TRUE
SQL_API_ENDTRAN           = TRUE
SQL_API_ERROR             = TRUE
SQL_API_ERRORW            = TRUE
SQL_API_EXECDIRECT        = TRUE
SQL_API_EXECDIRECTW       = TRUE
SQL_API_EXECUTE           = TRUE
SQL_API_EXTENDEDFETCH     = TRUE
SQL_API_FETCH             = TRUE
SQL_API_FOREIGNKEYS       = TRUE
SQL_API_FOREIGNKEYSW      = 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_GETCONNECTATTRW   = TRUE
SQL_API_GETCONNECTOPTION  = TRUE
SQL_API_GETCONNECTOPTIONW = TRUE
SQL_API_GETCURSORNAME     = TRUE
SQL_API_GETCURSORNAMEW    = TRUE
SQL_API_GETDATA           = TRUE
SQL_API_GETDESCFIELD      = TRUE
SQL_API_GETDESCFIELDW     = TRUE
SQL_API_GETDESCREC        = TRUE
SQL_API_GETDESCRECW       = TRUE
SQL_API_GETDIAGFIELD      = TRUE
SQL_API_GETDIAGFIELDW     = TRUE
SQL_API_GETDIAGREC        = TRUE
SQL_API_GETDIAGRECW       = TRUE
SQL_API_GETENVATTR        = TRUE
SQL_API_GETFUNCTIONS      = TRUE
SQL_API_GETINFO           = TRUE
SQL_API_GETINFOW          = TRUE
SQL_API_GETLENGTH         = TRUE
SQL_API_GETPOSITION       = TRUE
SQL_API_GETPOSITIONW      = TRUE
SQL_API_GETSTMTATTR       = TRUE
SQL_API_GETSTMTATTRW      = TRUE
SQL_API_GETSTMTOPTION     = TRUE
SQL_API_GETSTMTOPTIONW    = TRUE
SQL_API_GETSUBSTRING      = TRUE
SQL_API_GETSUBSTRINGW     = TRUE
SQL_API_GETTYPEINFO       = TRUE
SQL_API_GETTYPEINFOW      = TRUE
SQL_API_LANGUAGES         = TRUE
SQL_API_MORERESULTS       = TRUE
SQL_API_NATIVESQL         = TRUE
SQL_API_NATIVESQLW        = TRUE
SQL_API_NUMPARAMS         = TRUE
SQL_API_NUMRESULTCOLS     = TRUE
SQL_API_PARAMDATA         = TRUE
SQL_API_PARAMOPTIONS      = TRUE
SQL_API_PREPARE           = TRUE
SQL_API_PREPAREW          = TRUE
SQL_API_PRIMARYKEYS       = TRUE
SQL_API_PRIMARYKEYSW      = TRUE
SQL_API_PROCEDURECOLUMNS  = TRUE
SQL_API_PROCEDURECOLUMNSW = TRUE
SQL_API_PROCEDURES        = TRUE
SQL_API_PROCEDURESW       = TRUE
SQL_API_PUTDATA           = TRUE
SQL_API_RELEASEENV        = TRUE
SQL_API_ROWCOUNT          = TRUE
SQL_API_SETCONNECTATTR    = TRUE
SQL_API_SETCONNECTATTRW   = TRUE
SQL_API_SETCONNECTOPTION  = TRUE
SQL_API_SETCONNECTOPTIONW = TRUE
SQL_API_SETCURSORNAME     = TRUE
SQL_API_SETCURSORNAMEW    = TRUE
SQL_API_SETDESCFIELD      = TRUE
SQL_API_SETDESCFIELDW     = TRUE
SQL_API_SETDESCREC        = TRUE
SQL_API_SETENVATTR        = TRUE
SQL_API_SETPARAM          = TRUE
SQL_API_SETSTMTATTR       = TRUE
SQL_API_SETSTMTATTRW      = TRUE
SQL_API_SETSTMTOPTION     = TRUE
SQL_API_SETSTMTOPTIONW    = TRUE
SQL_API_SPECIALCOLUMNS    = TRUE
SQL_API_SPECIALCOLUMNSW   = TRUE
SQL_API_STATISTICS        = TRUE
SQL_API_STATISTICSW       = TRUE
SQL_API_TABLES            = TRUE
SQL_API_TABLESW           = 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.