how do i create a stored procedure in mysql?

You have to end all commands with a semicolon or else mysql will search for more code

DELIMITER $$

CREATE PROCEDURE spClean_T()
BEGIN
    CREATE TABLE staging_table AS SELECT * FROM raw_api_data;
END$$

DELIMITER ;

But if you don’t have more commands

Make a simple without DELIMITER

CREATE PROCEDURE spClean_T()
CREATE TABLE staging_table AS SELECT * FROM raw_api_data;

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top