MySQL – Create Procedure

By | 2023년 10월 10일
Table of Contents

MySQL – Create Procedure

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

생성

DELIMITER //
 DROP PROCEDURE IF EXISTS GetAllProducts //
 CREATE PROCEDURE GetAllProducts()
   BEGIN
   SELECT * FROM products;
   END //
DELIMITER ;

실행 (프로시저 호출)

-- CALL GetAllProducts('2024-10-01', '2024-11-01', -1, 'spyadmin', @rettotcount);
-- SELECT @rettotcount;

CALL GetAllProducts();

답글 남기기