SQLITE错误:无法重置虚拟机
Sqlite error: Could not reset the virtual machine
我正在尝试从CSV文件读取,并将每一行添加到C 中的数据库中。CSV文件以id,firstname,surname,job
的形式我的代码是:
while (file.good())
{
getline (file, id, ',');
getline (file, firstname, ',');
getline (file, surname, ',');
getline (file, job, ' ');
cur->set_sql( "INSERT INTO staff VALUES (?, ?, ?, ?);" );
cur->prepare();
cur->bind(1, id);
cur->bind(2, firstname);
cur->bind(3, surname);
cur->bind(4, job);
cur->step();
cur->reset();
}
但是,当我运行代码时,它返回错误 Sqlite error: Could not reset the virtual machine.
,我不明白这意味着什么或如何解决。我在Google上搜索了错误,但我找不到任何内容
错误来自 libsqlite.hpp
(在github.com上检查搜索搜索(
void reset(){
int rc = sqlite3_reset(this->_s);
if (rc != SQLITE_OK) {
exception e("Could not reset the virtual machine.");
throw e;
}
this->_valid = true;
this->_has_row = false;
this->_prepared = false;
}
我还没有挖掘此操作,但看起来SQILTE查询包含错误或无法运行。
我发现了如何解决此错误。我意识到自己正在使用虚拟机上编程,我要做的就是重新启动它。我的代码没有错!
相关文章:
- 尝试将unique_ptrs推送到向量时使用纯虚拟函数错误
- OpenGL 在 VMWare Fusion 版本 10.1.3 上安装的虚拟机 (Ubuntu 16.04) 上崩溃
- 二叉搜索树 - 使用 Linux 在虚拟机中制作删除功能
- QT信号在虚拟机中不连接
- 如何将双精度类型的鼠标移动 x 和 y 从主机传递到 Qemu 中的虚拟机
- SQLITE错误:无法重置虚拟机
- CMake 构建错误 - 虚拟方法错误缺少 vtable
- C++如何检测您的应用程序正在运行的虚拟机已成为焦点
- SSE2 矢量化和虚拟机
- 在技术上是否可以创建 Java 虚拟机的映像文件并使用它来更快地启动 Java 应用程序
- LLVM是典型的虚拟机
- Jace:: 虚拟机关机错误
- 两个 C++ 可执行对象之间的实时数据通信,一个是 Windows 和另一个在虚拟机 Ubuntu 中
- 将临时对象保留在寄存器上以避免虚拟机中的额外存储/加载
- Delphi和C++类虚拟机兼容吗
- 对于虚拟机,哪种调度方法更有效
- NDK:0xdeadd00d时虚拟机中止和致命信号 11 (SIGSEGV) 的问题(代码 = 1)
- Qt on Android - C++代码是否在 Dalvik 虚拟机中运行
- modern.ie 从网站中提取虚拟机 JSON 数据
- 如何为虚拟机创建二进制文件