无参数MySQL存储过程
我试图创建一个过程,但它给了我语法错误。我不确定是什么问题无参数MySQL存储过程,mysql,stored-procedures,Mysql,Stored Procedures,我试图创建一个过程,但它给了我语法错误。我不确定是什么问题 delimiter $$ create procedure inactivity() LANGUAGE SQL begin [mysql block] end $$ delimiter; 请尝试以下sql代码: delimiter $$ drop procedure if exists question_i
delimiter $$
create
procedure inactivity()
LANGUAGE SQL
begin
[mysql block]
end $$
delimiter;
请尝试以下sql代码:
delimiter $$
drop procedure if exists question_inactivity;
create procedure question_inactivity()
begin
delete from questions_temp where active= 1;
update questions set active = 0 where question_id in(select question_id from questions_temp);
drop table questions_temp;
end $$
delimiter;
------------------------------更新------------------------------------
我在phpmyadmin中运行这个程序,它可以工作:
delimiter $$
create procedure question_inactivity()
begin
delete from questions_temp where active= 1;
update questions set active = 0 where question_id in(select question_id from questions_temp);
drop table questions_temp;
end
$$
在分隔符输入字段中,我输入了以下值:$$请尝试以下sql代码:
delimiter $$
drop procedure if exists question_inactivity;
create procedure question_inactivity()
begin
delete from questions_temp where active= 1;
update questions set active = 0 where question_id in(select question_id from questions_temp);
drop table questions_temp;
end $$
delimiter;
------------------------------更新------------------------------------
我在phpmyadmin中运行这个程序,它可以工作:
delimiter $$
create procedure question_inactivity()
begin
delete from questions_temp where active= 1;
update questions set active = 0 where question_id in(select question_id from questions_temp);
drop table questions_temp;
end
$$
在分隔符输入字段中,我输入了这个值:$$我自己计算出来的。错误在于分隔符和分号之间没有空格 我自己想出来的。错误在于分隔符和分号之间没有空格 错误消息是什么?它与哪一行有关?@w5m,这是错误:#1064-您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以了解在第2TIP行的“创建过程问题\非活动性()开始从问题\临时位置删除”附近使用的正确语法:正确编写每个SQL语句,以
结束行代码>必要时,在[mysql块]中,错误消息是什么,它与哪一行有关?@w5m,这是错误:#1064-您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以了解在第2TIP行的“创建过程问题\非活动性()开始从问题\临时位置删除”附近使用的正确语法:正确编写每个SQL语句,以结束行代码>必要时,在[mysql块]内