CREATE PROCEDURE DBA.p_post_login_check( )
RESULT( message_text VARCHAR(255), message_action INT )
BEGIN
DECLARE message_text CHAR(255);
DECLARE message_action INT;
-- assume the password_about_to_expire variable was
-- set by the login procedure
IF password_about_to_expire = 1 THEN
SET message_text = 'Your password is about to expire';
SET message_action = 1;
ELSE
SET message_text = NULL;
SET message_action = 0;
END IF;
-- return message (if any) through this result set
SELECT message_text, message_action;
END;
GRANT EXECUTE ON DBA.p_post_login_check TO PUBLIC;
SET OPTION PUBLIC.post_login_procedure = 'DBA.p_post_login_check';