Oracle PIPELINED table function



Specify PIPELINED to instruct Oracle Database to return the results of a table function iteratively. A table function returns a collection type (a nested table or varray). You query table functions by using the TABLE keyword before the function name in the FROM clause of the query. For example:
SELECT * FROM TABLE(function_name(...))

Oracle Database then returns rows as they are produced by the function.
  • If you specify the keyword PIPELINED alone (PIPELINED IS ...), the PL/SQL function body should use the PIPE keyword. This keyword instructs the database to return single elements of the collection out of the function, instead of returning the whole collection as a single value.
  • You can specify the PIPELINED USING implementation_type clause if you want to predefine an interface containing the start, fetch, and close operations. The implementation type must implement the ODCITable interface and must exist at the time the table function is created. This clause is useful for table functions that will be implemented in external languages such as C++ and Java.
If the return type of the function is ANYDATASET, then you must also define a describe method (ODCITableDescribe) as part of the implementation type of the function.

Comments