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
Name | Type | Description |
---|---|---|
Connection | Connection | Connection to use for querying. Leave this parameter empty. The internal timescaledb is automatically connected. |
UpdateJSON | JSON | Defines a query using a JSON cell range, which contains all clauses to build the UPDATE query. |
Return
Type | Description |
---|---|
Boolean | TRUE, if successful. |
Examples
A | B | |
---|---|---|
1 | update | update |
2 | set | "SensorA"=42, "SensorB"=23 |
3 | where | "SensorC" > 250 |
4 | ||
5 | update | update |
6 | set | |
7 | 0 | "SensorA"=42 |
8 | 1 | "SensorB"=23 |
9 | where | "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.
Formula | Result | Comment |
---|---|---|
| TRUE | Assuming 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 |
| TRUE | Assuming 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.