Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array binding for IN Clause #676

Closed
dazinator opened this issue Jun 8, 2023 · 1 comment
Closed

Array binding for IN Clause #676

dazinator opened this issue Jun 8, 2023 · 1 comment
Assignees
Labels
feature status-triage Issue is under initial triage

Comments

@dazinator
Copy link

What is the current behavior?

After reading about array binding: https://github.com/snowflakedb/snowflake-connector-net#bind-array-variables
I thought I'd try and use array binding to paramterise an IN clause:

I get an exception - "Bind variable ? not set"


  using (var cmd = conn.CreateCommand())
            {
                List<string> myValues = new List<string>() { "KZ", "KR" };
                cmd.CommandText = "SELECT FOO FROM BAR WHERE FOO IN (?)";

                var p1 = cmd.CreateParameter();
                p1.ParameterName = "1";
                p1.DbType = DbType.String;
                p1.Value = myValues .ToArray();
                cmd.Parameters.Add(p1);

                using (var reader = cmd.ExecuteReader())
                {
                    while (reader.Read())

What is the desired behavior?

Perhaps this could be supported?

How would this improve snowflake-connector-net?

Make it easier to paramaterise queries with In clauses.

References, Other Background

What is your Snowflake account identifier, if any?

@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Jun 8, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage Issue is under initial triage label Jun 8, 2023
@sfc-gh-dszmolka
Copy link
Contributor

hi - i think we can use #169 to track this requirement for VARIANT (and ARRAY) binding, but if this is something entirely different please let me know

@sfc-gh-dszmolka sfc-gh-dszmolka closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status-triage Issue is under initial triage
Projects
None yet
Development

No branches or pull requests

2 participants