pgUpdate#
- pgUpdate(connect, tablename, data, filter, varargin)#
Update PostgreSQL database table rows using row filters and MATLAB table data.
Updates existing database rows matching the provided filters with new data from a MATLAB table. Automatically adds missing columns as array types when needed and handles vector-valued data appropriately.
- Parameters:
connect (
database.postgre.connection) – Open PostgreSQL database connectiontablename (
string) – Target database table namedata (
table) – MATLAB table containing new data valuesfilter (
matlab.io.RowFilter) – Row filters specifying which rows to update (one per table row)isForceArray (
logical, optional) – Force new columns to be created as array types (default: false)
Example:
conn = createWriter("myDatabase"); rf = rowfilter("SerialNumber"); rf = rf.SerialNumber == 1234; pgUpdate(conn, "myTable", newData, rf);