Creating temporary tables in MySQL Stored Procedure
- by burntblark
The following procedure gives me an error when I invoke it using the CALL statement:
CREATE DEFINER=`user`@`localhost` PROCEDURE `emp_performance`(id VARCHAR(10))
BEGIN
DROP TABLE IF EXISTS performance;
CREATE TABLE performance AS
SELECT time_in, time_out, day FROM attendance WHERE employee_id = id;
END
The error says "Unknown table 'performance' ".
This is my first time actually using stored procedures and I got my sources from Google. I just cant figure out what I am doing wrong.