User`s guide

7 Functions — Alphabetical List
7-126
supplierNumber
unitCost
productDescription
conn = database.ODBCConnection('dbtoolboxdemo','admin','admin')
conn =
ODBCConnection with properties:
Instance: 'dbtoolboxdemo'
UserName: 'admin'
Message: []
Handle: [1x1 database.internal.ODBCConnectHandle]
TimeOut: 0
AutoCommit: 0
Type: 'ODBCConnection Object'
conn has an empty Message property, which means a successful connection.
Select and display the data from the productTable.
curs = exec(conn,'select * from productTable');
curs = fetch(curs);
curs.Data
ans =
productNumber stockNumber supplierNumber unitCost productDescription
------------- ----------- -------------- -------- ------------------
...
6 400876 1004 8 'Sail Boat'
3 400999 1009 17 'Slinky'
10 888652 1006 24 'Teddy Bear'
Store the column names of productTable in a cell array.
tablename = 'productTable';
colnames = {'productNumber','stockNumber','supplierNumber',...
'unitCost','productDescription'};
Store the data for the insert in the cell array data that contains these values:
productNumber equal to 11
stockNumber equal to 500565
supplierNumber equal to 1010