Hello,
Two [hopefully] quick questions regarding C++/Qt. Is the following proper for writing a string on multiple lines?
QString strQuery;
strQuery="\
CREATE TABLE foo\
(bar integer primary key,\
baz varchar(20))";
I believe this is right, but in Qt Creator it doesn't highlight as though it is one big string.
Secondly, will QSqlQuery.exec() run multiple queries in a single execution or does each query need to be run through exec()? For example, I'm trying something like:
QSqlQuery query;
QString strQuery;
strQuery="\
CREATE TABLE foo \
(bar integer primary key,\
baz varchar(10));\
CREATE TABLE herp\
(de integer primary key, \
derp varchar(10))";
query.exec(strQuery);
From what I can see, only that first table is being created. I don't know if this is related to my multiline string, to my database type (SQLite), or just QSqlQuery in general.
Thanks for the help!