[20131121]12c sqlplus的set colinvisible on.txt

[20131121]12c sqlplus的set colinvisible on.txt

12c 加入invisible column,但是如果要查看表的隐含列,要查询一些视图.实际上在sqlplus执行set colinvisible on,在执行desc

做一个测试看看.

@ver
BANNER                                                                               CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production              0

SQL> create table t ( a number,b number,c number);
Table created.

SQL> desc t;
Name  Null?    Type
----- -------- --------
A              NUMBER
B              NUMBER
C              NUMBER

SQL> column column_name format a20
SQL> select column_id, segment_column_id, internal_column_id, column_name, hidden_column, virtual_column from user_tab_cols where table_name = 'T';

 COLUMN_ID SEGMENT_COLUMN_ID INTERNAL_COLUMN_ID COLUMN_NAME          HID VIR
---------- ----------------- ------------------ -------------------- --- ---
         3                 3                  3 C                    NO  NO
         2                 2                  2 B                    NO  NO
         1                 1                  1 A                    NO  NO

--如果隐藏列.
SQL> alter table t modify b invisible;
Table altered.

SQL> desc t
Name  Null?    Type
----- -------- ---------------------------
A              NUMBER
C              NUMBER

SQL> select column_id, segment_column_id, internal_column_id, column_name, hidden_column, virtual_column from user_tab_cols where table_name = 'T';

 COLUMN_ID SEGMENT_COLUMN_ID INTERNAL_COLUMN_ID COLUMN_NAME          HID VIR
---------- ----------------- ------------------ -------------------- --- ---
         2                 3                  3 C                    NO  NO
                           2                  2 B                    YES NO
         1                 1                  1 A                    NO  NO

SQL> select column_id, column_name from user_tab_columns where table_name='T';

 COLUMN_ID COLUMN_NAME
---------- --------------------
         1 A
           B
         2 C        
--要查询对应的视图才知道.

SQL> set colinvisible on
SQL> desc t
Name           Null?    Type
-------------- -------- ----------
A                       NUMBER
C                       NUMBER
B (INVISIBLE)           NUMBER

--修改为可见.
SQL> alter table t modify b visible;
Table altered.

SQL> select column_id, segment_column_id, internal_column_id, column_name, hidden_column, virtual_column from user_tab_cols where table_name = 'T';

 COLUMN_ID SEGMENT_COLUMN_ID INTERNAL_COLUMN_ID COLUMN_NAME          HID VIR
---------- ----------------- ------------------ -------------------- --- ---
         2                 3                  3 C                    NO  NO
         3                 2                  2 B                    NO  NO
         1                 1                  1 A                    NO  NO

SQL> desc t
Name  Null?    Type
----- -------- -------
A              NUMBER
C              NUMBER
B              NUMBER

--可以发现显示顺序COLUMN_ID发生了变化,但是存储顺序 SEGMENT_COLUMN_ID并没有改变. INTERNAL_COLUMN_ID保持开始建立的顺序.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-777179/,如需转载,请注明出处,否则将追究法律责任。

user_pic_default.png
请登录后发表评论 登录
全部评论
<%=items[i].createtime%>

<%=items[i].content%>

<%if(items[i].items.items.length) { %>
<%for(var j=0;j
<%=items[i].items.items[j].createtime%> 回复

<%=items[i].items.items[j].username%>   回复   <%=items[i].items.items[j].tousername%><%=items[i].items.items[j].content%>

<%}%> <%if(items[i].items.total > 5) { %>
还有<%=items[i].items.total-5%>条评论 ) data-count=1 data-flag=true>点击查看
<%}%>
<%}%> <%}%>

转载于:http://blog.itpub.net/267265/viewspace-777179/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值