Use these handle types to execute ODBC functions.
In C, this statement is coded:
HSTMT hstmt; rc = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
In C, this statement is coded:
SQLCHAR stmt[ ] = "CREATE TABLE NAMEID (ID INTEGER, NAME VARCHAR(50))"; rc = SQLExecDirect(hstmt, stmt, SQL_NTS);
In C, this statement is coded:
SQLSMALLINT i = 1, cbErrorMsg ; SQLCHAR szSQLState[6], szErrorMsg[SQL_MAX_MESSAGE_LENGTH]; SQLINTEGER nativeError; rc = SQLGetDiagRec(SQL_HANDLE_STMT, hstmt, i, szSQLState, &nativeError, szErrorMsg, SQL_MAX_MESSAGE_LENGTH, &cbErrorMsg);