sql语法错误:mysql server返回timestamp

ct3nt3jp  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(282)

我得到以下错误:
1064-sql语法;mysql server返回timestamp deterministic begin declare dt\u act timestamp;选择1号线
这是我的密码:

DROP FUNCTION IF EXISTS NewProc;
DELIMITER //
CREATE  FUNCTION NewProc(f_test varchar)
 RETURNS timestamp deterministic
BEGIN

DECLARE dt_act timestamp;
    select cast((case
when str_to_date(activation_date,'%d-%M-%Y') is not null then date_format(str_to_date(activation_date,'%d-%M-%Y'),'%Y-%m-%d') 
when str_to_date(activation_date,'%d-%m-%Y') is not null then date_format(str_to_date(activation_date,'%d-%m-%Y'),'%Y-%m-%d')
ELSE
date_format(str_to_date(activation_date,'%Y-%M-%d'),'%Y-%m-%d')
end) as timestamp ) into dt_act from abc where phone_no =f_test;

    RETURN dt_act;
END //

DELIMITER ;

错误:
1064-您的sql语法有错误;检查与您的mysql服务器版本相对应的手册,以获得使用near')returns timestamp deterministic begin declare dt\u act timestamp的正确语法;选择1号线

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题