iOSSQLiteRecordSet
From Xojo Documentation
Class (inherits from Object)
This class is supported on Mobile (iOS). Use #If...#Endif with the Target... constants to ensure you only use this class where it is supported. |
An iOSSQLiteRecordSet is a group of iOSSQLiteDatabase rows and is the result of a SELECT statement.
Properties | |||
|
Methods | |||||||||
|
Notes
You cannot use an iOSSQLiteRecordSet to modify the data it contains. Instead you'll need to use SQL statements with iOSSQLiteDatabase.SQLExecute.
Sample Code
Get the first column of data from the results of a table SELECT:
Var sql As Text
sql = "SELECT * FROM Team;"
Var data As iOSSQLiteRecordSet
Try
results = DB.SQLSelect(sql) ' DB is an existing, connected iOSSQLiteDatabase
Catch e As iOSSQLiteException
ErrorLabel.Text = e.Reason
Return
End Try
If results <> Nil Then
While Not results.EOF
TextArea1.Text = TextArea1.Text + Text.FromUnicodeCodepoint(10) + results.IdxField(0).TextValue
results.MoveNext
Wend
results.Close
End If
sql = "SELECT * FROM Team;"
Var data As iOSSQLiteRecordSet
Try
results = DB.SQLSelect(sql) ' DB is an existing, connected iOSSQLiteDatabase
Catch e As iOSSQLiteException
ErrorLabel.Text = e.Reason
Return
End Try
If results <> Nil Then
While Not results.EOF
TextArea1.Text = TextArea1.Text + Text.FromUnicodeCodepoint(10) + results.IdxField(0).TextValue
results.MoveNext
Wend
results.Close
End If
See Also
iOSSQLiteDatabase, iOSSQLiteDatabaseField, iOSSQLiteException classes