Skip to main content
Version: Streamsheets 3.0

TIMESCALE.UPDATE

Premium

Performs an UPDATE query on your timescale database.

info

As of right now, the timescale functions work with the internal timescaledb. Leave the Connection parameter empty and the connection is automatically set up. We are working on allowing further timescale connections.

Syntax

=TIMESCALE.UPDATE(Connection, UpdateJSON)

Arguments

NameTypeDescription
ConnectionConnectionConnection to use for querying. Leave this parameter empty. The internal timescaledb is automatically connected.
UpdateJSONJSONDefines a query using a JSON cell range, which contains all clauses to build the UPDATE query.

Return

TypeDescription
BooleanTRUE, if successful.

Examples

AB
1updateupdate
2set"SensorA"=42, "SensorB"=23
3where"SensorC" > 250
4
5updateupdate
6set
70"SensorA"=42
81"SensorB"=23
9where"SensorC" > 250

These are two ways to enter the update syntax. Either use one long string for the "set" command or divide the command in multiple rows.

FormulaResultComment
=TIMESCALE.UPDATE(, JSON(A1:B3))
TRUEAssuming passed JSON looks like { update: 'tableName', set: '"SensorA"=42', where: '"SensorB">50' } this will update column SensorA at all rows in which column SensorB has a value greater 50
=TIMESCALE.UPDATE(, JSON(A5:B9))
TRUEAssuming passed JSON looks like { update: 'tableName', set: '"SensorA"=42', where: '"SensorB">50' } this will update column SensorA at all rows in which column SensorB has a value greater 50

For more examples see our timescale tutorial.