10月 20th, 2008

MySQL5的存储过程

Category: mysql, Author: admin, Popularity: 4%

DELIMITER $$

DROP PROCEDURE IF EXISTS `spTest` $$
CREATE PROCEDURE `spTest`(p_title VARCHAR(200), p_description TEXT)
DETERMINISTIC
BEGIN
INSERT INTO category (title, description)
VALUES (p_title, p_description);
END $$

DELIMITER ;

其中DELIMITER是用来决定SQL分隔符号的,在写Stored Procedure前,要先把预设的分号换掉,写完 Stored Procedure 的 routine_body 后,再回复成预设的分号。

相关日志

Tags:, .
评论数量() | Add Comments
本文网址:http://www.9usb.net/200810/mysql5-cunchuguocheng.html

There are No comments.

» You can leave a response

leave a reply