Table function with varray column : table function « Object Oriented « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE OR REPLACE TYPE numberVarryType AS VARRAY(10)OF NUMBER(10);
  2  /

Type created.

SQL>
SQL> CREATE TABLE address_list (
  2      list_id VARCHAR2(6)PRIMARY KEY,
  3      direct_addresses numberVarryType
  4  );

Table created.

SQL>
SQL>
SQL> INSERT INTO address_list VALUES('OFF101',numberVarryType(1001,1002,1003,1004));

1 row created.

SQL>
SQL>
SQL> SELECT list_id,column_value FROM address_list,TABLE(direct_addresses);

LIST_I COLUMN_VALUE
------ ------------
OFF101         1001
OFF101         1002
OFF101         1003
OFF101         1004

4 rows selected.

SQL>
SQL>
SQL> drop table address_list;

Table dropped.








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