Table Functions with table of numbers : table function « Object Oriented « Oracle PL/SQL Tutorial






SQL> create or replace type numberTableType is table of number;
  2  /

Type created.

SQL>
SQL> create or replace function f_table return numberTableType
  2  is
  3    v_numarray numberTableType :=numberTableType();
  4  begin
  5    FOR i in 1..10 loop
  6      v_numarray.EXTEND;
  7      v_numarray(i):=i+100;
  8    END LOOP;
  9    RETURN (v_numarray);
 10  end;
 11  /

Function created.

SQL>
SQL>
SQL>
SQL> SELECT * FROM TABLE(f_table);

COLUMN_VALUE
------------
         101
         102
         103
         104
         105
         106
         107
         108
         109
         110

10 rows selected.

SQL>
SQL>








32.19.table function
32.19.1.Use table function on varray type value
32.19.2.Table function with varray column
32.19.3.Table Functions with table of numbers
32.19.4.Table Functions involving Object Types
32.19.5.Pipelined Table Functions
32.19.6.Use table function to convert table collection to a table
32.19.7.Table function with aggregate function and group by
32.19.8.Update statement with table function