Unable to find User-defined Function

Viewed 120

I have a UDF defined as follows:

Create Or Replace Function Minder_Mvp.Sprint4.Get_Customer_Key(Store_Key VARCHAR)
Returns Table (Customer_Key BIGINT)
AS 

'Select Customer_Key From CustomerBrand
Where CustomerBrand.Brand_Key = 1'

;

And then I attempt to call it like this:

Select Minder_Mvp.Sprint4.Get_Customer_Key('457');

When I do so, I get the following error:

Unknown user-define function Minder_MVP.SPRINT4.GET_CUSTOMER_KEY

Must be something obvious but I am not seeing it.

1 Answers

It is an user defined table function:

A UDTF can be accessed in the FROM clause of a query.

Select Minder_Mvp.Sprint4.Get_Customer_Key('457');

=>

SELECT *
FROM TABLE(Minder_Mvp.Sprint4.Get_Customer_Key('457')) s;
Related