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

INSERT INTO VALUES error #46

Open
Genuineh opened this issue Mar 19, 2022 · 1 comment
Open

INSERT INTO VALUES error #46

Genuineh opened this issue Mar 19, 2022 · 1 comment
Assignees

Comments

@Genuineh
Copy link

Hi, I got error when I run the code like

using var cnn = new ClickHouseConnection(settings.ToString());

await cnn.OpenAsync().ConfigureAwait(false);

using var cmd = cnn.CreateCommand("INSERT INTO cktest VALUES ({id:Int64}, {name:String})");

cmd.Parameters.AddWithValue("id", 1);
cmd.Parameters.AddWithValue("name", "name");

var res = await cmd.ExecuteNonQueryAsync().ConfigureAwait(false);

Error:

Octonica.ClickHouseClient.Exceptions.ClickHouseServerException : DB::Exception: Element of set in IN, VALUES or LIMIT or aggregate function parameter is not a constant expression (result column not found): CAST(__subquery_11347167823684683694_3925735668227058289, 'Int64'): While executing ValuesBlockInputFormat

I found a issues that said "Unfortunately, ClickHouse server doesn't support parameters in VALUES (...)."(#19 (comment))
but I could get right result when i used clickhouse client cli, like

clickhouse-client --user=default --password --param_id=1 --param_name="name" -q "INSERT INTO default.cktest VALUES ({id:Int64}, {name:String})"

Are you sure the clickhouse not support parameters in VALUES?

@Genuineh
Copy link
Author

My Clickhouse server version is v22.2.3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants