create or replace function getprototype(ls_staff_id in number,ls_password in varchar2) return number is
Result number;
mingwen varchar2(6);
pass staff.password%type;
pass_length number;
TYPE suanzi_type is VARRAY(8) OF NUMBER;
suanzi suanzi_type:=suanzi_type(136,12,197,140,122,14,223,241);
jici number;
begin
mingwen:="";
jici:=1;
select password,length(password) into pass,pass_length from staff where staff_id=ls_staff_id;
loop
exit when jici>pass_length;
mingwen:=mingwen+(UTL_RAW.BIT_XOR(substr(pass,jici,1),suanzi(jici)));
jici:=jici+1;
end loop;
if ls_password=mingwen then
Result:=1;
else
Result:=0;
end if;
return(Result);
end getprototype;
帮我看看这个程序的错误在哪里谢谢。
Result number;
mingwen varchar2(6);
pass staff.password%type;
pass_length number;
TYPE suanzi_type is VARRAY(8) OF NUMBER;
suanzi suanzi_type:=suanzi_type(136,12,197,140,122,14,223,241);
jici number;
begin
mingwen:="";
jici:=1;
select password,length(password) into pass,pass_length from staff where staff_id=ls_staff_id;
loop
exit when jici>pass_length;
mingwen:=mingwen+(UTL_RAW.BIT_XOR(substr(pass,jici,1),suanzi(jici)));
jici:=jici+1;
end loop;
if ls_password=mingwen then
Result:=1;
else
Result:=0;
end if;
return(Result);
end getprototype;
帮我看看这个程序的错误在哪里谢谢。
r1 varchar2(40);
r2 varchar2(40);
result := sys.utl_raw.bit_xor(r1, r2);
r1,r2为操作数,result为返回!
改为
mingwen:=mingwen || (UTL_RAW.BIT_XOR(substr(pass,jici,1),suanzi(jici)));