You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.
for mysql, and mssql this is done with query.nextResult()
QSqlQuery query(db);
QString out = "";
if (!query.exec("select 42 as a; select 1 as b;"))
{
out = "query.exec fail\n" + query.lastError().text();
ui->plainTextEdit->setPlainText(out);
return;
}
out = "ok";
while (query.next())
{
out += "\n" + query.record().fieldName(0) + "=" + QString::number(query.record().value(0).toInt());
}
while (query.nextResult())
{
out += "\n--- nextResult ---";
while (query.next())
{
out += "\n" + query.record().fieldName(0) + "=" + QString::number(query.record().value(0).toInt());
}
}
out += "\ndone";
ui->plainTextEdit->setPlainText(out.trimmed());
but does not work for other databases
sqlite: error
postgres executes both, returns last result
looks like postgres may be adding support in the future but for now you would have to parse the sql, extract the statements, and run them one at a time.
but for now you would have to parse the sql, extract the statements, and run them one at a time.
nope. :)
i dont think this would be a good idea since we even now dont support basic querying, to much work for something that will be solved by postgres soon-ish. in this case, just take whatever is returned (i.e. last statement).
multiple result sets should be taken into account for further development though.
thanks for testing it all out 👍
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
in mssql management studio, several queries can be executed and several result sets can be displayed at once.
to be considered if this can be implemented
examples:
The text was updated successfully, but these errors were encountered: