Mysql创建过程(创建语句)在qt
Mysql create procedure (create statement) inside qt
我需要一种方法来自动创建程序内我的qt代码。我的前辈说,目前在我们的qt库(4.7.3)的版本是不可能使用查询。exec函数。也许我可以使用qprocess?请给我一些建议。
http://www.qtcentre.org/threads/16287-Cannot-create-MySQL-stored-procedure-views-from-Qt这回答了我的问题。不要使用mysql分隔符(如$$)。并将drop和create分开执行。
QSqlQuery query;
QString command= "DROP PROCEDURE IF EXISTS PROC_X";
query.exec(command);
command = "CREATE PROCEDURE PROC_X";//(Just put your own statement there)
query.exec(command);
相关文章:
- Qt SQlite无法创建表
- 使用Qt框架在c ++类中创建API调用
- Qt creator 4.11,在应用程序输出面板中创建一个链接
- 无法使用 Visual Studio 2010 和 Qt 版本 4.8.0 创建"Qt Gui Application"
- 我可以使用自定义样板模板创建QT创建项目
- 多个线程,如何正确创建QT小部件
- 如何在不使用透明胶片的情况下创建Qt投影?(因为窗口管理器不支持)
- 如何创建QT标签悬停效应
- 当qt插件在Windows中不起作用时,如何在eclipse cdt中创建qt应用程序
- 错误 C2059:尝试在已知大小的头文件中创建 Qt 容器时为"常量"
- 如何使用命令行 qmake 创建 Qt GUI 或 QML/Qt 快速项目
- C++和QML的对象顺序创建QT
- 无法为 Symbian 设备创建 QT postgresql 插件
- 如何创建 QT 库对话框
- 无法在另一个对话框中创建 Qt 对话框
- 如何使用静态库创建QT控制台应用程序的Single exe,
- 如何创建Qt组合框
- 创建Qt插件和使用非虚拟函数
- 试图创建Qt 4.7 qstring,材料到数组的指针
- 创建qt线程事件循环