<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    tbwshc

    11gr2增強CREATE OR REPLACE TYPE功能

    11.2對于CREATE OR REPLACE TYPE語句進行了增加,增加了FORCE選項。

     

     

    在11.2之前,只要有其他的表或TYPE依賴了當前對象,這個對象就無法進行REPLACE了:

    SQL> create type t_num_tab is table of number;
    2 /

    Type created.

    SQL> create type t_record is object (id number, n_tab t_num_tab);
    2 /

    Type created.

    SQL> create or replace type t_num_tab is table of number(5);
    2 /
    create or replace type t_num_tab is table of number(5);
    *
    ERROR at line 1:
    ORA-02303: cannot drop or replace a type with type or table dependents

    這是11.2之前的情況,嘗試執行CREATE OR REPLACE將會導致ORA-2303錯誤,在11.2中Oracle增加了FORCE功能,使得一個僅被TYPE所依賴的對象仍然可以執行REPLACE的操作:

    SQL> create or replace type t_num_tab force is tbable of number(5);
    2 /

    Type created.

    SQL> select * from v$version;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production

    有意思的是,FORCE語句的位置不對則不會生效,這時同樣會報ORA-2303的錯誤,而并不會導致語句錯誤:

    SQL> create or replace force type t_num_tab is table of number(5);
    create or replace force type t_num_tab is table of number(5)
    *
    ERROR at line 1:
    ORA-02303: cannot drop or replace a type with type or table dependents


    SQL> create or replace type t_num_tab is table of number(5) force;
    2 /
    create or replace type t_num_tab is table of number(5) force;
    *
    ERROR at line 1:
    ORA-02303: cannot drop or replace a type with type or table dependents

    最后這個功能只對被TYPE所依賴的對象有效,一旦對象被表所依賴,則FORCE功能也不起作用:

    SQL> create table t_type_tab (id number, c_tab t_num_tab)
    2 nested table c_tab store tb as c_tab_tab;

    Table created.

    SQL> create or replace type t_num_tab force is table of number(6);
    2 /
    create or replace type t_num_tab force is table of number(6);
    *
    ERROR at line 1:
    ORA-22866: cannot replace a type with table dependents

    Oracle的錯誤信息也變成了ORA-22866。其實這時可以預料的,因為一旦創建了表,就相當于進行了實體化的工作,如果依賴的類型發生了變化,將會影響表中已有的數據的讀寫。不過其實Oracle可以做到更進一步,就是如果表段沒有創建或者表中沒有插入數據的情況下,允許對依賴的對象進行修改。

    posted on 2012-08-24 14:37 chen11-1 閱讀(1892) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 91亚洲视频在线观看| 亚洲国产韩国一区二区| 污污视频网站免费观看| 免费看美女让人桶尿口| 亚洲精品理论电影在线观看| 国内大片在线免费看| 精品久久久久久亚洲综合网| 性做久久久久免费观看| 高h视频在线免费观看| 亚洲第一视频在线观看免费| 免费人成视频在线观看免费| 亚洲片国产一区一级在线观看| 久久99九九国产免费看小说| 亚洲午夜一区二区电影院| 黄色片在线免费观看| 亚洲av第一网站久章草| 免费人成在线观看视频播放| 黄色网址免费在线观看| 亚洲大尺度无码无码专区| 亚洲免费在线视频播放| 国产成人亚洲综合网站不卡| 免费一级做a爰片久久毛片潮喷| 伊人久久大香线蕉亚洲五月天 | 亚洲日产2021三区在线 | 亚洲视频在线观看地址| 182tv免费视视频线路一二三| 国产免费拔擦拔擦8x| 丁香六月婷婷精品免费观看 | 全免费a级毛片免费**视频| 一区二区亚洲精品精华液| 国产成人免费a在线资源| 久久国产精品免费| 久久久久亚洲AV无码麻豆| 日韩免费观看视频| 久久中文字幕免费视频| 亚洲熟妇丰满xxxxx| 亚洲乱色熟女一区二区三区丝袜| 亚洲av日韩精品久久久久久a| 99视频全部免费精品全部四虎| 亚洲VA中文字幕无码毛片| 欧美最猛性xxxxx免费|