[Qt-interest] Multiple Prepare in QtSql

Will Rutherdale (rutherw) rutherw at cisco.com
Wed Oct 28 16:26:28 CET 2009


Hi.

In Qt 4.5, the QSqlQuery class in the QtSql module contains a prepare()
method.  I have tried it (against an SQLite database) and found it
worked fine.  However, it only gives one handle.

>From my experience with various RDBMSs (database systems), and from
years of experience using the Perl DBI library, I am used to being able
to issue multiple prepare statements.  In the Perl DBI interface, you
are given a statement handle for each prepare statement, and you call
execute() against each statement handle.  Multiple statement handles can
be open at the same time.

In QSqlQuery it is different.  The prepare() method only returns bool,
not a statement handle.  As far as I can tell this means that I can only
have one open statement handle at a time.  With one use case I am
looking at this is a severe limitation, as I ideally want to have eight
statement handles open at a time.

Does anybody know if there is a way around this limitation?  Will Qt 4.6
address this problem?

-Will




More information about the Qt-interest-old mailing list