| 1267 | } |
| 1268 | |
| 1269 | SQLRETURN SQLTables(SQLHSTMT stmt, SQLWCHAR* catalog_name, |
| 1270 | SQLSMALLINT catalog_name_length, SQLWCHAR* schema_name, |
| 1271 | SQLSMALLINT schema_name_length, SQLWCHAR* table_name, |
| 1272 | SQLSMALLINT table_name_length, SQLWCHAR* table_type, |
| 1273 | SQLSMALLINT table_type_length) { |
| 1274 | ARROW_LOG(DEBUG) << "SQLTablesW called with stmt: " << stmt |
| 1275 | << ", catalog_name: " << static_cast<const void*>(catalog_name) |
| 1276 | << ", catalog_name_length: " << catalog_name_length |
| 1277 | << ", schema_name: " << static_cast<const void*>(schema_name) |
| 1278 | << ", schema_name_length: " << schema_name_length |
| 1279 | << ", table_name: " << static_cast<const void*>(table_name) |
| 1280 | << ", table_name_length: " << table_name_length |
| 1281 | << ", table_type: " << static_cast<const void*>(table_type) |
| 1282 | << ", table_type_length: " << table_type_length; |
| 1283 | |
| 1284 | using ODBC::ODBCStatement; |
| 1285 | using ODBC::SqlWcharToString; |
| 1286 | |
| 1287 | return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() { |
| 1288 | ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt); |
| 1289 | |
| 1290 | std::string catalog = SqlWcharToString(catalog_name, catalog_name_length); |
| 1291 | std::string schema = SqlWcharToString(schema_name, schema_name_length); |
| 1292 | std::string table = SqlWcharToString(table_name, table_name_length); |
| 1293 | std::string type = SqlWcharToString(table_type, table_type_length); |
| 1294 | |
| 1295 | statement->GetTables(catalog_name ? &catalog : nullptr, |
| 1296 | schema_name ? &schema : nullptr, table_name ? &table : nullptr, |
| 1297 | table_type ? &type : nullptr); |
| 1298 | |
| 1299 | return SQL_SUCCESS; |
| 1300 | }); |
| 1301 | } |
| 1302 | |
| 1303 | SQLRETURN SQLColumns(SQLHSTMT stmt, SQLWCHAR* catalog_name, |
| 1304 | SQLSMALLINT catalog_name_length, SQLWCHAR* schema_name, |