declare
type t_cur is ref cursor;
c_sign_stat t_cur;
strSQL VARCHAR2(100);
tmp_sql varchar2(100):='sign_man=''zhansan'' or sign_man=''lisi'' or sign_man=''wangwu''';
rec_gd_sign_in_tab gd_sign_in_tab %rowtype;
begin
strSQL:='SELECT * FROM gd_sign_in_tab WHERE sign_out_time IS NOT NUL and sign_in_time=to_date(i_begin_date,'yyyymm') and ' || tmp_sql;
open c_sign_stat for strSQL;
loop
fetch c_sign_stat into rec_gd_sign_in_tab ;
exit when c_sign_stat %notfound;
/*写要取游标中的一条一条数据的代码*/
end loop;
close c_sign_stat;
end;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22288639/viewspace-624998/
,如需转载,请注明出处,否则将追究法律责任。