Odbc Toolkit - connection.sqlread


: data = sqlread (conn, tablename)
: data = sqlread (conn, tablename, propertryname, propertyvalue)

Read data from table tablename

Return rows of data from table tablename in a database. This function is the equivalent of running SELECT * FROM table.

Inputs

conn

currently open database.

tablename

Name of a table with the database.

propertyname, propertyvalue

property name/value pairs where known properties are:

MaxRows

Integer value of max number of rows in the query

VariableNamingRule

String value ’preserve’ (default) or ’modify’ to flag renaming of variable names (currently ignored)

RowFilter

rowfilter object to filter results

Outputs

data

a table containing the query result.

Examples

Select all rows of data from a database table

 
 # create sql connection to an existing database
 db = database("default", "", "");
 data = sqlread(db, 'TestTable');
 
 

Select 5 rows of data from a database table

 
 # create sql connection
 db = database("default", "", "");
 data = sqlread(db, 'TestTable', "MaxRows", 5);
 
 

See also: database, fetch.