Reputation: 3565
I am getting a syntax error with this simple sample script in MySql 5.6.17 :
CREATE FUNCTION sampldb.fn_x(param VARCHAR(20))
RETURNS int
BEGIN
return 1;
END
What am i doing wrong? In Sql workbench, the error is shown in the last 2 lines.
Upvotes: 0
Views: 991
Reputation: 1196
use DELIMITER
DELIMITER //
CREATE FUNCTION sampldb.fn_x(param VARCHAR(20))
RETURNS int
BEGIN
return 1;
END
//
Upvotes: 3