I am trying to pass a CASE statement similar to the one below as a column in a SELECT statement on a Snowflake query. I am doing this by creating bindings using SqlKata in a .NET application and running the query.
Binding Key: :parameterizedColumn0
Binding Value: “CASE WHEN DEPARTMENT LIKE ‘%Dallas%’ THEN ‘Home’ ELSE ‘Other’ END”
SELECT Statement: SELECT Column1, Column2, Column3, :parameterizedColumn0 FROM MyTable
The issue I am facing is the case statement is showing up as a string, exactly as shown above in the results, instead of actually generating the values based on the results of the case statement.
I have also tried using IDENTIFIER(:parameterizedColumn0) but end up getting syntax errors.
Does anyone know how I can actually get the results of the case statement to display in place of my binding?