Re: Declare variable inside a function
Hi Jon,
Try:
DELIMITER $$
DROP FUNCTION IF EXISTS `fn_GetYearAlbumRank`$$
CREATE FUNCTION `fn_GetYearAlbumRank`(parmAlbumID INT, parmYear INT)
RETURNS INT
BEGIN
DECLARE retval INT;
SELECT 5 INTO retval;
RETURN retval;
END$$
DELIMITER ;
SELECT fn_GetYearAlbumRank(1,2);
Result:
fn_GetYearAlbumRank(1,2)
------------------------
5
Subject
Views
Written By
Posted
58890
June 14, 2007 02:06AM
Re: Declare variable inside a function
16115
June 14, 2007 05:07AM
9490
June 14, 2007 12:24PM
6832
December 28, 2008 11:49PM
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.