User`s guide
fastinsert
7-127
• unitCost equal to $20
• productDescription equal to 'Cooking Set'
Then, convert the cell array to the table data_table.
data = {11,500565,1010,20,'Cooking Set'};
data_table = cell2table(data,'VariableNames',colnames)
data_table =
productNumber stockNumber supplierNumber unitCost productDescription
------------- ----------- -------------- -------- ------------------
11 500565 1010 20 'Cooking Set'
Insert the table data into the productTable.
fastinsert(conn,tablename,colnames,data_table)
Display the data from the productTable again.
curs = exec(conn,'select * from productTable');
curs = fetch(curs);
curs.Data
ans =
productNumber stockNumber supplierNumber unitCost productDescription
------------- ----------- -------------- -------- ------------------
...
3 400999 1009 17 'Slinky'
10 888652 1006 24 'Teddy Bear'
11 500565 1010 20 'Cooking Set'
A new row appears in the productTable with the data from data_table.
Close the cursor and database connection.
close(curs)
close(conn)
Insert a Record
Connect to the data source dbtoolboxdemo. This data source identifies a Microsoft
Access database. This database contains the table inventoryTable with these columns:
• productNumber
• Quantity