Skip to Main Content

Polymorphic Table Functions

Polymorphic Table Functions (PTF) - introduced in Oracle Database 18c - are user-defined functions that can be invoked in the FROM clause of a SQL query block. They are capable of processing tables whose row type is not declared at definition time and producing a result table whose row type may or may not be declared at definition time. Polymorphic table functions leverage dynamic SQL capabilities to create powerful and complex custom functions. This is useful for applications demanding an interface with generic extensions which work for arbitrary input tables or queries.

Resources

  • #SELECTION#
    #ICON_HTML#

    Overview of Polymorphic Table Functions

    Polymorphic table functions (PTF) are table functions whose operands can have more than one type. The return type is determined by the PTF invocation arguments list. The actual arguments to the table type usually determines the row output shape, but not always.
    #MISC#
    #ACTIONS#
  • #SELECTION#
    #ICON_HTML#

    Polymorphic Table Functions in SQL - Slidedeck

    Added in Oracle Database 18c, Polymorphic Table Functions (PTFs) allow you to change the shape of a result set at runtime. So you can add or remove columns from your results based on input parameters. This presentation gives an overview of the why & how of PTFs.
    #MISC#
    #ACTIONS#

Workshop Info

Session Has Completed - 04 June 2019
1 Hour
English
Oracle PL/SQL