Link to home
Create AccountLog in
Avatar of tonelm54
tonelm54

asked on

Creating a function to remove - from uuid

Good evening,
Ive been playing around with a function, which removes the - from the uuid() statment.

delimiter //
CREATE FUNCTION uuid2()
RETURNS STRING
DETERMINISTIC
BEGIN
DECLARE strUUID STRING;
SET strUUID = REPLACE(uuid(),"-","");
return strUUID;
END//
delimiter ;

Open in new window


And then call it like
select uuid2();

However everytime I try the above code I get an error similar to:-
ERROR: Unknown Punctuation String @ 11
STR: //
SQL: delimiter //

Any suggestions on what Ive messed up with would be appriciated!

Thank you


Select uuid2();
ASKER CERTIFIED SOLUTION
Avatar of sshah254
sshah254

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer