Database Toolbox User's Guide
  Go to function:
    Search    Help Desk 
attr    Examples   See Also

Get attributes of columns in fetched data set

Syntax

Description

attributes = attr(cursor, column) gets attribute information for the specified column in the fetched data set, cursor.

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

The returned attributes are:

columnName
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 cursorA, and assign them to attrA:

View the attributes of column 4:

MATLAB returns the attributes of column 4:

See Also

cols, columnnames, fetch, width

[ Previous | Help Desk | Next ]