Hi,
I'm porting a pure C++ application in Qt.
These application create a SQLITE database structure in one instruction
const char* sql =
"create table T1 (id INTEGER, name TEXT); \n"
"create table T2 (id INTEGER, name TEXT); \n";
int ans = sqlite_exec (db, sql, 0, 0, 0);
if (SQLITE_OK != ans) {
...
}
const char* sql =
"create table T1 (id INTEGER, name TEXT); \n"
"create table T2 (id INTEGER, name TEXT); \n";
int ans = sqlite_exec (db, sql, 0, 0, 0);
if (SQLITE_OK != ans) {
...
}
To copy to clipboard, switch view to plain text mode
writing this code
const char* sql =
"create table T1 (id INTEGER, name TEXT); \n"
"create table T2 (id INTEGER, name TEXT); \n";
if (!q.exec(sql)) {
...
}
const char* sql =
"create table T1 (id INTEGER, name TEXT); \n"
"create table T2 (id INTEGER, name TEXT); \n";
QSqlQuery q(db)
if (!q.exec(sql)) {
...
}
To copy to clipboard, switch view to plain text mode
QSqlQuery::exec returns true but only the first table is created.
I think this is a QSqlDriver limit.
Any suggestion?
PS. At the moment i resolved creating an array of query and executing them one a time
Bookmarks