DB::DBResult
Constructors
- DBRes([[DB::DBValue]] table,Int rows,Int cols,[String] colnames,Ptr resptr)
Usage
DBResult holds data about the result of a query.
tablegives the result of the query. It will usually be empty for non-SELECT queries.rowsis the number of rows in the result set.colsis the number of columns in each row of the result set.colnamesis a list of the names of the columnsresptris an internal pointer kept by the relevant database interface.
res = exec(conn,"SELECT id,name FROM People");
if (res.rows > 0) {
for row in res.table {
// row[0] = DBInt(id)
// row[1] = DBText(name)
}
}