Here is my code:
create function getten() returns integer
begin
return 10;
end
giving me error message:
1064 - 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 '' at line 3
I have no idea what the '' is all about. Any help please?
First of all, SQL code is written in big letters. Second, please remember indention.
DELIMITER $$
CREATE FUNCTION getten()
RETURNS INTEGER
LANGUAGE SQL
BEGIN
RETURN 10;
END;
$$
DELIMITER ;
should work like this.
This works for me...
DELIMITER $$
CREATE FUNCTION getten()
RETURNS INTEGER
BEGIN
RETURN 10;
END;
$$
DELIMITER ;
SELECT getten();
+----------+
| getten() |
+----------+
| 10 |
+----------+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With