我在ORACLE中建有一个过程,代码如下,现在我在D6中用STOREPROC来调用他,可是出现了END OF THE TABLE的错误,D6中代码如下:
-------------DELPHI--------------
Active:= False;
      chkuser.ParamByName('v_user').AsString:= edt_user.Text;
      chkuser.ParamByName('v_pass').AsString:= edt_pass.Text;
      chkuser.ParamByName('v_Result').AsInteger:=0;
      Active:= True;
      Chk_Result:= chkuser.ParamByName('v_Result').AsInteger;
------------ORACLE----------------
Create or Replace Procedure ChkUser_j01131(
  v_user in operate_j01131.op_user%type,
  v_pass in operate_j01131.op_pass%type,
  v_result in out number)As
v_rec operate_j01131.op_id%type;
begin
  select op_id into v_rec from operate_j01131
    where op_user=v_user and op_pass=v_pass;
  if v_rec > 0 then
    v_result:=1;
  else
    v_result:=0;
  end if; 
end;这是为什么望解答

解决方案 »

  1.   

    select op_id into v_rec from operate_j01131
     where op_user=v_user and op_pass=v_pass;这一句没有查到数据
      

  2.   

    select nvl(op_id,0) into v_rec from operate_j01131
        where op_user=v_user and op_pass=v_pass;
      

  3.   

    select op_id into v_rec from operate_j01131
        where op_user=v_user and op_pass=v_pass;
    有错,不能保证有一个值,
    加个exceptin
      v_result:=-1;
    看看
      

  4.   

    为何要用存贮过程呢,???
    如果消耗你太多的时间的话,希望你考虑一下TQuery组件:
    var
      blLogin  :  Boolean;
    ........ with qryChkUser do 
     begin 
       Close;
       Sql.Add('select UserId from Tbl_User'
              +' where UserId=''' +edtUserId.Text+''''
              +'   and Pswd='''+edtPswd.text+''''
        );
       Open;
     end;
     if qryChkUser.IsEmpty then
     begin
       Application.ShowMessage('无此人或密码错!');
       Exit;
     end
     else begin 
       blLogin:=True;
     end;
      

  5.   

    上面Close;语句后还有一句给漏掉了: Sql.Clear;