------------------------------------------------------------------------------
| 402 | |
| 403 | //------------------------------------------------------------------------------ |
| 404 | const char* vtkSQLDatabaseSchema::GetIndexColumnNameFromHandle( |
| 405 | int tblHandle, int idxHandle, int cnmHandle) |
| 406 | { |
| 407 | if (tblHandle < 0 || tblHandle >= this->GetNumberOfTables()) |
| 408 | { |
| 409 | vtkErrorMacro("Cannot get column name of an index in non-existent table " << tblHandle); |
| 410 | return nullptr; |
| 411 | } |
| 412 | |
| 413 | if (idxHandle < 0 || |
| 414 | idxHandle >= static_cast<int>(this->Internals->Tables[tblHandle].Indices.size())) |
| 415 | { |
| 416 | vtkErrorMacro( |
| 417 | "Cannot get column name of non-existent index " << idxHandle << " in table " << tblHandle); |
| 418 | return nullptr; |
| 419 | } |
| 420 | |
| 421 | if (cnmHandle < 0 || |
| 422 | cnmHandle >= |
| 423 | static_cast<int>(this->Internals->Tables[tblHandle].Indices[idxHandle].ColumnNames.size())) |
| 424 | { |
| 425 | vtkErrorMacro("Cannot get column name of non-existent column " |
| 426 | << cnmHandle << " of index " << idxHandle << " in table " << tblHandle); |
| 427 | return nullptr; |
| 428 | } |
| 429 | |
| 430 | return this->Internals->Tables[tblHandle].Indices[idxHandle].ColumnNames[cnmHandle].c_str(); |
| 431 | } |
| 432 | |
| 433 | //------------------------------------------------------------------------------ |
| 434 | int vtkSQLDatabaseSchema::GetColumnHandleFromName(const char* tblName, const char* colName) |