User`s guide
read
7-73
read
Read data in DatabaseDatastore
Syntax
data = read(dbds)
data = read(dbds,rowcount)
[data,info] = read( ___ )
Description
data = read(dbds) retrieves data from the DatabaseDatastore object in increments
specified using setdbprefs and in the format specified using setdbprefs.
data = read(dbds,rowcount) retrieves data from the DatabaseDatastore object in
increments specified by rowcount and in the format specified using setdbprefs.
[data,info] = read( ___ ) retrieves data from the DatabaseDatastore object
using the input arguments in the previous syntaxes.
Examples
Retrieve Data
The default output data type of any datastore is a table. Set the database preference
for the data return format 'DataReturnFormat' to table for consistency across data
types.
setdbprefs('DataReturnFormat','table')
Create a database connection conn using the native ODBC interface with Windows
Authentication. This code assumes you are connecting to a Microsoft SQL Server
database with the data source named MS SQL Server Auth. MS SQL Server Auth
contains the table named productTable with 15 product records.
conn = database.ODBCConnection('MS SQL Server Auth','','');