Hi there,
I was wondering if we can create our own functions in queries.
For this I am using the example provided in the VERTICA documentation.
Query 1: Create function
CREATE FUNCTION myzeroifnull(x INT) RETURN INT
AS BEGIN
RETURN (CASE WHEN (x IS NOT NULL) THEN x ELSE 0 END);
END;
Query 2: Create tabel
CREATE TABLE tabwnulls(col1 INT);
INSERT INTO tabwnulls VALUES(1);
INSERT INTO tabwnulls VALUES(NULL);
INSERT INTO tabwnulls VALUES(0);
SELECT * FROM tabwnulls;
Query 3: Check if function exists
I can see that the function is listed under USER_FUNCTIONS
SELECT * FROM USER_FUNCTIONS WHERE function_name = 'myzeroifnull'
Query 4: use function
SELECT myzeroifnull(col1) FROM tabwnulls;
>> Ausführungsfehler: Function MYZEROIFNULL is not supported
Am I doing something wrong here or is this functionality not supported by Celonis?
All the best,
Saša