mcosta
9th March 2011, 19:21
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) {
...
}
writing this code
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)) {
...
}
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
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) {
...
}
writing this code
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)) {
...
}
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