cursor
(Not recommended) Database cursor
The cursor
object is not recommended. Use the fetch
function instead. For details, see Version History.
The scrollable cursor functionality has no replacement.
Description
After connecting to a relational database using either ODBC or JDBC drivers,
you can perform actions using the database connection. To import data into MATLAB® from a database and perform database operations, you must create a
cursor
object. Database Toolbox™ uses this object to retrieve rows from database tables and execute SQL
statements.
There are two types of database cursors, basic and scrollable. Basic cursors let you import data in an SQL query in a sequential way. However, scrollable cursors enable data import from a specified offset in the data set.
To import data quickly using a SQL SELECT
statement, use the
select
function. To import data with
full functionality, use the exec
and fetch
functions. For differences, see Data Import Using Database Explorer App or Command Line.
A cursor
object stays open until you close it using the close
function.
Creation
Create a cursor
object using the exec
function.
Properties
Object Functions
Examples
Version History
Introduced before R2006aSee Also
close
| database
| fetch
| setdbprefs