I'm editing this post - Oops, I realized I should have posted this in the New to Vertica Development Forum (Sorry)
This post was moved here from the "Vertica Database Development" forum by knicely87
Moderator: NorbertKrupa
This post was moved here from the "Vertica Database Development" forum by knicely87
Code: Select all
dbadmin=> select reverse('Vertica');
ERROR: function reverse("unknown") does not exist, or permission is denied for reverse("unknown")
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
Code: Select all
dbadmin=> create function reverse(x varchar) return varchar
dbadmin-> as
dbadmin-> begin
dbadmin-> -- Simple reverse function limited to 10 characters
dbadmin-> return (substr(x, 10, 1 ) || substr(x, 9, 1 ) || substr(x, 8, 1 ) || substr(x, 7, 1 ) ||
dbadmin(> substr(x, 6, 1 ) || substr(x, 5, 1 ) || substr(x, 4, 1 ) || substr(x, 3, 1 ) ||
dbadmin(> substr(x, 2, 1 ) || substr(x, 1, 1 ));
dbadmin->
dbadmin->
dbadmin-> end;
CREATE FUNCTION
Code: Select all
dbadmin=> select reverse('Vertica');
reverse
---------
acitreV
(1 row)
Code: Select all
dbadmin=> select reverse('foo bar baz palindrom egg spam');
reverse
--------------------------------
maps gge mordnilap zab rab oof
(1 row)