Odbc Toolkit - connection.update


: update (conn, tablename, colnames, data, whereclause)

Update columns in database.

Inputs

conn

Previously created database connection object

tablename

Name of table to write data to

colnames

cellstr of column names update. Variables names are expected to match the database.

data

Table or struct containing data to write to the database. Column names are expected to be present in the data..

whereclause

String WHERE condition to meet for updates.

Outputs

None

Examples

Update a row in the database

 
 # create sql connection
 db = database("default", "", "");
 # update name where Id > 1
 t = table(['Name3'], 'VariableNames', {'Name'});
 update(db, "Test", t, "WHERE Id > 1");
 
 

See also: sqlupdate.