and jzbh = var_jzbh
and zh = 'B'
order by sj desc;
number_total := total;
exit;
end if;
end if;
end loop;
select count(*) into total from d_dcsj where flag = var_flag;
dbms_output.put_line(total);
if total < 100 then
open var_cursor_a for
select * from d_dcsj where zh = 'C';
open var_cursor_b for
select * from d_dcsj where zh = 'C';
else
open var_cursor_a for
select *
where flag = var_flag
and jzbh = var_jzbh
and zh = 'A'
order by sj desc;
number_total := total;
open var_cursor_b for
select *
from d_dcsj
where flag = var_flag
and jzbh = var_jzbh
and zh = 'B'
order by sj desc;
number_total := total;
end if;
commit;
end;
/
作者“fiercepanda”