我在try 创建这stored procedure时遇到了一些困难,欢迎任何形式的帮助:
create procedure checando(in nombrecillo varchar(30), in contrilla varchar(30), out resultado int)
begin
if exists (select * from compas where nombre = nombrecillo and contrasenia = contrilla) then
set resultado = 0;
else if exists (select * from compas where nombre = nombrecillo) then
set resultado = -1;
else
set resultado = -2;
end if;
end;
我正在处理的桌子是:
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| Nombre | varchar(30) | YES | | NULL | |
| contrasenia | varchar(30) | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+