Home > Database > Mysql Tutorial > Create a stored procedure using MySQL Workbench?

Create a stored procedure using MySQL Workbench?

王林
Release: 2023-08-27 14:49:01
forward
1084 people have browsed it

Let's first create a stored procedure. Following is the query to create a stored procedure using MySQL Workbench.

use business;
DELIMITER //
DROP PROCEDURE IF EXISTS SP_GETMESSAGE;
CREATE PROCEDURE SP_GETMESSAGE()
BEGIN
DECLARE MESSAGE VARCHAR(100);
SET MESSAGE="HELLO";
SELECT CONCAT(MESSAGE,' ','MYSQL!!!!');
END
//
DELIMITER ;
Copy after login

This is the screenshot of the stored procedure in MySQL workbench-

使用 MySQL Workbench 创建存储过程?

You need to execute the above stored procedure with the help of the following symbols shown in the screenshot-

使用 MySQL Workbench 创建存储过程?

Now you can execute the above statement again with the help of the symbols shown above. This will produce the following output -

使用 MySQL Workbench 创建存储过程?

The above is the detailed content of Create a stored procedure using MySQL Workbench?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template