User`s guide
fastinsert
7-133
Use fastinsert to export the data into the yearlySales table.
fastinsert(conn,tablename,colnames,data)
fastinsert appends the data as a new record at the end of the yearlySales table.
In Microsoft Access, view the yearlySales table to verify the results.
Close the cursor and database connection.
close(curs)
close(conn)
Insert Numeric Data
Connect to the data source dbtoolboxdemo. This data source identifies a Microsoft
Access database. This database contains the table salesVolume. This table contains the
column stockNumber and columns for the months of the year.
conn = database('dbtoolboxdemo','admin','admin');
Alternatively, you can use the native ODBC interface for an ODBC connection. For
details, see database.
Define the numeric matrix data that contains the sales volume data.
data = [777666,0,350,400,450,250,450,500,515,...
235,100,300,600];
Display the data in the salesVolume table before insertion.
curs = exec(conn,'select * from salesVolume');
curs = fetch(curs);
curs.Data
ans =
Columns 1 through 8