User`s guide

insert
7-165
insert
Add MATLAB data to database tables
To export MATLAB data into a database, use these functions: insert, datainsert,
and fastinsert. For maximum performance, use datainsert. To use datainsert,
ensure that your input data is a cell array or numeric matrix with a specific format.
When your input data is a structure, dataset array, or table, or you are using a native
ODBC database connection, use fastinsert. If datainsert or fastinsert do not
work for you and you want to insert a small set of data, use insert.
For other differences among these functions, see “Inserting Data Using the Command
Line”.
insert supports the native ODBC interface. To insert dates and timestamps with the
native ODBC interface, use the format 'YYYY-MM-DD HH:MM:SS.MS'.
Syntax
insert(conn,tablename,colnames,data)
Description
insert(conn,tablename,colnames,data) exports records from the MATLAB
variable data into new rows in an existing database table tablename using the
connection conn.
Examples
Insert a Table Record Using Native ODBC
Create a connection conn using the native ODBC interface and the dbtoolboxdemo
data source. This data source identifies a Microsoft Access database. This database
contains the table productTable with these columns:
productNumber