X (TQL): Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
Created page with "Instead of specifying a clause parameter with a particular Item ID, this parameter can also be specific with 'X'. The result of placing an X for a parameter, is that a single TQL statement is by mutliple TQL statement, one with each Item ID for that Clause Parameter that can be found in the project data. Internally, the resulting TQL statements are placed in a single array and the result will be an array of TQL results. For example, the statement <pre>SELECT_NAME_W..."
 
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
Instead of specifying a clause parameter with a particular [[Item ID]], this parameter can also be specific with 'X'. The result of placing an X for a parameter, is that a single TQL statement is by mutliple TQL statement, one with each Item ID for that Clause Parameter that can be found in the project data. Internally, the resulting TQL statements are placed in a single array and the result will be an array of TQL results.
Instead of specifying a clause parameter with a particular [[Item ID]], it is possible to use the 'X' character for its value. Using 'X' automatically creates a TQL statement for every Item ID associated with that Clause Parameter in the project data. These statements are processed as an array, returning a corresponding array of results.


For example, the statement  
==Example==
<pre>SELECT_NAME_WHERE_NEIGHBORHOOD_IS_X</pre> is internally replaced with
Consider the following (simplified) Neighborhood data of a project:
<pre>SELECT_NAME_WHERE_NEIGHBORHOOD_IS_0<br>SELECT_NAME_WHERE_NEIGHBORHOOD_IS_2<br>SELECT_NAME_WHERE_NEIGHBORHOOD_IS_3<br>SELECT_NAME_WHERE_NEIGHBORHOOD_IS_5</pre>
<pre>
Its result will be an list of name, seperated by comma's, for example:
[
<pre>"Mayfair", "Soho", "Marylebone", "Hyde Park"</pre>
{ "id" : 0, "name" : "De Manege" },
{ "id" : 1, "name" : "De Lancaster" },
{ "id" : 2, "name" : "De Landstreken" },
{ "id" : 3, "name" : "De Kruidentuin" },
{ "id" : 4, "name" : "Golfresidentie" }
]
</pre>
 
The statement  
<pre>SELECT_NAME_WHERE_NEIGHBORHOOD_IS_X</pre> is expanded into the following comma-separated list:
<pre>SELECT_NAME_WHERE_NEIGHBORHOOD_IS_0, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_1, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_2, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_3, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_4</pre>
Its result will be a list of names, separated by comma's, for example:
<pre>"De Manege", "De Lancaster", "De Landstreken", "De Kruidentuin", "Golfresidentie"</pre>


==Clause Parameters==
==Clause Parameters==
Line 12: Line 24:
{{article end
{{article end
|seealso=
|seealso=
*[[Y (TQL)]]
*[[XA (TQL)]]
*[[XA (TQL)]]
*[[XC (TQL)]]
*[[XC (TQL)]]
*[[XK (TQL)]]
*[[XK (TQL)]]
*[[Y (TQL)]]
*[[ID (TQL)]]
|api=*[[Api session event editor building query]]
}}


}}
{{TQL param nav}}

Latest revision as of 11:55, 8 July 2026

Instead of specifying a clause parameter with a particular Item ID, it is possible to use the 'X' character for its value. Using 'X' automatically creates a TQL statement for every Item ID associated with that Clause Parameter in the project data. These statements are processed as an array, returning a corresponding array of results.

Example

Consider the following (simplified) Neighborhood data of a project:

[ 
 { "id" : 0, "name" : "De Manege" },
 { "id" : 1, "name" : "De Lancaster" }, 
 { "id" : 2, "name" : "De Landstreken" }, 
 { "id" : 3, "name" : "De Kruidentuin" },
 { "id" : 4, "name" : "Golfresidentie" } 
]

The statement

SELECT_NAME_WHERE_NEIGHBORHOOD_IS_X

is expanded into the following comma-separated list:

SELECT_NAME_WHERE_NEIGHBORHOOD_IS_0, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_1, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_2, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_3, SELECT_NAME_WHERE_NEIGHBORHOOD_IS_4

Its result will be a list of names, separated by comma's, for example:

"De Manege", "De Lancaster", "De Landstreken", "De Kruidentuin",  "Golfresidentie"

Clause Parameters

The X value can be used in the following TQL Clause parameters: