Database Toolbox User's Guide
  Go to function:
    Search    Help Desk 

Viewing Information About the Imported Data

In this part of the tutorial, you view information about the data you imported and close the connection. You use these Database Toolbox commands:

If you want to see or copy the commands for this part of the tutorial, or if you want to run the set of commands, use the M-file matlab\toolbox\database\dbdemos\dbinfodemo.m.

   1.
If you are continuing directly from the previous part of the tutorial, skip this step. Otherwise, if the cursor and connection are not open, type the following to continue with this tutorial.
   2.
View the number of rows in the data set you imported - type:
rows returns the number of rows in the data set, which is 10.
   3.
View the number of columns in the data set - type:
cols returns the number of columns in the data set, which is one.
   4.
View the column names for the columns in the data set - type:
columnnames returns the names of the columns in the data set. In this example, there is only one column, and therefore only one column name, 'country', is returned.
   5.
View the width of the column (size of field) in the data set - type:
width returns the column width for the column number you specify. Here, the width of column one is 15.
   6.
You can use a single command to view multiple attributes for a column - type:
Note that if you had imported multiple columns, you could include a column argument to specify the column for which you want the information.
   7.
Close the cursor - type:
Always close a cursor when you are finished with it to avoid using memory unnecessarily and to ensure there are enough available cursors for other users.
   8.
At this point, you can go to the next part of the tutorial. If you want to stop working on the tutorial now and resume with the next part at a later time, close the connection. Type:


[ Previous | Help Desk | Next ]