dbGetTableHeaders#
Purpose#
Returns a string array populated with the names of all the fields in a specified table (or view).
Format#
- field_names = dbGetTableHeaders(db_id, table_name)#
- Parameters:
db_id (scalar) – database connection index number.
table_name (string) – name of table or view.
- Returns:
field_names (string array) – containing the column names for the specified table or view.
Remarks#
The order in which the fields appear in the record is undefined.
Examples#
// Add MySQL to the list of database connections
db_id = dbAddDatabase("MYSQL");
dbSetDatabaseName(db_id, "mydb");
dbOpen(db_id);
// Get the column names for the 'customers' table
headers = dbGetTableHeaders(db_id, "customers");
print headers;