I'm using Python/SQLite for accessing database. After running the query, and getting the result, I want to know the number of rows, the number of columns, and the name of the column from the queried result and database.
For example if I run "SELECT * from table", and I get
id name number -------------------- 1 John 10 2 Jay 20
I can I know that I have 2 rows, and 3 columns, and the number of columns are id/name/number?
ADDED
Based on Rafael SDM Sierra's answer, I could get the info as follows.
description = self.cursor.description
qr.numberOfCol = len(description) <-- # of column
for item in description:
qr.names.append(item[0]) <-- Names of column
count = 0
for row in self.cursor:
count += 1
qr.result.append(row)
qr.numberOfRow = count <-- # of row