1

I created a QSqlQuery to get some value from an in-memory database, which been set by

setDatabaseName(":memory:")

When I execute the query, it gives me a QSqlError

QSqlError("", "Unable to fetch row", "No query")

However, when I change the database to be a file database by simply just set name to be "test.sqlite" for example, the query works perfectly without any changes.

Does anyone have any idea why this situation happened? Are there are any difference I need to know to set the query for in-memory database?

Jason Lei
  • 47
  • 4

0 Answers0