Xbasic

SQL::IndexInfo Class

Description

A list of properties and methods in the IndexInfo class.

A SQL::IndexInfo object (an index description) is a container for one or more SQL::IndexColumnInfo objects (column descriptions for indexes). Each table in a SQL database has one or more relationships, constraints or indexes. The primary key, foreign keys, and unique and non-unique indexes are each described by a SQL::IndexInfo instance. The SQL::IndexInfo object contains a list of those indexes.

dim conn as SQL::Connection
dim ti as SQL::TableInfo
dim ii as SQL::IndexInfo
dim ic as SQL::IndexColumnInfo
dim connString as C
connString = "{A5API='Access', FileName='c:\program files\a5v7\mdbfiles\alphasports.mdb'}"
if .not. conn.open(connString) then
    end
end if
ic.name = "lastname"
ii.AddColumn(ic)
ii.unique = .f.
ti.name = "customer"
conn.CreateIndex(ti, ii)
conn.close()

Properties

XMLCharacter

The schema in XML format.

NameCharacter

Default = "". The unique name of the table. Note: The table must be unique for the owner, but does not need to be globally unique.

CommentCharacter

Default = "". The comment stored for the table (if the database supports it).

UniqueLogical

Default = TRUE (.T.). True if this is a unique index.

PrimaryKeyLogical

Default = FALSE (.F.). True if the index is the primary key for this table.

ReferenceLogical

Default = FALSE (.F.). True if this is a foreign key.

GroupingReferenceLogical

GroupingReference property

ClusteredLogical

Clustered property

ReferenceTableCharacter

Default = "". For foreign keys only. The name of the table the index is assigned to.

ReferenceTableCatalogCharacter

ReferenceTableCatalog property

ReferenceTableSchemaCharacter

ReferenceTableSchema property

ReferenceTableOwnerCharacter

Default = "". For foreign keys only. The owner name of the referenced table.

IndexMethodCharacter

Default = "". The database specific indexing method.

ColumnSQL::IndexColumnInfo[]

An array of the column definitions ( SQL::IndexColumnInfo ) for the index.

DeleteRuleNumeric

Default = 0. The options are:

  • 0 = Restrict
  • 1 = Cascade
  • 2 = SetNull
  • 3 = SetDefault
UpdateRuleNumeric

Default = 0. The options are:

  • 0 = Restrict
  • 1 = Cascade
  • 2 = SetNull
  • 3 = SetDefault

Methods

AddColumn Method

Add a Column.

Clone Method

Create a copy of an object instance.

InsertColumn Method

Insert a new Column.

See Also