| 731 | //------------------------------------------------------------------------------ |
| 732 | |
| 733 | bool vtkSQLiteQuery::BindBlobParameter(int index, const void* data, int length) |
| 734 | { |
| 735 | if (!this->Private->Statement) |
| 736 | { |
| 737 | vtkErrorMacro(<< "No statement available. Did you forget to call SetQuery?"); |
| 738 | return false; |
| 739 | } |
| 740 | |
| 741 | if (this->Active) |
| 742 | { |
| 743 | this->Active = false; |
| 744 | sqlite3_reset(this->Private->Statement); |
| 745 | } |
| 746 | |
| 747 | int status = |
| 748 | sqlite3_bind_blob(this->Private->Statement, index + 1, data, length, SQLITE_TRANSIENT); |
| 749 | |
| 750 | if (status != SQLITE_OK) |
| 751 | { |
| 752 | std::ostringstream errormessage; |
| 753 | errormessage << "sqlite_bind_blob returned error: " << status; |
| 754 | this->SetLastErrorText(errormessage.str().c_str()); |
| 755 | vtkErrorMacro(<< this->GetLastErrorText()); |
| 756 | return false; |
| 757 | } |
| 758 | return true; |
| 759 | } |
| 760 | |
| 761 | //------------------------------------------------------------------------------ |
| 762 |
no test coverage detected