dbGetPrimaryIndex#
Purpose#
Returns the primary index for the specified table.
Format#
- primary_index = dbGetPrimaryIndex(db_id, table_name)#
- Parameters:
db_id (scalar) – database connection index number.
table_name (string) – name of the table to reference.
- Returns:
primary_index (2x1 string array) – the \([1,1]\) element is the cursor name and the \([2,1]\) element is the index name
Examples#
// Add MySQL to the list of database connections
db_id = dbAddDatabase("MYSQL");
dbSetDatabaseName(db_id, "mydb");
dbOpen(db_id);
// Get the primary index for the 'orders' table
idx = dbGetPrimaryIndex(db_id, "orders");
print idx;