Qt-interest Archive, March 2002
SQL Parameters?
Message 1 in thread
Does anyone know how to create a QSqlQuery (or maybe I need to use a different class) with parameters and then use the same query with different data again and again, rather than having to build the query on the fly each time you execute it? I can't seem to find documentation or examples that use the parameter method rather than the dynamic query string method, and on queries that are executed many times, I am suffering severe performance penalties because of this.
Thank you,
James Hamilton
Systems/Software Engineer
Davis Tool, Inc.
Message 2 in thread
"James Hamilton" <JAMESH@davistl.com> writes:
> Does anyone know how to create a QSqlQuery (or maybe I need to use a
> different class) with parameters and then use the same query with
> different data again and again, rather than having to build the
> query on the fly each time you execute it? I can't seem to find
> documentation or examples that use the parameter method rather than
> the dynamic query string method, and on queries that are executed
> many times, I am suffering severe performance penalties because of
> this.
>
> Thank you,
> James Hamilton
> Systems/Software Engineer
> Davis Tool, Inc.
Sorry, but prepared queries and variable binding is not yet supported.
If it takes you long to actually generate the SQL for a query, you
could try to cache the generated SQL to see if that improves
performance.
--
[ signature omitted ]
Message 3 in thread
Well, that's a major drag. Thanks for your reply.
James
>>> Trond Kjernaasen <trond@trolltech.com> 03/10/02 12:24PM >>>
"James Hamilton" <JAMESH@davistl.com> writes:
> Does anyone know how to create a QSqlQuery (or maybe I need to use a
> different class) with parameters and then use the same query with
> different data again and again, rather than having to build the
> query on the fly each time you execute it? I can't seem to find
> documentation or examples that use the parameter method rather than
> the dynamic query string method, and on queries that are executed
> many times, I am suffering severe performance penalties because of
> this.
>
> Thank you,
> James Hamilton
> Systems/Software Engineer
> Davis Tool, Inc.
Sorry, but prepared queries and variable binding is not yet supported.
If it takes you long to actually generate the SQL for a query, you
could try to cache the generated SQL to see if that improves
performance.
--
[ signature omitted ]