command-update

Use this command to write new values to existing row(s) in a table.

Format

UPDATE Table

SET update-element [ , update-element ]*

[ WHERE bool-condition ]

Remarks

NOTICE

UNEXPECTED BEHAVIOR OF APPLICATION

Be aware that this command will include Group Templates if they exist in the database and are matched by the WHERE clause. Take care to exclude Group Templates when using the command to update values in Group Instances. Likewise, take care to exclude Group Instances when using the command to update values in Group Templates.
Failure to follow these instructions can result in unexpected or incomplete configuration changes.

The searched UPDATE command writes new values to row(s) in a database table. The operation is multi-row in that it can update zero or more rows in a single operation.

The optional WHERE clause defines a condition which selects which rows will be updated. If the WHERE clause is omitted, all rows in the table will be updated.

Example:

UPDATE CPointDigitalManual

SET CurrentState = 1

WHERE FullName = 'Test Point'

Required Permissions

To successfully use this command, the User Account of the user that is executing the command has to be assigned the relevant permissions for each field of each database item that is being modified. The permissions vary per field; these are shown in the Database Schema alongside each field (see Configuration Fields and Data Fields Section in the Geo SCADA Expert Guide to the Database). Also see User Access Considerations when Working with SQL.

If any of the database items are security related, the User Account also has to be assigned the Security permission on those security-related database items (see User Access Considerations when Working with SQL).

Some types of table are special cases; for further information, see User Access Considerations when Working with SQL.