How to create Procedure in MySql?

1.Create a database and procedure

CREATE DATABASE `pretech`
DELIMITER $$
DROP PROCEDURE IF EXISTS `pretech`.`Helloworld` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Helloworld`()
BEGIN
 Select 'HELLO WORLD';
END $$
DELIMITER ;

2. Run it

CALL Helloworld()

3.Call procedure



image


No comments:

Post a Comment

Model Context Protocol (MCP) — Complete Guide for Backend Engineers

  Model Context Protocol (MCP) — Complete Guide for Backend Engineers Build Tools, Resources, and AI-Driven Services Using LangChain Moder...

Featured Posts