User`s guide
update
7-241
update
Replace data in database table with MATLAB data
Syntax
update(conn,tablename,colnames,data,whereclause)
Description
update(conn,tablename,colnames,data,whereclause) exports the MATLAB
variable data in its current format into the database table tablename using the
database connection conn. Existing records in the database table are replaced as
specified by the SQL whereclause command.
Examples
Update an Existing Record
Create a database connection conn using the dbtoolboxdemo data source. This
database contains the table inventoryTable that contains these columns:
• productNumber
• Quantity
• Price
• inventoryDate
conn = database('dbtoolboxdemo','','');
Import all data from the inventoryTable using conn. Store the data in a cell
array contained in the cursor object property curs.Data. Display the data from
inventoryTable in this property.
curs = exec(conn,'select * from inventoryTable');
curs = fetch(curs);