| 1301 | } |
| 1302 | |
| 1303 | SQLRETURN SQLColumns(SQLHSTMT stmt, SQLWCHAR* catalog_name, |
| 1304 | SQLSMALLINT catalog_name_length, SQLWCHAR* schema_name, |
| 1305 | SQLSMALLINT schema_name_length, SQLWCHAR* table_name, |
| 1306 | SQLSMALLINT table_name_length, SQLWCHAR* column_name, |
| 1307 | SQLSMALLINT column_name_length) { |
| 1308 | // GH-47159 TODO: Return NUM_PREC_RADIX based on whether COLUMN_SIZE contains number of |
| 1309 | // digits or bits |
| 1310 | ARROW_LOG(DEBUG) << "SQLColumnsW called with stmt: " << stmt |
| 1311 | << ", catalog_name: " << static_cast<const void*>(catalog_name) |
| 1312 | << ", catalog_name_length: " << catalog_name_length |
| 1313 | << ", schema_name: " << static_cast<const void*>(schema_name) |
| 1314 | << ", schema_name_length: " << schema_name_length |
| 1315 | << ", table_name: " << static_cast<const void*>(table_name) |
| 1316 | << ", table_name_length: " << table_name_length |
| 1317 | << ", column_name: " << static_cast<const void*>(column_name) |
| 1318 | << ", column_name_length: " << column_name_length; |
| 1319 | |
| 1320 | using ODBC::ODBCStatement; |
| 1321 | using ODBC::SqlWcharToString; |
| 1322 | |
| 1323 | return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() { |
| 1324 | ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt); |
| 1325 | |
| 1326 | std::string catalog = SqlWcharToString(catalog_name, catalog_name_length); |
| 1327 | std::string schema = SqlWcharToString(schema_name, schema_name_length); |
| 1328 | std::string table = SqlWcharToString(table_name, table_name_length); |
| 1329 | std::string column = SqlWcharToString(column_name, column_name_length); |
| 1330 | |
| 1331 | statement->GetColumns(catalog_name ? &catalog : nullptr, |
| 1332 | schema_name ? &schema : nullptr, table_name ? &table : nullptr, |
| 1333 | column_name ? &column : nullptr); |
| 1334 | |
| 1335 | return SQL_SUCCESS; |
| 1336 | }); |
| 1337 | } |
| 1338 | |
| 1339 | SQLRETURN SQLColAttribute(SQLHSTMT stmt, SQLUSMALLINT record_number, |
| 1340 | SQLUSMALLINT field_identifier, |