here is an example of how to use the spread operator in a UDF:
CREATEOR REPLACE FUNCTION udf__multiply(a NUMBER DEFAULT1, b NUMBER DEFAULT1, c NUMBER DEFAULT1, d NUMBER DEFAULT1)
RETURNS NUMBER
AS
$$
a * b * c * d
$$
;
-- Spread Operator to convert the array into individual argumentsSELECT udf__multiply(**[1, 2]);
-- Returns: 2SELECT udf__multiply(**[1, 2, 8]);
-- Returns: 16SELECT udf__multiply(**[1, 2, 10, 10]);
-- Returns: 200
here is an example of how to use the spread operator in a UDF:
CREATE OR REPLACE FUNCTION udf__multiply(a NUMBER DEFAULT 1, b NUMBER DEFAULT 1, c NUMBER DEFAULT 1, d NUMBER DEFAULT 1) RETURNS NUMBER AS $$ a * b * c * d $$ ; -- Spread Operator to convert the array into individual arguments SELECT udf__multiply(**[1, 2]); -- Returns: 2 SELECT udf__multiply(**[1, 2, 8]); -- Returns: 16 SELECT udf__multiply(**[1, 2, 10, 10]); -- Returns: 200