3 回答
TA贡献1797条经验 获得超6个赞
;
$$
;
mysql
DELIMITER
mysql
例子:
DELIMITER $$/* This is a complete statement, not part of the procedure, so use the custom delimiter $$ */DROP PROCEDURE my_procedure$ $/* Now start the procedure code */CREATE PROCEDURE my_procedure ()BEGIN /* Inside the procedure, individual statements terminate with ; */ CREATE TABLE tablea ( col1 INT, col2 INT ); INSERT INTO tablea SELECT * FROM table1; CREATE TABLE tableb ( col1 INT, col2 INT ); INSERT INTO tableb SELECT * FROM table2;/* whole procedure ends with the custom delimiter */END$ $/* Finally, reset the delimiter to the default ; */DELIMITER ;
DELIMITER
$mysqli = new mysqli('localhost', 'user', 'pass', 'test');$result = $mysqli->query('DELIMITER $$');echo $mysqli->error;
SQL语法出现错误;请检查与MySQL服务器版本相对应的手册,以获得在第1行“划界器$”附近使用的正确语法。
TA贡献1951条经验 获得超3个赞
TA贡献1816条经验 获得超6个赞
BEGIN...END
(;)
CREATE PROCEDURE
CREATE PROCEDURE
CREATE PROCEDURE
添加回答
举报