Techniques are provided for processing a database statement that includes
a table function capable of parallel execution, where the input of the
table function is specified in a subquery. During compilation of the
database statement, a global cursor is generated for the database
statement. The global cursor includes a first plan component for
executing the table function and a second plan component for generating
input for the table function. A "dummy" cursor is then generated. When
slaves execute the table function, they call the dummy cursor for input.
When a slave calls the dummy cursor for input, the dummy cursor causes a
context switch back to the global cursor, so that the second plan
component within the first cursor generates the input for the slave.