Witam, potrzebuję funkcji, która weźmie mi dowolny znak, i zwróci go podwójnie. Mam coś takiego, lecz to mi nie działa -
delimiter //
create function data() returns varchar(2) deterministic
-> set @a = substr('qwertyuiopasdfghjklzxcvbnm',rand()*25+1,1);
-> return @a + @a;
-> //
Błąd mam taki -
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'set @a = substr('qwertyuiopasdfghjklzxcvbnm',rand()*25+1,1);
return @a + @a' at line 2
Co jest nie tak z tą funkcją?