| Database Toolbox | ![]() |
Map resultset column name to resultset column index
Syntax
x = namecolumn(rset, n)
Description
x = namecolumn(rset, n)
maps a resultset column name n, to its resultset column index, for the resultset rset, where rset was created using resultset, and n is a string or cell array of strings containing the column names. Get the column names for a given cursor using columnnames.
Examples
x = namecolumn(rset, {'DNAME';'LOC'})
x =
2 3
In this example, the resultset object is rset. The column names for which you want the column index are DNAME and LOC. The results show that DNAME is column 2 and LOC is column 3.
To get the index for only the LOC column, type
x = namecolumn(rset, 'LOC')
See Also
| logintimeout | ping | ![]() |