1DB.DBResult(3kaya) Kaya module reference DB.DBResult(3kaya)
2
3
4
6 DB::DBResult - A query result
7
9 DB::DBResult< >
10
11
12 = DBRes([[DB::DBValue]] table,Int rows,Int cols,[String] colnames,Ptr
13 resptr)
14
16 DBResult holds data about the result of a query.
17
18
19 - table gives the result of the query. It will usually be empty for non-
20 SELECT queries.
21
22
23 - rows is the number of rows in the result set.
24
25
26 - cols is the number of columns in each row of the result set.
27
28
29 - colnames is a list of the names of the columns
30
31
32 - resptr is an internal pointer kept by the relevant database interface.
33
34
35 res = exec(conn,"SELECT id,name FROM People");
36 if (res.rows > 0) {
37 for row in res.table {
38 // row[0] = DBInt(id)
39 // row[1] = DBText(name)
40 }
41 }
42
44 Kaya standard library by Edwin Brady, Chris Morris and others
45 (kaya@kayalang.org). For further information see http://kayalang.org/
46
48 The Kaya standard library is free software; you can redistribute it
49 and/or modify it under the terms of the GNU Lesser General Public
50 License (version 2.1 or any later version) as published by the Free
51 Software Foundation.
52
54 DB.DBIncResult (3kaya)
55 DB.DBValue (3kaya)
56 DB.exec (3kaya)
57
58
59
60Kaya December 2010 DB.DBResult(3kaya)