With below three situation, we can use the pseudocolumn column_value to refer the column value.

  • an XMLTABLE construct without the columns clause
  • TABLE function to refer to a scalar nested table type
  • virtual table with a single column returned by system

1. In the context of XMLTable, the value returned is of datatype XMLType.

SELECT * FROM XMLTABLE('<a>123</a>');

COLUMN_VALUE
---------------------------------------
<a>123</a> SELECT COLUMN_VALUE FROM (XMLTable('<a>123</a>')); COLUMN_VALUE
----------------------------------------
<a>123</a>

2. for the table function with collection type,you can use column_value , the returned column_value type is same as the element type.

CREATE TYPE phone AS TABLE OF NUMBER;
/
CREATE TYPE phone_list AS TABLE OF phone;
/
SELECT t.COLUMN_VALUE from table(phone(1,2,3)) t;

COLUMN_VALUE
------------
1
2
3

In a nested type, you can use the COLUMN_VALUE pseudocolumn in both the select list and the TABLE function:

SELECT t.COLUMN_VALUE FROM
TABLE(phone_list(phone(1,2,3))) p, TABLE(p.COLUMN_VALUE) t;
COLUMN_VALUE
------------
1
2
3

The keyword COLUMN_VALUE is also the name that Oracle Database generates for the scalar value of an inner nested table without a column or attribute name,

as shown in the example that follows. In this context,column_value  is not a pseudocolumn, but an actual column name.

CREATE TABLE my_customers (
cust_id NUMBER,
name VARCHAR2(25),
phone_numbers phone_list,
credit_limit NUMBER)
NESTED TABLE phone_numbers STORE AS outer_ntab
(NESTED TABLE COLUMN_VALUE STORE AS inner_ntab);

Below is an example for build-in list odinumberlist

select distinct column_value from table(sys.odcinumberlist(1,1,2,3,3,4,4,5))

refer:

http://docs.oracle.com/cd/B19306_01/server.102/b14200/pseudocolumns004.htm

http://stackoverflow.com/questions/10353969/how-can-i-select-from-list-of-values-in-oracle

COLUMN_VALUE Pseudocolumn的更多相关文章

  1. Oracle 中的伪列

    昨天做了一个Oracle PL/SQL 相关的测试,其中有一道这样的题目:   下列那些是Oracle的伪列(ACD)  A.ROWID   B.ROW_NUMBER()  C.LEVEL  D.RO ...

  2. Oracle Schema Objects——伪列ROWID Pseudocolumn(ROWNUM、ROWID)

    Oracle Schema Objects Oracle Schema Objects——Tables——Oracle Data Types Oracle伪列 在Oracle数据库之中为了实现完整的关 ...

  3. XMLTABLE

     XMLTABLE Syntax Description of the illustration xmltable.gif XMLnamespaces_clause::= Description ...

  4. 转://Oracle PL/SQL 优化与调整 -- Bulk 说明

    一. Bulk 概述 本来只想测试一下Bulk Collect 和update性能的,但发现Bulk 的东西还是很多的,在OTN上搜了一些,整理如下. 1.1 Bulk Binding 和 Bulk ...

  5. DBMS_NETWORK_ACL_ADMIN

    DBMS_NETWORK_ACL_ADMIN学习 转载 http://blog.sina.com.cn/s/blog_4f925fc30102e2se.html 标签: oracle it 分类: 数 ...

  6. Oracle导出excel

    oracle导出excel(非csv)的方法有两种,1.使用sqlplus  spool,2.使用包体 现将网上相关代码整理后贴出以备不时之需: 使用sqlplus: 使用sqlplus需要两个文件: ...

  7. Oracle数据行拆分多行

    工作和学习中常常会遇到一行要分割成多行数据的情况,在此整理一下做下对比. 单行拆分 如果表数据只有一行,则可以直接在原表上直接使用connect by+正则的方法,比如: select regexp_ ...

  8. Oracle的一些操作

    . 创建用户 Create user 用户名 identified by "密码"; 例如:create user ghc_ez identified by "ghc_2 ...

  9. SQL 归来

    1. PL/SQL 转义 select order#, ………  from **** select col1 from A where col2 like '%\_keywors%' escape ' ...

随机推荐

  1. SQL Server DATEPART() 函数

    定义和用法 DATEPART() 函数用于返回日期/时间的单独部分,比如年.月.日.小时.分钟等等. 语法 DATEPART(datepart,date) date 参数是合法的日期表达式.datep ...

  2. Html - 404页面

    <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8& ...

  3. Hadoop工程包架构解析

    Hadoop源码解析 1 --- Hadoop工程包架构解析 1 Hadoop中各工程包依赖简述    Google的核心竞争技术是它的计算平台.Google的大牛们用了下面5篇文章,介绍了它们的计算 ...

  4. 【新产品发布】发布STM8S 核心板

    搞了一些STM8的核心板供大家把玩,先上几张图: 物品购买地址: http://item.taobao.com/item.htm?spm=686.1000925.1000774.17.5GMO5M&a ...

  5. Scrum会议10(Beta版本) 补交

    组名:天天向上 组长:王森 组员:张政.张金生.林莉.胡丽娜 代码地址:HTTPS:https://git.coding.net/jx8zjs/llk.git SSH:git@git.coding.n ...

  6. linux load average

    性能分析_linux服务器CPU_Load Average 理解Linux系统中的load average(图文版) 理解Load Average做好压力测试 top命令的Load average 含 ...

  7. [读书笔记]项目管理实战:Microsoft Project精髓与方法

    <项目管理实战:Microsoft Project精髓与方法>是Bonnie Biafore 写的一本书.Bonnie Biafore 作为项目管理师(PMP),她有20余年为大中小型客户 ...

  8. Web 在线文件管理器学习笔记与总结(17)复制文件 (18)剪切文件

    (17)复制文件 ① 复制文件通过copy($src,$dst) 来实现 ② 检测目标目录是否存在,如果存在则继续检测目标目录中是否存在同名文件,如果不存在则复制成功 file.func.php 中添 ...

  9. redis hash怎么用

    public static void testHsh() { System.out.println("==Hash=="); Jedis jedis = RedisUtil.get ...

  10. mac 下 word 2011 使用笔记

    1. 全屏预览,最大限度减少干扰 点击左下角焦点视图图标进入焦点视图. 调整为页面宽度或单页,点击顶部右侧百分比调整. 2.无格式粘贴 option + shift + command + v 3.无 ...