Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Returns the ID of the primary index for the table.
Syntax
public IndexId primaryIndex([boolean asDefinedInAOT])
Run On
Called
Parameters
- asDefinedInAOT
Type: boolean
A Boolean value that indicates whether the primary index to retrieve is defined in the AOT. A value of true returns the primary index as defined in the AOT. A value of false returns the primary index as defined in the SQL table; optional.
Return Value
Type: IndexId Extended Data Type
The ID of the primary index for the table; 0 (zero) if there is no primary index for the table.
Examples
The following example shows the retrieval of the primary index for a table.
DictTable dt;
DictIndex di;
int i;
dt = new DictTable(tablenum(CustTable));
if (dt)
{
i = dt.primaryIndex();
if (0 != i)
{
di = new DictIndex(tablenum(CustTable), i);
print di.name();
}
}