Este es el codigo:El codigo me valida cuando un usuario introduce por equivocacion un email o cedula de identidad erronea
Código PHP:
CREATE PROCEDURE BuscarSolicitante(
@email nvarchar(50), @ced nvarchar(50),
@IdSol int output
)
AS
IF (SELECT COUNT(EMAIL)
FROM SOLICITANTE
WHERE @email = EMAIL)<0
BEGIN
SET @IdSol=-1
RETURN @IdSol
END
ELSE
IF (SELECT COUNT(CED_ID)
FROM SOLICITANTE
WHERE CED_ID=@ced)<0
BEGIN
SET @IdSol=-2
RETURN @IdSol
END
ELSE
BEGIN
SELECT @IdSol=ID_SOLICITANTE
FROM SOLICITANTE
WHERE EMAIL=@email AND CED_ID=@ced
RETURN @IdSol
END
GO