BIND_COLUMNS()
All functions > CORE > BIND_COLUMNS()
Binds columns from a table to the given features.
Signatures
Returns: A table with the selected columns bound to features
BIND_COLUMNS(
column, ...
FROM { TABLE(table) | SQL(query) | CSV(text) | TSV(text) | JSON(text) }
) → TABLE<T>| Parameter | Type | Required | Description |
|---|---|---|---|
column | identifier | Yes | Source column whose values are bound to the input at the same position |
table | identifier | No | FROM TABLE(...): table of the query backend, such as shop.customers |
query | SQL | No | FROM SQL(...): query run by the query backend |
text | VARCHAR | No | FROM CSV/TSV/JSON(...): the embedded rows |
Notes
- Used in the
FORclause:FOR CUSTOMER_ID := BIND_COLUMNS(id FROM TABLE(shop.customers)) - Columns are matched to the bound inputs in order, so
FOR (A, B) := BIND_COLUMNS(a_col, b_col FROM ...)needs as many columns as inputs - Sources:
TABLE(name),SQL(query),CSV(text),TSV(text),JSON(text)
See also
Examples
Bind INPUTs from physical table columns
FeatureQL
DEFINE
input1 := INPUT(BIGINT),
input2 := INPUT(BIGINT),
add_inputs := input1 + input2
RETURN
input1,
input2,
add_inputs
FOR
(input1, input2) := BIND_COLUMNS(
val1,
val2
FROM TABLE(bnd.table_example)
)
;Result
| INPUT1 BIGINT | INPUT2 BIGINT | ADD_INPUTS BIGINT |
|---|---|---|
| 2 | 2 | 4 |
| 3 | 4 | 7 |
| 4 | 6 | 10 |