| 701 | //------------------------------------------------------------------------------ |
| 702 | |
| 703 | bool 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 |
no test coverage detected