On Mittwoch 24 März 2010, bar tomas wrote:
> Hi,
> QSqlQuery's size method gives the number of rows retrieved
> with a query. But is there some way to get the number of
> fields (columns) of that query?
> Many thanks.

if self.query.isSelect():
  record = self.query.record()
  qFields = [record.field(x) for x in range(record.count())]

-- 
Wolfgang
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to