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