Class

iOSSQLiteRecordSet


Warning

This item was deprecated in version 2020r2. Please use RowSet as a replacement.

Description

An iOSSQLiteRecordSet is a group of iOSSQLiteDatabase rows and is the result of a SELECT statement.

Properties

Name

Type

Read-Only

Shared

BOF

Boolean

EOF

Boolean

FieldCount

Integer

Methods

Name

Parameters

Returns

Shared

Close

ColumnType

index As Integer

Integer

Field

name As String

RowSet

index As Integer

RowSet

IdxField

index As Integer

RowSet

MoveFirst

MoveLast

MoveNext

MovePrevious

RecordCount

Integer

Property descriptions


iOSSQLiteRecordSet.BOF

BOF As Boolean

Indicates if the RecordSet is pointing before the first row.

This property is read-only.


iOSSQLiteRecordSet.EOF

EOF As Boolean

Indicates if the RecordSet is pointing after the last row.

This property is read-only.


iOSSQLiteRecordSet.FieldCount

FieldCount As Integer

The number of columns in the RecordSet data.

This property is read-only.

Method descriptions


iOSSQLiteRecordSet.Close

Close

Closes the RecordSet.


iOSSQLiteRecordSet.ColumnType

ColumnType(index As Integer) As Integer

Identifies the type of the specific column index (0-based).

SQLite uses type affinities rather than fixed data types. This method returns the affinity of a column, but you can still store any value in the column regardless of its type.

Value

Type

Description

0

Null

Denotes the absence of any value, i.e., a missing value.

1

Byte

Stores the byte representation of a character string.

2

SmallInt

A numeric data type with no fractional part. The maximum number of digits is implementation-specific, but is usually less than or equal to INTEGER. SQLite supports 4-byte smallints. If you are using another data source, check the documentation of your data source.

3

Integer

A numeric data type with no fractional part. The maximum number of digits is implementation-specific. SQLite supports 8-byte integer columns and the FieldType evaluates to 19 (64-bit integer).

4

Char

Stores alphabetic data, in which you specify the maximum number of characters for the field, i.e., CHAR(20) for a 20 character field. This works the same as Text or VarChar in SQLite.

5

Text or VarChar

Stores alphabetic data, in which the number of characters vary from record to record, but you don't want to pad the unused characters with blanks.

6

Float

Stores floating-point numeric values with a precision that you specify, i.e., FLOAT(5). The precision is not used with SQLite.

7

Double

Stores double-precision floating-point numbers.

8

Date

Stores year, month, and day values of a date in the format YYYY-MM-DD. The year value is four digits; the month and day values are two digits.

9

Time

Stores hour, minute, and second values of a time in the format HH:MM:SS. The hours and minutes are two digits. The seconds values is also two digits, may include a optional fractional part, e.g., 09:55:25.248. The default length of the fractional part is zero.

10

TimeStamp

Stores both date and time information in the format YYYY-MM-DD HH:MM:SS. The lengths of the components of a TimeStamp are the same as for Time and Date, except that the default length of the fractional part of the time component is six digits rather than zero. If a TimeStamp values has no fractional component, then its length is 19 digits If it has a fractional component, its length is 20 digits, plus the length of the fractional component.

11

Currency

This is a 64-bit fixed-point number format that holds 15 digits to the left of the decimal point and 4 digits to the right.

12

Boolean

Stores the values of TRUE or FALSE.

13

Decimal

tores a numeric value that can have both an integral and fractional part. You specify the total number of digits and the number of digits to the right of the decimal place, i.e., DECIMAL (5.2) specifies a decimal field that can contain values up to 999.99. DECIMAL (5) specifies a field that can contain values up to 99,999.

14

Blob

Stores code, images, and hexadecimal data.

15

Blob

Stores a text object.

16

Blob

Stores a binary object. SQLite supports blobs of up to any size. Furthermore, a blob can be stored in a column of any declared data affinity.

19

Int64

Stores a 64-bit integer. Integer fields in SQLite are 64-bits and FieldType returns 19.

255

Unknown

Unrecognized data type.


iOSSQLiteRecordSet.Field

Field(name As String) As RowSet

Gets the SQLiteDatabaseField information for the specified column index (0-based).


iOSSQLiteRecordSet.Field

Field(index As Integer) As RowSet

Gets the SQLiteDatabaseField information for the specified column index (0-based).

' results is an iOSSQLiteRecordSet
Var address As Text
address = results.Field("Address").TextValue

iOSSQLiteRecordSet.IdxField

IdxField(index As Integer) As RowSet

Gets the SQLiteDatabaseField information for the specified column index (0-based).


iOSSQLiteRecordSet.MoveFirst

MoveFirst

Moves the RecordSet pointer to the first row of the RecordSet.


iOSSQLiteRecordSet.MoveLast

MoveLast

Moves the RecordSet pointer to the last row in the RecordSet.


iOSSQLiteRecordSet.MoveNext

MoveNext

Moves the RecordSet pointer to the next row in the RecordSet. If the pointer was at the last row, then this moves the pointer to EOF.


iOSSQLiteRecordSet.MovePrevious

MovePrevious

Moves the RecordSet pointer to the previous row in the RecordSet. If the pointer was at the first row, then this moves the pointer to BOF.


iOSSQLiteRecordSet.RecordCount

RecordCount As Integer

The number of rows in the RecordSet.

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 results 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

Compatibility

iOS projects on the iOS operating system.

See also

Object parent class; SQLiteDatabase, RowSet, DatabaseException classes