DBSqlite
BlitzMax Forums/Brucey's Modules/DBSqlite
| ||
Sorry if this may have been answered somewhere, I had searched the forums for a while and didn't come up with anything. Curious if there is a "results" method/function? For example; local q:tdatabasequery = db.executequery("SELECT * FROM blah") ' for example "q.results()" if q.results() > 0 '..do whatever else print "No records found." endif Thanks. |
| ||
look into the tests folder in the dbsqlite.mod directory, there are some examples for using it like:Local query:TDatabaseQuery = db.executeQuery("SELECT * from person") If db.hasError() Then errorAndClose(db) End If While query.nextRow() Local record:TQueryRecord = query.rowRecord() DebugLog("Name = " + TDBString(record.value(1)).value + " " + TDBString(record.value(2)).value) Wend |
| ||
Sorry, I should have been more clear. An example like "q.results()" to return how many results were retrieved from the database after a SELECT query. |
| ||
hm, as far as I know the rowcount is not set by sqllite, so you only now the number of rows returned only if you iterate over them and count them. [edit] but you can do a sql query with an count() and determine this way the number of data ;) |
| ||
Bah, didn't think of that, thanks Kurator. |