Options
user defined function
I need to create some user defined function in Vertica by sql. It looks like Vertica can support UDF. Do you have any document about that? Thanks.
0
Comments
What language are you looking for?
CREATE or REPLACE FUNCTION My_UDF(input int)
AS
DECLARE
v_char varchar(64)
BEGIN
v_char = to_char(input);
return v_char;
END;
/
https://community.vertica.com/vertica/topics/since_stored_procedure_is_not_supported_by_vertica_so_w...
It's a stored procedure since a UDF (from what I understand) is a script adapted from another language (C++, Java or R)
Replicating the above example shown by you as in Vertica standard.
If you need something like this, you can write a UDF SQL function like this:
CREATE FUNCTION PRINT_INPUT(x varchar) RETURN VARCHAR
AS
BEGIN
RETURN TO_CHAR(x);
END;
Hope this helps.