I am writing the below function in snowflake.
create OR REPLACE function myTestFunc(tbl_name VARCHAR, Column_Name varchar, id VARCHAR)
returns varchar
as
$$
select Column_Name from tbl_name WHERE Column_Name=id
$$
;
How to pass the table and column names as input parameters and use those parameter as table and column names within the query. Here the parameters are treated as string literals but not as a table or column name. Is there any way to achieve this within user defined functions.
Thanks