[Qt-interest] QSqlQuery::bindValue() not working...

Jason H scorp1us at yahoo.com
Fri Nov 20 06:55:45 CET 2009


Oh wait, you need to look at bounndValues().
You'll never get the actual SQL statement back, because the prepare sets up a paramterized statement that you can just then repeat with different data using batches. This is faster because it will not cause the SQL statment to be recompiled. 






----- Original Message ----
From: Hong Jiang <kmldqj at gmail.com>
To: qt-interest <qt-interest at trolltech.com>
Sent: Fri, November 20, 2009 12:27:52 AM
Subject: [Qt-interest] QSqlQuery::bindValue() not working...

Hi,

I cannot seem to get QSqlQuery::bindValue() to work. To figure out
what's wrong, I wrote a small test. The snippet is at:
http://gist.github.com/239305
The output of the test is:
"INSERT INTO testtable (title, url) VALUES (?, ?);"
The two bindValue() calls didn't seem to do anything.

Could anyone give me some pointers? Thanks!

--Hong
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



      




More information about the Qt-interest-old mailing list