All pastes #509979 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-25 18:40 UTC
rendered paste body
*sql_query = defaultDB.exec(query);
    if(sql_query->size() <= 0)
    {
        qDebug("could not execute query");
        qWarning(defaultDB.lastError().text().toLatin1().data() );
        exit(1);
    } else {
        qDebug("query executed");
        idx = 0;
        rec = sql_query->record();
        countCol = rec.indexOf("count");
        vpCol = rec.indexOf("vp_total");
        hpCol = rec.indexOf("hp_total");
        qDebug("cols = %d", rec.count());
        qDebug("rows = %d", sql_query->size());
        while(sql_query->next())
        {
            qDebug("%d: count:%d  vp:%d  hp%d", idx++, sql_query->value(countCol).toInt(), sql_query->value(vpCol).toInt(), sql_query->value(hpCol).toInt());
        }
        exit(0);
    }