declare
cursor login (tuser Users.UserName%type,tpwd Users.UserPwd%type)
is
select * from Users
where UserName=tuser and UserPwd=tpwd;
loginrow login%rowtype;
begin
open login(:login.tuser,:login.tpwd);
fetch login into loginrow;
if login%found then
go_block('main');
message('登录成功');commit;
:login.tuser:='';
:login.tpwd:='';
:global.quanxian:=loginrow.quanxian;
:global.userno:=loginrow.userno;
:global.punish:=0;
else
message('对不起,用户名或密码错误,请重新输入');commit;
:login.tuser:='';:login.tpwd:='';
end if;
close login;
end;
评论留言