以下有个程序:
    这是根据类型,返回一个号.例如:proc_gencontno("C",ABC),返回C0700001,等待incont 插入后,再次执行生成C0700002.结果每次都生成C0700001,怎么回事?create or replace procedure proc_gencontno
(conttype in  char, ls_string  out varchar2)
AS  l_year varchar2(10);
  li_count number(8) not null:=99999;
  li number(8) not null:=1;
  lj number(8) not null:=1;
  l_serial Varchar2(6);
 begin
  l_year:=to_char(sysdate,'yy');
  while li<=li_count  loop
       l_serial:=substr('00000'||to_char(li),2,5);
       if conttype='C' then
          ls_string:=conttype||l_year||l_serial;
          select count(*) into lj from incont where icontno=ls_string;
       end if;
       
       if lj>=1   then  
            li:=li+1;             
       else
         EXIT ;
       end if  ;
  end loop;
  
 
end proc_gencontno;另外,C#怎么取出来 ?谢谢