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

Method BindStringParameter

IO/SQL/vtkSQLiteQuery.cxx:703–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701//------------------------------------------------------------------------------
702
703bool vtkSQLiteQuery::BindStringParameter(int index, const char* value, int length)
704{
705 if (!this->Private->Statement)
706 {
707 vtkErrorMacro(<< "No statement available. Did you forget to call SetQuery?");
708 return false;
709 }
710
711 if (this->Active)
712 {
713 this->Active = false;
714 sqlite3_reset(this->Private->Statement);
715 }
716
717 int status =
718 sqlite3_bind_text(this->Private->Statement, index + 1, value, length, SQLITE_TRANSIENT);
719
720 if (status != SQLITE_OK)
721 {
722 std::ostringstream errormessage;
723 errormessage << "sqlite_bind_text returned error: " << status;
724 this->SetLastErrorText(errormessage.str().c_str());
725 vtkErrorMacro(<< this->GetLastErrorText());
726 return false;
727 }
728 return true;
729}
730
731//------------------------------------------------------------------------------
732

Callers 1

BindParameterMethod · 0.95

Calls 3

GetLastErrorTextMethod · 0.95
c_strMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected