MATLAB DATABASE TOOLBOX RELEASE NOTES User's Guide Page 432

  • Download
  • Add to my manuals
  • Print
  • Page
    / 684
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 431
7 Functions — Alphabetical List
7-2
attr
Retrieve attributes of columns in fetched data set
Syntax
attributes = attr(curs)
attributes = attr(curs,colnum)
Description
attributes = attr(curs) retrieves attribute information for all columns in the
fetched data set curs.
attributes = attr(curs,colnum) retrieves attribute information for the column
number colnum in the fetched data set curs.
Examples
Retrieve Attribute Data for a Fetched Data Set
Connect to an Oracle database using an ODBC connection. This code assumes that
you are connecting a data source named dbname with user name username and
password pwd. The data source identifies an Oracle database that contains the table
inventoryTable with these columns: productNumber, Quantity, Price, and
inventoryDate.
conn = database(dbname,username,pwd);
Fetch all the data from the table inventoryTable into a fetched data set curs.
curs = exec(conn,'select * from inventoryTable');
curs = fetch(curs);
Retrieve attribute information for all the fetched data curs.
attributes = attr(curs)
Page view 431
1 2 ... 427 428 429 430 431 432 433 434 435 436 437 ... 683 684

Comments to this Manuals

No comments