`

Oracle 游标小用

阅读更多
-- Created on 2010/06/25 by WANGNAN
declare
  -- Local variables here
  i integer;
  TYPE t_cur IS REF CURSOR;
  v_cur t_cur;
  v_col VARCHAR2( 20);
BEGIN
  -- Test statements here
 
  OPEN v_cur FOR SELECT colno FROM test;
  FETCH v_cur INTO v_col;
  CLOSE v_cur;
  dbms_output.put_line(v_col);
  EXCEPTION WHEN OTHERS THEN
            dbms_output.put_line( sqlerrm);
           
end;

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics