<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)  編輯  收藏


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


    網站導航:
     
    主站蜘蛛池模板: 国产精品冒白浆免费视频| 亚洲av永久无码天堂网| 日本红怡院亚洲红怡院最新| 麻豆91免费视频| 最好看的中文字幕2019免费| 免费国产成人高清视频网站| 国产精品自拍亚洲| 黄页网站免费观看| 亚洲av永久无码精品三区在线4| 57pao一国产成视频永久免费| 国产AⅤ无码专区亚洲AV | 亚洲爆乳无码一区二区三区| 一个人看的免费观看日本视频www| 久久久久久A亚洲欧洲AV冫| 中文在线免费观看| 免费又黄又爽又猛的毛片| 成年网站免费入口在线观看| 狠狠亚洲婷婷综合色香五月排名| 你懂的免费在线观看| 色婷婷六月亚洲婷婷丁香| 曰批视频免费30分钟成人| 色欲aⅴ亚洲情无码AV蜜桃| 亚洲国产成人久久综合一区77| 久久久久久久国产免费看 | 2020年亚洲天天爽天天噜| 亚洲精品免费视频| 亚洲国产日韩综合久久精品| 免费观看亚洲人成网站| 亚洲精品无码高潮喷水A片软| 成人在线免费看片| 亚洲国产综合自在线另类| 无码人妻精品中文字幕免费 | 免费久久人人爽人人爽av| 亚洲欧洲国产精品久久| 国产又黄又爽又刺激的免费网址 | 亚洲嫩草影院久久精品| 成人无码a级毛片免费| 亚洲一区在线免费观看| 亚洲人成色7777在线观看不卡| 久久国产色AV免费观看| 视频一区二区三区免费观看|