here is an example mysql store procedure
CREATE TABLE EMPLOYEE (
empId INTEGER PRIMARY KEY,
name TEXT NOT NULL,
dept TEXT NOT NULL
);
INSERT INTO EMPLOYEE VALUES (0001, 'Clark', 'Sales');
INSERT INTO EMPLOYEE VALUES (0002, 'Dave', 'Accounting');
INSERT INTO EMPLOYEE VALUES (0003, 'Ava', 'Sales');
delimiter //
CREATE PROCEDURE employeeCount (IN id INT)
BEGIN
SELECT COUNT(*) FROM EMPLOYEE;
END//
delimiter ;
call employeeCount(2);
now is it possible to set default value of param id like this (IN id INT default 29)
, I have tried but it gives error saying
ERROR 1064 (42000) at line 17: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT 7)
I have searched google and even looked into mysql reference document but still unable to find anything about this, is it possible if yes then how?