MySQL Forums
Forum List  »  Stored Procedures

Error in my stored procedure
Posted by: Rodrigo Reis
Date: June 17, 2008 08:53AM

I've been created this SP:


DELIMITER $$

DROP PROCEDURE IF EXISTS `ml_dados`.`validate_ticket` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `validate_ticket`(

OUT PAR_Resposta INTEGER,
IN PAR_EmailDoConvidado VARCHAR(100),
IN PAR_CodigoDoConvite VARCHAR(32)

)
BEGIN

DECLARE VAR_Res INTEGER;

SET VAR_Res = NULL;

SELECT Chave
FROM convites
WHERE EmailDoConvidado = PAR_EmailDoConvidado
AND CodigoDoConvite = PAR_CodigoDoConvite
INTO VAR_Res;

CASE
WHEN VAR_Res IS NULL THEN SELECT 'FALSO' AS Situacao;
ELSE SELECT 'VERDADEIRO' AS Situacao;
END CASE;




END $$

DELIMITER ;





----------------------------------------


But, i need that out parameter retunr null when the select above
do not return any result, but at this case the SP do not return
nothing because "NO DATA - ZERO ROW FETCHED..." there is any solution
for my problem??

Options: ReplyQuote


Subject
Views
Written By
Posted
Error in my stored procedure
4179
June 17, 2008 08:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.