int QString::toInt(bool *ok = 0, int base = 10) constfloat QString::toFloat(bool *ok = 0) constdouble QString::toDouble(bool *ok = 0) const
QString sSelectQueryText = QString("select from WOMANS where (AGE > %1) and (AGE < %2) and (NAME = %3)").arg(18).arg(25).arg("SEXY");
QSqlQuery query;query.prepare("select from WOMANS where (AGE > :AGE_MIN) and (AGE < :AGE_MAX) and (NAME = :NAME)");query.bindValue(":AGE_MIN", 18);query.bindValue(":AGE_MAX", 25);query.bindValue(":NAME", "SEXY");query.exec();
C++ (Qt)QSqlQuery query;for (int i = 0; i < 100000; i++) { query.exec(QString("insert into test (a, b) values (%1, %2)").arg(i).arg(i * 2));}
C++ (Qt)QSqlQuery query; query.prepare("insert into test (a, b) values (:a, :b)"); for (int i = 0; i < 100000; i++) { query.bindValue(":a", i); query.bindValue(":b", i * 2); query.exec();}