alinaliBQ commented on code in PR #48032:
URL: https://github.com/apache/arrow/pull/48032#discussion_r2487700543
##########
cpp/src/arrow/flight/sql/odbc/odbc_api.cc:
##########
@@ -803,22 +803,49 @@ SQLRETURN SQLExecDirect(SQLHSTMT stmt, SQLWCHAR*
query_text, SQLINTEGER text_len
ARROW_LOG(DEBUG) << "SQLExecDirectW called with stmt: " << stmt
<< ", query_text: " << static_cast<const void*>(query_text)
<< ", text_length: " << text_length;
- // GH-47711 TODO: Implement SQLExecDirect
- return SQL_INVALID_HANDLE;
+
+ using ODBC::ODBCStatement;
+ // The driver is built to handle SELECT statements only.
+ return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() {
+ ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt);
+ std::string query = ODBC::SqlWcharToString(query_text, text_length);
+
+ statement->Prepare(query);
+ statement->ExecutePrepared();
Review Comment:
we implemented SQLExecDirect to use prepare/execute to use prepared
statements to align with the behavior with JDBC
--
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]