MCPcopy Create free account
hub / github.com/Kitware/VTK / NextRow

Method NextRow

IO/SQL/vtkSQLiteQuery.cxx:292–329  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

290
291//------------------------------------------------------------------------------
292bool vtkSQLiteQuery::NextRow()
293{
294 if (!this->IsActive())
295 {
296 vtkErrorMacro(<< "NextRow(): Query is not active!");
297 return false;
298 }
299
300 if (this->InitialFetch)
301 {
302 vtkDebugMacro(<< "NextRow(): Initial fetch being handled.");
303 this->InitialFetch = false;
304 return this->InitialFetchResult != SQLITE_DONE;
305 }
306 else
307 {
308 int result = sqlite3_step(this->Private->Statement);
309 if (result == SQLITE_DONE)
310 {
311 return false;
312 }
313 else if (result == SQLITE_ROW)
314 {
315 return true;
316 }
317 else
318 {
319 vtkSQLiteDatabase* dbContainer = vtkSQLiteDatabase::SafeDownCast(this->Database);
320 assert(dbContainer != nullptr);
321 sqlite3* db = dbContainer->Internal->SQLiteInstance;
322 this->SetLastErrorText(sqlite3_errmsg(db));
323 vtkErrorMacro(<< "NextRow(): Database returned error code " << result
324 << " with the following message: " << this->GetLastErrorText());
325 this->Active = false;
326 return false;
327 }
328 }
329}
330
331//------------------------------------------------------------------------------
332vtkVariant vtkSQLiteQuery::DataValue(vtkIdType column)

Callers

nothing calls this directly

Calls 2

GetLastErrorTextMethod · 0.95
assertFunction · 0.50

Tested by

no test coverage detected