建一个存储过程,目的是传入三个参数(用户ID,口令、用户类别),返回记录集的数量,以此校验用户是否为合法用户,以下是我的存储过程,无法编译通过,请指点:create or replace procedure sp_userlogin(xino_UID in varchar2, xino_PWD in varchar2,xion_UT in varchar2)
as
begin
Select * from UserTable where ([User_Code]=xino_UID) and ([User_Pwd]=xino_PWD) and ([User_Type]=xino_UT)
end;
as
begin
Select * from UserTable where ([User_Code]=xino_UID) and ([User_Pwd]=xino_PWD) and ([User_Type]=xino_UT)
end;
as
begin
Select count(*) into count from UserTable where User_Code=xino_UID and User_Pwd=xino_PWD and User_Type=xino_UT;
exception when no_data_found
count:=-1;
end;
以上代码未测试
返回值为-1表示无对应用户
PS:不推荐count(*)
as
Uid varvhar(10);
beginselect Id into Uid from userTalbe;否则,要换成游标,
as
Uid varvhar(10);
beginselect Id into Uid from userTalbe;否则,要换成游标,
is
begin
Select * from UserTable where ([User_Code]=xino_UID) and ([User_Pwd]=xino_PWD) and ([User_Type]=xino_UT);
end sp_userlogin;