Skip to content

Commit e5f05c7

Browse files
authored
GH-47716: [C++][FlightRPC] ODBC bind column implementation (#48042)
### Rationale for this change Add support for column binding in ODBC. ### What changes are included in this PR? - Implement SQLBindCol & tests ### Are these changes tested? Tested on local MSVC ### Are there any user-facing changes? N/A * GitHub Issue: #47716 Authored-by: Alina (Xi) Li <[email protected]> Signed-off-by: David Li <[email protected]>
1 parent cb31765 commit e5f05c7

File tree

2 files changed

+554
-2
lines changed

2 files changed

+554
-2
lines changed

cpp/src/arrow/flight/sql/odbc/odbc_api.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,8 +1100,16 @@ SQLRETURN SQLBindCol(SQLHSTMT stmt, SQLUSMALLINT record_number, SQLSMALLINT c_ty
11001100
<< ", record_number: " << record_number << ", c_type: " << c_type
11011101
<< ", data_ptr: " << data_ptr << ", buffer_length: " << buffer_length
11021102
<< ", indicator_ptr: " << static_cast<const void*>(indicator_ptr);
1103-
// GH-47716 TODO: Implement SQLBindCol
1104-
return SQL_INVALID_HANDLE;
1103+
1104+
using ODBC::ODBCDescriptor;
1105+
using ODBC::ODBCStatement;
1106+
return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() {
1107+
// GH-47021 TODO: implement driver to return indicator value when data pointer is null
1108+
ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt);
1109+
ODBCDescriptor* ard = statement->GetARD();
1110+
ard->BindCol(record_number, c_type, data_ptr, buffer_length, indicator_ptr);
1111+
return SQL_SUCCESS;
1112+
});
11051113
}
11061114

11071115
SQLRETURN SQLCloseCursor(SQLHSTMT stmt) {

0 commit comments

Comments
 (0)