Odbc Toolkit - connection.sqlupdate


: sqlupdate (db, tablename, data, filter)
: sqlupdate (db, tablename, data, filter, propertyname, propertyvalue …)

Update rows of data in database.

Inputs

db

Previously created database connection object

tablename

Name of table to write data to

data

Table containing or struct data to write to the database. Variables names are expected to match the database.

filter

A Filter object or cell array of filter objects used to determine which rows of the table to update.

propertyname, propertyvalue

property name/value pairs where known properties are:

Catalog

An optional database catalog name.

Schema

An optional database schema name.

Outputs

None

Examples

Update db where id > 1

 
 # create sql connection
 db = database("default", "", "");
 # make a filter to select what to update
 rf = rowfilter({'Id'});
 rf = rf.Id > 1;
 # update name where Id > 1
 t = table(['Name3'], 'VariableNames', {'Name'});
 sqlupdate(db, "Test", t, rf);
 
 

See also: update.