午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    Oracle如何獲取指定包
    來源:易賢網(wǎng) 閱讀:1009 次 日期:2014-10-17 09:34:15
    溫馨提示:易賢網(wǎng)小編為您整理了“Oracle如何獲取指定包”,方便廣大網(wǎng)友查閱!

    oracle 獲取某個包 依賴的所有對象包括其子對象

    使用了一個一個臨時表 記錄了已經(jīng)遍歷的 節(jié)點

    同時 使用了層數(shù)來記錄已經(jīng)遍歷的 包

    效率一般,可以改動性大

    declare

    -- 獲取相應(yīng)的 某個程序包 所需要應(yīng)用的包

    cursor p_cur(p_name varchar2) is

    select dd.name, dd.type, dd.referenced_name, dd.referenced_type

    from dba_dependencies dd

    where 1 = 1

    and dd.referenced_type in

    ('PACKAGE', 'SYNONYM', 'TABLE', 'SEQUENCE')

    and dd.type in ('PACKAGE', 'PACKAGE BODY')

    AND dd.name = p_name;

    cursor p_temp(l_level number) is

    select attribute1, attribute2

    from cux_common_imports_temp

    where attribute2 = l_level;

    p_root_name varchar2(30);

    p_level number := 0;

    p_count number := 0;

    begin

    --將根節(jié)點 放入到表中

    p_root_name := 'CUX_SBU_COMMON';

    insert into cux_common_imports_temp

    (attribute1, attribute2)

    values

    (p_root_name, p_level);

    p_count := 1;

    --循環(huán)這一層的 節(jié)點 并獲得其子節(jié)點

    while p_count != 0 loop

    for p_loop in p_temp(p_level) loop

    --下一層

    p_level := p_level + 1;

    p_root_name := p_loop.attribute1;

    for p_rec in p_cur(p_root_name) loop

    if p_rec.referenced_type = 'PACKAGE' then

    --如果表內(nèi) 沒有這個程序就 加入到 臨時表中

    select count(*)

    into p_count

    from cux_common_imports_temp

    where attribute1 = p_rec.referenced_name;

    if p_count = 0 then

    insert into cux_common_imports_temp

    (attribute1, attribute2)

    values

    (p_rec.referenced_name, p_level);

    end if;

    --輸出相應(yīng)的 子節(jié)點信息

    dbms_output.put_line(p_level || '-Name:' ||

    p_rec.referenced_name || '-Type:' ||

    p_rec.referenced_type);

    end if;

    end loop;

    end loop;

    --獲取 該層是否為空

    select count(*)

    into p_count

    from cux_common_imports_temp

    where attribute2 = p_level;

    end loop;

    end;

    更多信息請查看IT技術(shù)專欄

    更多信息請查看數(shù)據(jù)庫
    易賢網(wǎng)手機網(wǎng)站地址:Oracle如何獲取指定包
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇剩?/div>

    2025國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)