como crear funciones
Publicado por felipe (7 intervenciones) el 31/05/2007 22:43:11
hola,
soy novato en mysql y estoy tratando de crear la siguiente funcion
delimiter$
CREATE FUNCTION hello(s VARCHAR(20)) RETURNS VARCHAR(50)
BEGIN
IF s = 'test' THEN RETURN 'haha';
END IF;
RETURN'hoho'
end$
delimiter;
resulta que cuando escribo el ";" (punto y coma) me sale el siguiente error
error 1064 (42000): you have an error in your sql sintax; check the manual that corresponds to your mysql server version for the right sintax to use near RETURN 'haha'' at line 3
LA VERSION CON QUE TRABAJO ES mysql-essential-5.2.3-falcon-alpha-win32
ojala puedan ayudarme gracias.
soy novato en mysql y estoy tratando de crear la siguiente funcion
delimiter$
CREATE FUNCTION hello(s VARCHAR(20)) RETURNS VARCHAR(50)
BEGIN
IF s = 'test' THEN RETURN 'haha';
END IF;
RETURN'hoho'
end$
delimiter;
resulta que cuando escribo el ";" (punto y coma) me sale el siguiente error
error 1064 (42000): you have an error in your sql sintax; check the manual that corresponds to your mysql server version for the right sintax to use near RETURN 'haha'' at line 3
LA VERSION CON QUE TRABAJO ES mysql-essential-5.2.3-falcon-alpha-win32
ojala puedan ayudarme gracias.
Valora esta pregunta


0