Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.3.14
Description
proc
CREATE PROCEDURE remove_emp (employee_id NUMBER) AS tot_emps NUMBER; |
BEGIN |
DELETE FROM employees |
WHERE employees.employee_id = remove_emp.employee_id; |
tot_emps := tot_emps - 1;
|
END; |
/
|
error:
MariaDB [test]> CREATE PROCEDURE remove_emp (employee_id NUMBER) AS tot_emps NUMBER; |
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 |
By the way, there should not be a semicolon after NUMBER. It should be followed by BEGIN immediately.
manjot, can you clarify please, what is the problem?
Does it work for you if you remove the redundant semicolon and add DELIMITER commands?