请问以下过程有哪些错误?CREATE OR REPLACE  PROCEDURE "SYSTEM"."UPDATE_SUBJECTTYPE"
as
cursor signcursor is 
select * from system.A;
errormessage exception;
accountrecord system.A%rowtype;
acccountsign varchar2(10);
s number;
accountnumber varchar2(50);begin 
open signcursor;
if signcursor%notfound then
   raise errormessage;
end if;
loop
   fetch signcursor into accountrecord;
   accountnumber :=accountrecord.ACCOUNT_NUMBER;
   s := select count(*) from system.A  where  A.ACCOUNT_NUMBER  like accountnumber and ACCOUNT_NUMBER!=accountrecord.ACCOUNT_NUMBER;/*提示有误!*/
   if ( s = 0) then
      acccountsign:='leaf';
   else 
      acccountsign:='notleaf';
   end if;
   exit when signcursor%notfound;
   update system.A set sign = acccountsign where ACCOUNT_NUMBER =accountrecord.ACCOUNT_NUMBER ;
end loop;
close signcursor;
commit;
end;

解决方案 »

  1.   

    如果s := select count(*) from system.A ;
    也提示有误!
      

  2.   

    select count(*) into s from system.A ;
    呢?
      

  3.   

    可以, like %accountnumber% 应该如何写才正确?
      

  4.   

    用字符串连接:'select count(*) into s from system.A  where  A.ACCOUNT_NUMBER  like %'||accountnumber||'% and ACCOUNT_NUMBER!=accountrecord.ACCOUNT_NUMBER;'
      

  5.   

    like accountnumber 的写法没有错的啊,你的存储过程还报什么错?
      

  6.   

    like %'||accountnumber||'%语法错误。
      

  7.   

    like '%' || accountnumber || '%'
      

  8.   

    谢谢大家.
    查找5040开头的字符串
    5040
    504001
    504002
    305040
    315040是不是like '5040%'?