[Qt-interest] QSqlQuery bindValue sqlite3

Andre Somers andre at familiesomers.nl
Sun Jan 16 17:18:49 CET 2011


Op 16-1-2011 17:03, Thiago Macieira schreef:
> On Sunday, 16 de January de 2011 01:17:21 Sylvain Pointeau wrote:
>>> Now please test all the other DBs before you file it as a bug.
>> I don't think the internal code is calling the native db api to bind
>> parameters.
>> (at least as far as I saw in the sqlite backend)
> My point is that the other DBs might. So the behaviour might exist in other
> DBs, which is why it's not allowed in the Qt API.
According to the openingpost, the native SqLite API even does this:
 > If I use the sqlite api, this example is working fine.

Sounds to me as if the Qt SQL driver is really to blame here. IMHO, it 
is not intuitive that binding to a named parameter does not bind to all 
instances of that named parameter. Qt SQL should either use the native 
facilities for this, or emulate it where not provided in the native API. 
It is not like that sort of thing does not happen for other aspects. I 
don't see why having this behaviour in other DB's prevents Qt from 
making sure all supported DB drivers work like this in Qt.

André




More information about the Qt-interest-old mailing list