Reputation: 16105
CREATE FUNCTION testing(id INT, dsc TEXT) RETURNS TEXT
BEGIN
DECLARE ntxt TEXT;
SET ntxt = dsc;
RETURNS ntxt;
END;
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 'TEXT' at line 3
What i miss here ?
Upvotes: 0
Views: 119
Reputation: 146460
RETURN
has an extra S
This does work:
DELIMITER //
CREATE FUNCTION testing(id INT, dsc TEXT) RETURNS TEXT
BEGIN
DECLARE ntxt TEXT;
SET ntxt = dsc;
RETURN ntxt;
END//
Upvotes: 1
Reputation: 37364
You probably forgot to add DELIMITER $$
in the very beginning of your script (Standard delimiter is ;
, and it's also used in procedures/functions). For example,
DELIMITER $$
[CREATE FUNCTION ...... ]
$$
DELIMITER ;
Upvotes: 0