Skip to content
Snippets Groups Projects
Commit 2a313082 authored by RomanSteinberg's avatar RomanSteinberg
Browse files

ADD: st proc GetGradeID

parent bd0f8012
Branches
Tags
No related merge requests found
......@@ -2859,7 +2859,28 @@ BEGIN
RETURN 0;
END //
DROP FUNCTION IF EXISTS GetGradeID//
CREATE FUNCTION `GetGradeID`( `Grade` INT,
`Degree` VARCHAR(30) -- enum('bachelor','master','specialist')
) RETURNS int(11)
NO SQL
BEGIN
DECLARE res INT;
SELECT grades.ID
INTO res
FROM `grades`
WHERE grades.Grade = Grade And
grades.Degree = Degree
LIMIT 1;
IF res > 0 THEN
RETURN res;
ELSE
RETURN -1;
END IF;
END //
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment