在sequel pro mariadb上保存mysql函数

gt0wga4j  于 2021-06-24  发布在  Mysql
关注(0)|答案(1)|浏览(411)

我有一个在脚本中运行的函数,但是当我试图在sequel pro mariadb上运行它以将其添加到函数列表中时,会出现一系列错误。

drop function if exists related_count;
create function related_count(parent int(11)) returns int(11)
begin
 declare count int(11) default 0;
 while parent!=0 and count<10 do
  set count=count+1;
  set parent=(select related from category where id=parent);
 end while
 return count
end

ev7lccsx

ev7lccsx1#

你需要一双鞋 DELIMITER 声明。
更多语句需要终止 ; .
在文档和本论坛中查找 CREATE FUNCTION .

相关问题