| 1496 | } |
| 1497 | |
| 1498 | SQLRETURN SQLNativeSql(SQLHDBC conn, SQLWCHAR* in_statement_text, |
| 1499 | SQLINTEGER in_statement_text_length, SQLWCHAR* out_statement_text, |
| 1500 | SQLINTEGER buffer_length, SQLINTEGER* out_statement_text_length) { |
| 1501 | ARROW_LOG(DEBUG) << "SQLNativeSqlW called with connection_handle: " << conn |
| 1502 | << ", in_statement_text: " |
| 1503 | << static_cast<const void*>(in_statement_text) |
| 1504 | << ", in_statement_text_length: " << in_statement_text_length |
| 1505 | << ", out_statement_text: " |
| 1506 | << static_cast<const void*>(out_statement_text) |
| 1507 | << ", buffer_length: " << buffer_length |
| 1508 | << ", out_statement_text_length: " |
| 1509 | << static_cast<const void*>(out_statement_text_length); |
| 1510 | |
| 1511 | using ODBC::GetAttributeSQLWCHAR; |
| 1512 | using ODBC::ODBCConnection; |
| 1513 | using ODBC::SqlWcharToString; |
| 1514 | |
| 1515 | return ODBCConnection::ExecuteWithDiagnostics(conn, SQL_ERROR, [=]() { |
| 1516 | const bool is_length_in_bytes = false; |
| 1517 | |
| 1518 | ODBCConnection* connection = reinterpret_cast<ODBCConnection*>(conn); |
| 1519 | Diagnostics& diagnostics = connection->GetDiagnostics(); |
| 1520 | |
| 1521 | std::string in_statement_str = |
| 1522 | SqlWcharToString(in_statement_text, in_statement_text_length); |
| 1523 | |
| 1524 | return GetAttributeSQLWCHAR(in_statement_str, is_length_in_bytes, out_statement_text, |
| 1525 | buffer_length, out_statement_text_length, diagnostics); |
| 1526 | }); |
| 1527 | } |
| 1528 | |
| 1529 | SQLRETURN SQLDescribeCol(SQLHSTMT stmt, SQLUSMALLINT column_number, SQLWCHAR* column_name, |
| 1530 | SQLSMALLINT buffer_length, SQLSMALLINT* name_length_ptr, |