Method
Database_Class.IndexSchema
Warning
This item was deprecated in version 2019r2. Please use Database.TableIndexes as a replacement.
Description
Returns a RowSet containing the list of indexes for the passed TableName. Returns Nil if the table has no indexes or the database source does not support indexes.
Notes
The RowSet returns one row for each index on the table and it has one field: IndexName As String.
The RecordSet result has a single column: * IndexName: A string containing the name of the index.
Sample code
This code displays the indexes for the "Invoices" table (if it exists) in the specified SQLite database:
Dim dbFile As FolderItem
dbFile = GetOpenFolderItem("")
If dbFile <> Nil Then
Dim db As New SQLiteDatabase
If db.Connect Then
Dim indexRS As RecordSet
indexRS = db.IndexSchema("Invoices") ' A table with indexes in the SQLite DB
If indexRS <> Nil Then
While Not indexRS.EOF
MsgBox("Index: " + indexRS.IdxField(1).StringValue)
indexRS.MoveNext
Wend
indexRS.Close
End If
End If
End If
Compatibility
All project types on all supported operating systems.