Oracle ref 動態資料指標

來源:互聯網
上載者:User

Oracle 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;

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.