This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Map resultset column name to resultset column index

namecolumn will be removed in a future release.


x = namecolumn(rset,n)


x = namecolumn(rset,n) maps a resultset column name n to its resultset column index. rset is the resultset and n is a character vector or cell array of character vectors containing the column names.


  1. Get the indices for the column names DNAME and LOC resultset object rset.

    x  =  namecolumn(rset, {'DNAME';'LOC'})
    x =
         2     3

    The results show that DNAME is column 2 and LOC is column 3.

  2. Get the index only for the LOC column.

    x  =  namecolumn(rset, 'LOC')

Related Examples

Introduced before R2006a

Was this topic helpful?