strSql:='select * from S_ModelSystem  where (ManageFlag=''0'')and(version>='||oldVersion||')'; 
改成
strSql:='select * from S_ModelSystem  where (ManageFlag='''||0||''')and(version>='||oldVersion||')'; 

解决方案 »

  1.   

    谢谢nicholaz(九思·逢尤) 老兄!我的sql语句没有错,我跟踪了一下,我和你的sql解析出来都是一样的:
    select * from S_ModelSystem  where (ManageFlag='0')and(version>=36)我把这句拿到SqlPlus中执行,返回多条记录。我甚至直接用select * from S_ModelSystem  ,但是问题依旧!
      

  2.   

    好像不能用cModelSystem%RowCount 来控制游标循环,用cModelSystem%NOTFOUND或for循环吧。
      

  3.   

    open cModelSystem for strSql;
      loop
      exit when cModelSystem%notfound
      ...
      end loop;
      

  4.   

    但是RowCount为何返回值为0呢?
      

  5.   

    open cModelSystem for strSql;
      loop
      fetch .... into ....;
      exit when cModelSystem%notfound;
      ...
      end loop;
    记录号rowcount开始为0,然后依次递增.
      

  6.   

    谢谢jiezhi(西域浪子) 兄,你的答案正确!