mysql存储过程定义错误,请大家看一下
createorreplaceprocedurep(INv_aint,INv_bint,OUTv_retint,INOUTv_tempint)beginifv_a>v_b...
create or replace procedure p
(IN v_a int, IN v_b int, OUT v_ret int, INOUT v_temp int)
begin
if v_a > v_b then
v_ret = v_a;
else
v_ret = v_b;
end if;
v_temp = vtemp + 1;
end
//
麻烦帮我看一下
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'proce
dure p
(IN v_a int, IN v_b int, OUT v_ret int, INOUT v_temp int)
begin
if' at line 1 展开
(IN v_a int, IN v_b int, OUT v_ret int, INOUT v_temp int)
begin
if v_a > v_b then
v_ret = v_a;
else
v_ret = v_b;
end if;
v_temp = vtemp + 1;
end
//
麻烦帮我看一下
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'proce
dure p
(IN v_a int, IN v_b int, OUT v_ret int, INOUT v_temp int)
begin
if' at line 1 展开
1个回答
展开全部
delimiter //
DROP PROCEDURE IF EXISTS p ;
CREATE PROCEDURE p (
IN v_a INT,
IN v_b INT,
OUT v_ret INT,
INOUT v_temp INT
)
BEGIN
IF v_a > v_b THEN
SET v_ret = v_a ;
ELSE
SET v_ret = v_b ;
END IF ;
SET v_temp = vtemp + 1 ;
END//
delimiter ;
你这基本语法都不会的,好好看下手册吧。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询