Commit 92b3fab7 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Refs #8577 - documentation enhanced for behaviour of SELECT '_test'.

parent acfde9e5
Pipeline #1974 passed with stages
in 3 minutes and 7 seconds
......@@ -5503,22 +5503,38 @@ Processing of columns in the SQL result
* The content of all columns of all rows will be printed sequentially, without separator (except one is defined).
* Rows with `special-column-names`_ will be rendered first and the output is taken as content.
* Rows with `special-column-names`_ will be rendered internally by QFQ and the QFQ output of such processing (if there
is any) is taken as the content.
.. _special-column-names:
Special column names
QFQ typically don't care about the content of any SQL-Query - it just copy the content to the output (=Browser).
One exception are columns, whose name starts with '_'. E.g.::
10.sql = SELECT 'All', 'cats' AS red, 'are' AS _green, 'grey in the night' AS _link
* The first and second column are regular columns. No QFQ processing.
* The third column (alias name 'green') is no QFQ special column name, but has an '_' at the beginning: this column
content will be hidden.
* The fourth column (alias name 'link') uses a QFQ special column name. Here, only in this example, it has no
further meaning.
* Special column names always start with '_'.
* Column names, which start with a '_' and which are not reserved (=special column name), will not be printed. Nevertheless,
access to it via the {{<level>.<column>}} variable (without '_') are possible.
* The input parameters for the processing function are stored as column values.
* Single parameters are delimited by the '|' character.
* Parameters are identified by the function either
* by their **order**
* or by a **one character qualifier** followed by the ':' character, placed in front of the actual parameter value.
* Columns starting with a '_' but not defined as as QFQ special column name are hidden(!) - in other words: they are
not **printed** as output.
* SQL hint: If there is no column alias defined, the column name becomes the value
of the first row. E.g. if the first selected row contains a '_' as the first
character, the column name becomes '_....' - which will be hidden! To be safe: always define an alias!
* Access to 'hidden' columns via {{<level>.<column>}} or {{<column>:R}} are possible and often used.
* Important: to reference a column, the name has to be given without '_'. E.g. `SELECT 'cat' AS _pet` will be used with
`{{pet:R}}` (notice the missing '_').
* For 'special column names': the column name together with the value controls how QFQ processes the column.
| Reserved column name | Purpose |
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment