zeroshade commented on code in PR #1915:
URL: https://github.com/apache/arrow-adbc/pull/1915#discussion_r1643483650


##########
dev/bench/odbc/main.cc:
##########
@@ -0,0 +1,186 @@
+#include <sql.h>
+#include <sqlext.h>
+#include <sqltypes.h>
+#include <stdio.h>
+#include <string.h>
+#include <chrono>
+#include <fstream>
+#include <iostream>
+#include <map>
+#include <string>
+#include <vector>
+
+#define ERRMSG_LEN 200
+
+SQLINTEGER checkError(SQLRETURN rc, SQLSMALLINT handleType, SQLHANDLE handle,
+                      SQLWCHAR* errmsg) {
+  SQLRETURN retcode = SQL_SUCCESS;
+
+  SQLSMALLINT errNum = 1;
+  SQLWCHAR sqlState[10];
+  SQLINTEGER nativeError;
+  SQLWCHAR errMsg[ERRMSG_LEN];
+  SQLSMALLINT textLengthPtr;
+
+  if ((rc != SQL_SUCCESS) && (rc != SQL_SUCCESS_WITH_INFO) && (rc != 
SQL_NO_DATA)) {
+    SQLLEN numRecs = 0;
+    SQLGetDiagField(SQL_HANDLE_STMT, handle, 0, SQL_DIAG_NUMBER, &numRecs, 0, 
0);
+    while (retcode != SQL_NO_DATA) {
+      retcode = SQLGetDiagRecW(handleType, handle, errNum, sqlState, 
&nativeError, errMsg,

Review Comment:
   Switched to using the ANSI version



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to