| 1054 | } |
| 1055 | |
| 1056 | SQLRETURN SQLPrepare(SQLHSTMT stmt, SQLWCHAR* query_text, SQLINTEGER text_length) { |
| 1057 | ARROW_LOG(DEBUG) << "SQLPrepareW called with stmt: " << stmt |
| 1058 | << ", query_text: " << static_cast<const void*>(query_text) |
| 1059 | << ", text_length: " << text_length; |
| 1060 | |
| 1061 | using ODBC::ODBCStatement; |
| 1062 | // The driver is built to handle SELECT statements only. |
| 1063 | return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() { |
| 1064 | ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt); |
| 1065 | std::string query = ODBC::SqlWcharToString(query_text, text_length); |
| 1066 | |
| 1067 | statement->Prepare(query); |
| 1068 | |
| 1069 | return SQL_SUCCESS; |
| 1070 | }); |
| 1071 | } |
| 1072 | |
| 1073 | SQLRETURN SQLExecute(SQLHSTMT stmt) { |
| 1074 | ARROW_LOG(DEBUG) << "SQLExecute called with stmt: " << stmt; |