An action that is a parameterizable block of multiple top-level expressions.
ACTION consisting of the specified expressions.
DEFINE ACTION: action definition.
- A named expression that will be used to access the defined action further in the query.
- The round brackets contain a list of named expressions you can use to access parameters inside the action.
- List of top-level expressions.
END DEFINE: The marker of the last expression inside the action.
ACTION with the specified parameters.
DO: Executing an action.
- The named expression for which the action is defined.
- The values to be used as parameters are listed in parentheses.
EMPTY_ACTION: An action that does nothing.
In large queries, you can use separate files for action definition and include them to the main query using
EXPORT + IMPORT. To define actions on tables by using a separate library, make sure to include
USE my_cluster; in it: action compilation depends on the cluster type.
DEFINE ACTION $hello_world($name) AS $name = $name ?? "world"; SELECT "Hello, " || $name || "!"; END DEFINE; DO EMPTY_ACTION(); DO $hello_world(NULL); DO $hello_world("John");