11QSqlQuery q(
"select * from employees");
12QSqlRecord rec = q.record();
14qDebug() <<
"Number of columns: " << rec.count();
16int nameCol = rec.indexOf(
"name");
18 qDebug() << q.value(nameCol).toString();
22q.prepare(
"insert into myTable values (?, ?)");
25ints << 1 << 2 << 3 << 4;
29names <<
"Harald" <<
"Boris" <<
"Trond" << QVariant(QMetaType::fromType<QString>());
33 qDebug() << q.lastError();