declare
  cDjbh1 Varchar2(550);
  i INTEGER;
  j INTEGER;
  Hz Varchar2(550);
  pcDjbh_tmp Varchar2(250);
  cDjbh Varchar2(250);
  cRight Varchar2(250);
  cSubstr Varchar2(250);
  cSubstrold Varchar2(250);
BEGIN 
  cDjbh:=trim('2007');
  pcDjbh_tmp:='';
  cSubstr:='0001';
  cSubstrold:='*';
  i:=1;
  cRight:='';
  While i<=Length(cDjbh)
  loop 
    j:=0; 
    cSubstr:=Substr(cDjbh,Length(cDjbh)-i+1,1); 
    cRight:='a'+cRight;
    j:=1;  
    i:=i+1;
    cSubstrold:=cSubstr;   
  End loop;
  if i>Length(cDjbh) then
    i:=Length(cDjbh);
  end if;
  pcDjbh_tmp:=Substr(cDjbh,1,Length(cDjbh)-i)||cSubstr||trim(cRight);
  dbms.output.put_line(pcDjbh_tmp);    
END;dbms.output.put_line(pcDjbh_tmp);    
这句有错误