将变量从前置任务传递到当前任务

Passing variables from predecessor task to Current task

有没有办法在任务 1 中设置变量并将它们传递给子任务?看起来每个任务都有不同的会话,因此变量的值不会在任务树中传输。

查看 SYSTEM$SET_RETURN_VALUE:

Explicitly sets the return value for a task.

In a tree of tasks, 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.

link中有一个例子。