User`s guide

Inserting Data Using the Command Line
2-197
Inserting Data Using the Command Line
You can use datainsert, fastinsert, or insert to insert data using the command
line. To understand which function is best for your purposes and setup, see this table.
datainsert fastinsert insert
Methodology Creates a single
parameterized query
and performs a batch
insert for all rows of
data at once
Creates a single
parameterized query
and performs a batch
insert for all rows of
data at once
Creates an SQL
insert query for each
row of data
Input data format Matrix, cell array Matrix, cell array,
structure, dataset
array, table
Matrix, cell array,
structure, dataset
array, table
Input data size Large Large Small
Special formatting Special formatting
is required for dates
and timestamps,
null and NaN.
Special formatting
is required for dates
and timestamps.
Special formatting
is required for dates
and timestamps.
JDBC performance Fastest Fast. Use if
datainsert is not
an option.
Slow. Use only if
datainsert and
fastinsert are not
options.
Native ODBC
performance
Not supported Fast Fast
If you still experience performance issues using these functions, then use the bulk insert
functionality of your database. For details, see “Exporting Data Using Bulk Insert”.
To fetch data in your database, use the exec and fetch functions.