Update (TQL): Difference between revisions
| Line 1: | Line 1: | ||
Update TQL queries allow users to set numerical values for specific [[item]] in a [[session]] of a [[project]]. By adding various clauses to an update statement, the query can be made more specific. | Update TQL queries allow users to set numerical values for specific [[item]] in a [[session]] of a [[project]]. By adding various clauses to an update statement, the query can be made more specific. | ||
===Composition of an Update Query=== | ===Composition of an Update Query======Composition of a Select Query=== | ||
An Update TQL query provides a means to update an attribute to one or more values for a selection of data of a [[session]]. | |||
The 'Update' statement is consists of the <code>UPDATE</code> word followed by the context, for example <code>AREA</code>. Next the [[attribute]] to update is stated, followed by the word <code>WHERE</code>. Depending on the context, one or more [[Clause (TQL)|clause]]s can be added. Clauses are separated with the <code>AND</code> word. All of these parts are separated by an underscore <code>_</code>. | |||
An example of a TQL select statement is: <code>UPDATE_AREA_WATER_LEVEL_M_WHERE_AREA_IS_0</code>. In this example: | |||
* <code>UPDATE</code> is the statement | |||
* <code>AREA</code> is the context | |||
* <code>WATER_LEVEL_M</code> is the attribute | |||
* <code>AREA__IS_0</code> is the first clause. | |||
This adds or updates the attribute WATER_LEVEL_M for the area with ID 0 to a particular value. The particular value is supplied separately and the way it is supplied depends on the context in which this statement is executed. | |||
===Executing an Update Query=== | ===Executing an Update Query=== | ||
Revision as of 12:40, 20 May 2026
Update TQL queries allow users to set numerical values for specific item in a session of a project. By adding various clauses to an update statement, the query can be made more specific.
Composition of an Update Query======Composition of a Select Query
An Update TQL query provides a means to update an attribute to one or more values for a selection of data of a session.
The 'Update' statement is consists of the UPDATE word followed by the context, for example AREA. Next the attribute to update is stated, followed by the word WHERE. Depending on the context, one or more clauses can be added. Clauses are separated with the AND word. All of these parts are separated by an underscore _.
An example of a TQL select statement is: UPDATE_AREA_WATER_LEVEL_M_WHERE_AREA_IS_0. In this example:
UPDATEis the statementAREAis the contextWATER_LEVEL_Mis the attributeAREA__IS_0is the first clause.
This adds or updates the attribute WATER_LEVEL_M for the area with ID 0 to a particular value. The particular value is supplied separately and the way it is supplied depends on the context in which this statement is executed.
Executing an Update Query
TQL Queries can be executed using:
- Query Tool in the Tygron Platform; For creating and testing TQL queries.
- Names in Excels; Used for Indicator and Panels and supports more complex queries.
- API's query endpoint; Using
api/session/query/<TQLQUERY>
List of Update types
Click on the link of specific Select TQL types to see what you can do with them.
| Update | Description | Fixed clause amount | Polygon based |
|---|---|---|---|
| ADDRESS | Update specified attribute with provided values for specific Address | 1 | false |
| AREA | Update specified attribute with provided values for specific Area | 1 | false |
| BUILDING | Update specified attribute with provided values for a specific Building or all buildings intersecting the query polygons | No | true |
| GLOBAL | Update specified attribute with provided values for Global with specific name | 1 | false |
| INDICATOR | Update specified attribute with provided values for specific Indicator | 1 | false |
| NEIGHBORHOOD | Update specified attribute with provided values for specific Neighborhood | 1 | false |
| NET_FUNCTION | Update specified attribute with provided values for specific Net Function | 1 | false |
| NET_LINE | Update specified attribute with provided values for specific Net Line | 1 | false |
| NET_LOAD | Update specified attribute with provided values for specific Net Load | 1 | false |
| PANEL | Update specified attribute with provided values for specific Panel | 1 | false |
| TERRAIN | Update specified attribute with provided values for specific Terrain Type | 1 | false |
| ZONE | Update specified attribute with provided values for specific Zone | 1 | false |