Hello friends i have a small problem in retrieving data from a sql database. I am able to save data into the table and even retrieve it in other parts of my program. But in this place i am having a sql error .
for(int i=0; i <dbrowcount.count();i++)
{
if((dbrowcount.at(i)>0)&&(dbrowcount.at(i)<33))
{
deletenum = dbrowcount.at(i);
QSqlQuery sqp
("SELECT Box1 FROM tempBulkdb rowid ="+ QString::number(deletenum
));
if(sqp.exec())
{
if (sqp.first())
{
do
{
boxtempchn.push_back(sqp.value(0).toString());
} while(sqp.next());
}
}
qDebug()<< sqp.lastError().text();
qDebug()<<boxtempchn;
}
for(int i=0; i <dbrowcount.count();i++)
{
if((dbrowcount.at(i)>0)&&(dbrowcount.at(i)<33))
{
deletenum = dbrowcount.at(i);
QSqlQuery sqp("SELECT Box1 FROM tempBulkdb rowid ="+ QString::number(deletenum));
if(sqp.exec())
{
if (sqp.first())
{
do
{
boxtempchn.push_back(sqp.value(0).toString());
} while(sqp.next());
}
}
qDebug()<< sqp.lastError().text();
qDebug()<<boxtempchn;
}
To copy to clipboard, switch view to plain text mode
dbrowcount has the row number and the size of the list. I have 10 nested else if condition i have put only the first condition , i am testing the first condition only now.
i get a sql error. I don't know if i am doing any thing wrong.
This is the Sql Error i am getting.
No query Unable to fetch row
No query Unable to fetch row
To copy to clipboard, switch view to plain text mode
thank you
Bookmarks