diff options
Diffstat (limited to 'src/interfaces/odbc/bind.c')
-rw-r--r-- | src/interfaces/odbc/bind.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/interfaces/odbc/bind.c b/src/interfaces/odbc/bind.c index 512f352181a..285fabd75ab 100644 --- a/src/interfaces/odbc/bind.c +++ b/src/interfaces/odbc/bind.c @@ -162,13 +162,6 @@ mylog("**** SQLBindCol: stmt = %u, icol = %d\n", stmt, icol); return SQL_INVALID_HANDLE; } - if (icol < 1) { - /* currently we do not support bookmarks */ - stmt->errormsg = "Bookmarks are not currently supported."; - stmt->errornumber = STMT_NOT_IMPLEMENTED_ERROR; - SC_log_error(func, "", stmt); - return SQL_ERROR; - } SC_clear_error(stmt); @@ -179,6 +172,28 @@ mylog("**** SQLBindCol: stmt = %u, icol = %d\n", stmt, icol); return SQL_ERROR; } + /* If the bookmark column is being bound, then just save it */ + if (icol == 0) { + + if (rgbValue == NULL) { + stmt->bookmark.buffer = NULL; + stmt->bookmark.used = NULL; + } + else { + /* Make sure it is the bookmark data type */ + if ( fCType != SQL_C_BOOKMARK) { + stmt->errormsg = "Column 0 is not of type SQL_C_BOOKMARK"; + stmt->errornumber = STMT_PROGRAM_TYPE_OUT_OF_RANGE; + SC_log_error(func, "", stmt); + return SQL_ERROR; + } + + stmt->bookmark.buffer = rgbValue; + stmt->bookmark.used = pcbValue; + } + return SQL_SUCCESS; + } + // allocate enough bindings if not already done // Most likely, execution of a statement would have setup the // necessary bindings. But some apps call BindCol before any |