create or replace procedure ht_hmfx(v_acct_month varchar2) as
v_counts number;
v_counts_new number;
v_sql varchar2(255);
begin
--如果列名是固定的当然没有问题
select count(*) into v_counts  from tab  where m200510 is  null;
--可是列名是动态的时候就会出现错误,如下(v_acct_mont:='200510')
v_sql:='select count(*) into v_counts_new from ht_hmfx where M'||v_acct_month||' is null';
execute immediate v_sql;end;
请各位帮忙解决一下 ,我要得到该条件下的记录数,如上!