1、不要commit
2、先把EXCEPTION部分注释掉,看看Oracle提示的错误信息

解决方案 »

  1.   

    按楼上的要求做了,Oracle没有的错误信息提示
      

  2.   

    username in varchar2,passwords in varchar2,V_RESULT out numberin 加了吗
      

  3.   

    (username varchar2,passwords varchar2,V_RESULT out number) as
     
     usernames varchar2(20):=username;
     passwordss varchar2(20):=passwords;begin  select count(*) into V_RESULT from A 
         where admin_id in (select userid from B 
                            where passwords=passwordss and username=usernames
                          ); 
      
      return v_result;  
    EXCEPTION
      WHEN OTHERS THEN
        V_RESULT:=0; 
       return v_result;  
    end bbs_admincheck;
      

  4.   

    行号= 13 列号= 3 错误文本= PLS-00372: 在一个过程中,RETURN 语句无法包含表达式
    行号= 13 列号= 3 错误文本= PL/SQL: Statement ignored
    行号= 17 列号= 3 错误文本= PLS-00372: 在一个过程中,RETURN 语句无法包含表达式
    行号= 17 列号= 3 错误文本= PL/SQL: Statement ignoredyufeiyxl(与飞) 加了return不行啊,不加return,返回的值与上面的情况一样,总是 0
      

  5.   

    --改为
    (v_username varchar2,v_passwords varchar2,V_RESULT out number) as
    begin   select count(*) into V_RESULT from A 
         where admin_id in (select userid from B 
                            where passwords=v_passwords and username=v_username
                          ); 
      EXCEPTION
      WHEN NO_DATA_FOUND THEN
        V_RESULT:=0;
      WHEN OTHERS THEN
        V_RESULT:=0; 
    end bbs_admincheck;--以下赋值实际上为NULL
    -- usernames varchar2(20):=username;
    -- passwordss varchar2(20):=passwords;
      

  6.   

    ab5669(王长林),还是不行啊,返回值总是0 还有,usernames varchar2(20):=username;与 passwordss varchar2(20):=passwords;
    怎么会为null呢?但是我单独:select userid into V_RESULT from B 
                            where passwords=passwordss  and username=usernamesV_RESULT 就有正确的返回值啊