ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle Table Function

Oracle Table Function

原创 Linux操作系统 作者:abstractcyj 时间:2013-03-14 13:57:42 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/8520577/viewspace-756130/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 分析函数中的KEEP
请登录后发表评论 登录
全部评论
曾从事java方向开发多年。近年已经转入数据库方向。主要擅长SQL优化,Oracle数据库问题诊断,Oracle备份与恢复等。服务于医药物流,医院等行业

注册时间:2010-01-26

  • 博文量
    602
  • 访问量
    1091619