Skip to content

16.6.4 TAG Data UPDATE Support

Modify the actual time-series data in TAG tables with UPDATE table_name SET ... WHERE .... This page lists allowed WHERE predicates and SET targets for TAG data UPDATE. Use the separate UPDATE ... METADATA syntax to modify metadata.

Available since Machbase 8.7.0

TAG data UPDATE is supported only on logical TAG tables in Standard Edition. Cluster Edition and direct UPDATE on internal raw component tables are not supported.

WHERE Predicate Support

TAG data UPDATE requires one tag selection predicate and one or more BASETIME axis predicates.

WHERE PredicateSupportNotes
name = 'tag-01'OSelect one tag
name = ?, name = :tag_nameOSelect one tag with a positional/named bind
? = name, :tag_name = nameOReversed equality is supported; column-on-left form is recommended
name IN ('tag-01', 'tag-02')OLiteral/bind lists supported; subquery IN is not supported
name LIKE 'tag-%'OExpand to tags matching the pattern
time = t1OBASETIME equality predicate
time = ?, time = :base_timeOSpecify base time with a positional/named bind
? = time, :base_time = timeOReversed equality supported
time BETWEEN t1 AND t2OBoth endpoints inclusive
time >= t1 AND time < t2OCombinations of >, >=, <, and <= supported
time >= ? AND time < ?OBind markers supported for range bounds
One-sided time predicateOFor example, time >= t1
Data column predicateOFor example, value > 100, combined with tag/time predicates
UPDATE without predicatesXUpdating all TAG data is not allowed
Time predicate without tag selectionXTarget tags must be specified
Tag predicate without a time predicateXA BASETIME range must be specified
OR predicateXNot allowed in TAG data UPDATE predicates
Subquery/aggregate expressionXCannot determine UPDATE targets
Tag/axis columns wrapped in functions or expressionsXTag selectors and BASETIME predicates must reference columns directly

Bind parameters replace values only. They do not change the required tag and BASETIME predicates, allowed predicate structure, or SET targets. Reexecuting a prepared statement selects targets using the latest bind values. If no rows match, it succeeds with 0 affected rows.

SET Target Support

SET TargetSupportNotes
Data columnOUser data columns such as value and auxiliary columns
SUMMARIZED data columnOUpdates original TAG data
Multiple data columnsOCan be specified in the same UPDATE
name (PRIMARY KEY)XTag names cannot be changed
time (BASETIME)XThe time axis column cannot be changed
Metadata columnXUse UPDATE table_name METADATA SET ...
Hidden/system columnXInternal columns cannot be UPDATE targets

SET expressions may use constants, bind variables, arithmetic, functions, CASE, and string concatenation without existing row column references, and NULL if column constraints allow it. SET right-hand expressions cannot reference existing row columns, subqueries, or aggregates.

Canonical References

For execution syntax and parameter metadata, see TAG Data UPDATE. For marker APIs by SDK, see Named Bind Parameters. For diagnosis, see TAG Constraints and Troubleshooting.

Last updated on