MySQL create stored procedure syntax with delimiter

后端 未结 5 741
不思量自难忘°
不思量自难忘° 2020-11-27 02:36

I am trying to create a stored procedure in MySQL using a delimiter like this:

use am;

DELIMITER $$

CREATE PROCEDURE addfields()
BEGIN
  DECLARE done INT D         


        
5条回答
  •  难免孤独
    2020-11-27 03:24

    I have created a simple MySQL procedure as given below:

    DELIMITER //
    CREATE PROCEDURE GetAllListings()
     BEGIN
     SELECT nid, type, title  FROM node where type = 'lms_listing' order by nid desc;
    END //
    DELIMITER;
    

    Kindly follow this. After the procedure created, you can see the same and execute it.

提交回复
热议问题