I want to write a function which return plan code when I give input plan title But my function not working please help me and correct my code. Please find enclosed attachment of error as well. I will be thankful to you.enter image description here
Plan_code Plan_title
1 Break First
2 Lunch
3 Dinner
id Plan_title Employee name
1 Break First ABC
2 Lunch DCF
3 Dinner GHI
DELIMITER //
CREATE FUNCTION get_plan_tile_code(Actvi_SubPln_Title VARCHAR)RETURNS INT(99)
BEGIN
DECLARE ATY_CODE INT(99) DEFAULT"";
SELECT plan_id INTO ATY_CODE
FROM tbl_plan_scata
WHERE plan_sub_title = Actvi_SubPln_Title;
RETURN ATY_CODE;
END //;
DELIMITER ;