Odbc Toolkit - connection.select


: data = select (conn, query)
: data = select (conn, query, propertyname, propertyvalue …)

Perform SQL query query, and return result

Inputs

conn

currently open database connection.

query

String containing a valid select SQL query.

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 tables

 
 # create sql connection
 db = database("default", "", "");
 data = fetch(db, 'SELECT * FROM TestTable');
 
 

Select 5 rows of data from a database tables

 
 # create sql connection
 db = database("default", "", "");
 data = fetch(db, 'SELECT * FROM TestTable', "MaxRows", 5);
 
 

See also: database, connection.