Database Toolbox Previous page   Next Page
attr

Get attributes of columns in fetched data set

Syntax

Description

attributes = attr(curs, colnum) retrieves attribute information for the specified column number colnum, in the fetched data set curs.

attributes = attr(curs) retrieves attribute information for all columns in the fetched data set curs, and stores it in a cell array. Use attributes(colnum) to display the attributes for column colnum.

The returned attributes are listed in the following table.

Attribute
Description
fieldName
Name of the column
typeName
Data type
typeValue
Numerical representation of the data type
columnWidth
Size of the field
precision
Precision value for floating and double data types; an empty value is returned for strings
scale
Precision value for real and numeric data types; an empty value is returned for strings
currency
If true, data format is currency
readOnly
If true, the data cannot be overwritten
nullable
If true, the data can be NULL
Message
Error message returned by fetch

Examples

Example 1--Get Attributes for One Column

Get the column attributes for the fourth column of a fetched data set.

Example 2--Get Attributes for All Columns

Get the column attributes for curs, and assign them to attributes.

View the attributes of column 4.

MATLAB returns the attributes of column 4.

See Also
cols, columnnames, columns, dmd, fetch, get, tables, width


Previous page  Functions -- Alphabetical List bestrowid Next page

© 1994-2005 The MathWorks, Inc.