0
CREATE OR REPLACE TYPE record_AB AS OBJECT
(
AA VARCHAR2 (32767 BYTE),
BB VARCHAR2 (32767 BYTE)
);
/
CREATE OR REPLACE TYPE type_tab_AB IS TABLE OF record_AB;
/
SQL> VARIABLE curs1 REFCURSOR;
SQL>
SQL> DECLARE
2 tab_AB type_tab_AB;
3 begin
4 select system.record_AB(t.owner,t.table_name) bulk collect into tab_AB from dba_tables t where compression='ENABLED' and compress_for='OLTP';
5 open :curs1 for select * from table(tab_AB) ;
6 end;
7/
PL/SQL procedure successfully completed.
SQL> select * from dba_segments where (owner,segment_name) in (select :curs1 from dual);
select * from dba_segments where (owner,segment_name) in (select :curs1 from dual)
ERROR at line 1:
ORA-00947: not enough values
我需要爲業主和SEGMENT_NAME提供AA的值,光標光標1的BB列作爲輸入,可有人請告訴我們如何實現這一目標?無法從遊標變量傳遞列的值來選擇查詢
我requriment是之前和之後解壓縮到段的大小比較。所以我試圖將壓縮段(所有者和段名稱)的列表存儲在遊標變量中。解壓縮後,我需要獲取這些段的大小。我們不能在解壓縮後使用您的代碼bcos「select d。t.table,t.table_name from dba_tables t where compression ='ENABLED' and compress_for ='OLTP'」這不會導致任何行 – newbee
爲什麼不保存它們一張桌子? –
謝謝Tony。這是一次性任務,所以我們試圖不使用表格。有沒有其他方法? – newbee