ref 動(dòng)態(tài)游標(biāo):
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只是綁定變量的占位符以 =: 符號(hào)進(jìn)行綁定
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】
服務(wù)器租用/服務(wù)器托管中國五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|