我用xiaowang用户登陆到oracle中,在sqlplus中sql>show  user;
xiaowang然后我执行select count(*)  from  user_projects  where  status='valid' and object_type='procedure'结果是:0个我有5个已经编译好了并且通过测试了的存储过程,请问统计有效的存储过程 命令应该是哪个呢???

解决方案 »

  1.   

    select count(*) from user_objects where status=upper('valid') and object_type=upper('procedure');
      

  2.   


    --大写!
    select Count(*) from user_objects where status='VALID' and object_type='PROCEDURE';
      

  3.   

    1.应该是user_objects,请区分大小写
    select count(*) from user_objects where status=upper('valid') and object_type=upper('procedure')
      

  4.   

    没有user_projects视图 是user_objects ;
      

  5.   

    2楼的select count(*) from user_objects where status=upper('valid') and object_type=upper('procedure');
    个人觉得没有select count(*) from user_ojbects where lower(status)='valid' and lower(object_type)='procedure'这个好。