【发布时间】:2019-02-24 00:05:55
【问题描述】:
我正在尝试为我的数据库编写一个小日志程序。我用这个语句创建了一个程序:
create procedure prc_wirte_log (
in p_schema varchar(255),
in p_item varchar(255),
in p_message varchar(255)
)
begin
insert into weather.log (`schema`, item, message) values (p_schema, p_item, p_message);
end;
我收到错误Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 7 0.063 sec
为什么? MySQL Workbench 表示插入查询后的Incomplet Statment: excepting ;。
我能做什么?
【问题讨论】:
-
多语句过程(假设存在
BEGIN...END)需要分隔符覆盖,以防止它们包含的语句过早终止过程定义。 -
很好,这对我有用。分隔符的作用是什么?谢谢
标签: sql stored-procedures mariadb procedure