ref 動態游標:
create or replace procedure pro_cursor_type_V
as
t_tmp table3%rowtype;
type c_type is ref cursor;
cur c_type;
v_taname varchar2(100);
begin
v_taname:='aa';
open cur for 'select * from table3 where taname=:a order by taid desc' --a只是綁定變量的占位符以 =: 符號進行綁定
using v_taname;
dbms_output.put_line('名稱有');
loop
fetch cur into t_tmp;
exit when cur%notfound;
dbms_output.put_line('名稱為'||t_tmp.taname||'日期為:'||t_tmp.indate);
end loop;
end pro_cursor_type_V;
本文出自:億恩科技【www.artduck.net】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]
|