Closed eegasai closed 2 years ago
@eegasai Hi!
If you want to use named parameters with IN operator you can do it like this:
var result = await snowflakeClient.QueryAsync<Employee>
("SELECT * FROM EMPLOYEES WHERE TITLE IN (:TitleA, :TitleB, :TitleC);",
new { TitleA = "Programmer", TitleB = "Janitor", TitleC = "CEO" });
However I think positional parameters fits for this task more naturally:
var result = await snowflakeClient.QueryAsync<Employee>
("SELECT * FROM EMPLOYEES WHERE TITLE IN (?, ?, ?);",
new string[] { "Programmer", "Janitor", "CEO" });
I am trying to implement Bind parameters with the SQL query like example below (only with the named parameters)
If I have a IN clause in SQL query how can I use the Bind parameter ? I have tried to create a comma separated string and bind it to the parameter, but its not working. Can you help with an example?