User`s guide

runsqlscript
7-201
runsqlscript
Run SQL script on database
Syntax
results = runsqlscript(connect,sqlfilename)
results = runsqlscript(connect,sqlfilename,Name,Value)
Description
results = runsqlscript(connect,sqlfilename) runs the SQL commands in the
file sqlfilename on the connected database, and returns a cursor array.
results = runsqlscript(connect,sqlfilename,Name,Value) uses additional
options specified by one or more Name,Value pairs.
Examples
Run SQL Script
Run SQL commands from a file on a connected data source.
To get the file of SQL commands, navigate to \toolbox\database\dbdemos
\compare_sales.sql in your MATLAB root folder, or copy and paste the path into
your current working folder.
Create the connection object to the data source, dbtoolboxdemo.
conn = database('dbtoolboxdemo','','');
User names and passwords are not required for this connection.
Run the SQL script, compare_sales.sql.
results = runsqlscript(conn,'compare_sales.sql')
results =