- Categories:
System functions (System Information)
SYSTEM$SET_RETURN_VALUE¶
Explicitly sets the return value for a task.
In a task graph, a task can call this function to set a return value.
Another task that identifies this task as the predecessor task (using the AFTER keyword in the task definition)
can retrieve the return value set by the predecessor task using SYSTEM$GET_PREDECESSOR_RETURN_VALUE.
Syntax¶
The value for the string_expression argument can be a string literal or a variable; for example, SYSTEM$SET_RETURN_VALUE(:VARIABLE).
Arguments¶
string_expressionThe string to set as the return value. The string size must be <= 10 kB (when encoded in UTF8).
Examples¶
Create a task that sets a return value. Create a second, child task that runs after the predecessor task has completed. The child task retrieves the return value set by the predecessor task (by calling SYSTEM$GET_PREDECESSOR_RETURN_VALUE) and inserts it into a table row:
Example 2: Call by using a separate stored procedure¶
Similar to the first example, but set the return value for the task and retrieve it by calling separate stored procedures:
Example 3: Use a variable to set the return value¶
The following example demonstrates how to dynamically generate a return value based on the task’s execution and set the return value by using a variable. In this example, the task loads data from a stream into a landing table and sets the return value to indicate the number of rows loaded: