COLUMN_VALUE Pseudocolumn
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的更多相关文章
- Oracle 中的伪列
昨天做了一个Oracle PL/SQL 相关的测试,其中有一道这样的题目: 下列那些是Oracle的伪列(ACD) A.ROWID B.ROW_NUMBER() C.LEVEL D.RO ...
- Oracle Schema Objects——伪列ROWID Pseudocolumn(ROWNUM、ROWID)
Oracle Schema Objects Oracle Schema Objects——Tables——Oracle Data Types Oracle伪列 在Oracle数据库之中为了实现完整的关 ...
- XMLTABLE
XMLTABLE Syntax Description of the illustration xmltable.gif XMLnamespaces_clause::= Description ...
- 转://Oracle PL/SQL 优化与调整 -- Bulk 说明
一. Bulk 概述 本来只想测试一下Bulk Collect 和update性能的,但发现Bulk 的东西还是很多的,在OTN上搜了一些,整理如下. 1.1 Bulk Binding 和 Bulk ...
- DBMS_NETWORK_ACL_ADMIN
DBMS_NETWORK_ACL_ADMIN学习 转载 http://blog.sina.com.cn/s/blog_4f925fc30102e2se.html 标签: oracle it 分类: 数 ...
- Oracle导出excel
oracle导出excel(非csv)的方法有两种,1.使用sqlplus spool,2.使用包体 现将网上相关代码整理后贴出以备不时之需: 使用sqlplus: 使用sqlplus需要两个文件: ...
- Oracle数据行拆分多行
工作和学习中常常会遇到一行要分割成多行数据的情况,在此整理一下做下对比. 单行拆分 如果表数据只有一行,则可以直接在原表上直接使用connect by+正则的方法,比如: select regexp_ ...
- Oracle的一些操作
. 创建用户 Create user 用户名 identified by "密码"; 例如:create user ghc_ez identified by "ghc_2 ...
- SQL 归来
1. PL/SQL 转义 select order#, ……… from **** select col1 from A where col2 like '%\_keywors%' escape ' ...
随机推荐
- Js获取当前日期时间及其它格式化操作
Js获取当前日期时间及其它操作 var myDate = new Date();myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); ...
- debug阶段工作期站立会议1
组名:天天向上 组长:王森 组员:张政.张金生.林莉.胡丽娜 代码地址:HTTPS:https://git.coding.net/jx8zjs/llk.git SSH:git@git.coding.n ...
- mobile cpu上禁用alpha test的相关总结
因为,每家芯片的特性不同,根据向framebuffer写法的不同,分为tile-based的mobile cpu,如ImgTec PowerVR,ARM Mali,一部分老版本Qualcomm ...
- 微信的User-Agent
Mozilla/5.0 (Linux; U; Android 5.0.2; zh-cn; MI 2C Build/LRX22G) AppleWebKit/533.1 (KHTML, like Geck ...
- Xamarin迁移到 Unified API 注意事项
参考官方文档: Migrating to Unified API for Components #if __UNIFIED__ ... // Mappings Unified CoreGraphic ...
- RT-Thread的CPU使用率计算
CPU 的使用率一般是我们比较关心的问题,在这里我们就用空闲线程的钩子函数去统计 CPU 的使用率,并通过串口打印出来.首先我们在初始化线程中设置好钩子函数,并在 LED 线程中给系统人为的加入很多“ ...
- Away3D引擎学习笔记,持续更新
(1). 准备工作,一些必须知道的东西 (创建时间:2014-06-05) A.必要的开发语言基础.至少要懂点ActionScript 3.0语法(ActionScript 3.0语法及API参考), ...
- Rails--content_for和yield
--使用: (1)layout中使用<%=yield(:js)%> (2)html中使用<% content_for :js do %>[XXX]<% end %>
- 使用ngrok
使用ngrok让微信公众平台通过80端口访问本机 首先声明我是用java-tomcat来研究微信公众平台的. 微信公众平台要成为开发者,需要填写接口配置信息中的“URL”和“Token”这两项(参见: ...
- Class Abstraction -- Object Interfaces
<?php /* PHP 5 introduces abstract classes and methods. Classes defined as abstract may not be in ...