MySQL Forums
Forum List  »  Stored Procedures

Re: How to return null/empty resultset from SP??
Posted by: Ming Yeung
Date: December 13, 2005 08:08AM

great thanks, pem!

you gave me a good lesson.
now i do it like this...

CREATE PROCEDURE `adminCheckLogin`(IN inUsername varchar(20), IN inPassword char(32))
BEGIN
DECLARE ret_id INT;
SELECT id INTO ret_id FROM myy_admin WHERE username = inUsername AND password = inPassword;

IF ret_id IS NOT NULL THEN
UPDATE myy_admin SET date_lastlogin = NOW() WHERE id = ret_id;
SELECT ret_id;
ELSE
SELECT 1 FROM DUAL WHERE false;
END IF;
END

^_^

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to return null/empty resultset from SP??
1902
December 13, 2005 08:08AM


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.