以下存贮过程有什么错误,编译不通过。
CREATE OR REPLACE PROCEDURE ECC_BEM.UPDATE_SUBJECTTYPE as
cursor signcursor is
select * from ECC_BEM_FINANCE_SUBJECT_IMPORT;
errormessage exception;
accountrecord ECC_BEM_FINANCE_SUBJECT_IMPORT%rowtype;
acccountsign varchar2(10);
accountnumber varchar2(50);
len number;
q_9 number;
q_8 number;
q_6 number;
q_5 number;
q_4 number;
q_3 number;
BEGIN
open signcursor;
if signcursor%notfound then
raise errormessage;
end if;
loop
fetch signcursor into accountrecord;
accountnumber :=accountrecord.ACCOUNT_NUMBER;
len := length(accountrecord.ACCOUNT_NUMBER);
select count(*) into q_9 from ECC_BEM_FINANCE_SUBJECT_IMPORT where ECC_BEM_FINANCE_SUBJECT_IMPORT.ACCOUNT_NUMBER like ''||accountnumber||'%' and length(ACCOUNT_NUMBER)>9;
select count(*) into q_8 from ECC_BEM_FINANCE_SUBJECT_IMPORT where ECC_BEM_FINANCE_SUBJECT_IMPORT.ACCOUNT_NUMBER like ''||accountnumber||'%' and length(ACCOUNT_NUMBER)>8;
select count(*) into q_6 from ECC_BEM_FINANCE_SUBJECT_IMPORT where ECC_BEM_FINANCE_SUBJECT_IMPORT.ACCOUNT_NUMBER like ''||accountnumber||'%' and length(ACCOUNT_NUMBER)>6;
select count(*) into q_5 from ECC_BEM_FINANCE_SUBJECT_IMPORT where ECC_BEM_FINANCE_SUBJECT_IMPORT.ACCOUNT_NUMBER like ''||accountnumber||'%' and length(ACCOUNT_NUMBER)>5;
select count(*) into q_4 from ECC_BEM_FINANCE_SUBJECT_IMPORT where ECC_BEM_FINANCE_SUBJECT_IMPORT.ACCOUNT_NUMBER like ''||accountnumber||'%' and length(ACCOUNT_NUMBER)>4;
select count(*) into q_3 from ECC_BEM_FINANCE_SUBJECT_IMPORT where ECC_BEM_FINANCE_SUBJECT_IMPORT.ACCOUNT_NUMBER like ''||accountnumber||'%' and length(ACCOUNT_NUMBER)>3;
if ( len = 9 and q_9=0) then
acccountsign:='leaf';
else if (len = 8 and q_8=0) then
acccountsign:='leaf';
else if (len = 6 and q_6=0) then
acccountsign:='leaf';
else if (len = 5 and q_5=0) then
acccountsign:='leaf';
else if (len = 4 and q_4=0) then
acccountsign:='leaf';
else if (len = 3 and q_3=0) then
acccountsign:='leaf';
else
acccountsign:='';
end if;
exit when signcursor%notfound;
update ECC_BEM.ECC_BEM_FINANCE_SUBJECT_IMPORT set FINANCE_SUBJECT_CODE = acccountsign where ACCOUNT_NUMBER =accountrecord.ACCOUNT_NUMBER ;
end loop;
close signcursor;
commit;
END;