Oracle Table Function

abstractcyj發表於2013-03-14
Table functions Oracle provides equivalents for the following elements of this
feature:
is supported using
CAST (MULTISET () AS
table type>)
■ is supported using the TABLE
operator in the FROM clause with a varray or nested table as
the argument.
is equivalent to an Oracle
expression resulting in a varray or nested table.
is equivalent to a PL/SQL function that
returns a nested table.

CREATE TYPE phone AS TABLE OF NUMBER;

CREATE TYPE phone_list AS TABLE OF phone;

WITH t AS (SELECT ROWNUM AS col FROM dual CONNECT BY LEVEL <= 10)
SELECT * FROM TABLE(cast(MULTISET(SELECT * FROM t) AS phone)) 

SQL> WITH t AS (SELECT ROWNUM AS col FROM dual CONNECT BY LEVEL <= 10)
  2  SELECT * FROM TABLE(cast(MULTISET(SELECT * FROM t) AS phone))
  3  /
 
COLUMN_VALUE
------------
           1
           2
           3
           4
           5
           6
           7
           8
           9
          10
 
10 rows selected
 
SQL> 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-756130/,如需轉載,請註明出處,否則將追究法律責任。

下一篇: 分析函式中的KEEP
Oracle Table Function
請登入後發表評論 登入
全部評論

相關文章