Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

how to get id from sting using mysql function?

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 ;


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...