mustermann.klaus@gmx.de
10th March 2018, 18:39
Hallo,
I do
qDebug() << "ID" << id;
qDebug() << query->isActive() << query->isSelect() << query->seek(id, false) << query->record();)
and I retrieve
ID 75
true true true QSqlRecord(29)
Why is that?
My aim is to retrieve a specific record at a known ID. My approach was all easy: thought instead of digging through all the query using
query->next()
it was better to say
query->seek(id)
But obviously I don't understand the methode. Anybody here to help me out?
Thanks, Lars
Added after 8 minutes:
update: ok, 29 is the length of the record I try to readout.
But what about
qDebug() << "ID" << id;
qDebug() << query->isActive() << query->isSelect() << query->seek(id, false) << query->at();
returns
ID 74
true true true 110
I do
qDebug() << "ID" << id;
qDebug() << query->isActive() << query->isSelect() << query->seek(id, false) << query->record();)
and I retrieve
ID 75
true true true QSqlRecord(29)
Why is that?
My aim is to retrieve a specific record at a known ID. My approach was all easy: thought instead of digging through all the query using
query->next()
it was better to say
query->seek(id)
But obviously I don't understand the methode. Anybody here to help me out?
Thanks, Lars
Added after 8 minutes:
update: ok, 29 is the length of the record I try to readout.
But what about
qDebug() << "ID" << id;
qDebug() << query->isActive() << query->isSelect() << query->seek(id, false) << query->at();
returns
ID 74
true true true 110