-
Notifications
You must be signed in to change notification settings - Fork 508
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
Several statements in one query #51
Comments
Hello, @rasmus93!
It is always possible to separate statements in source string. And this approach gives you more options for error handling. Is there an issue behind this question? |
Hi again, Issue behind this is that I need to create local and distributed tables(based on local) or alter some columns(also do in local and distributed tables - equal changes). Thanks for answer! |
You probably mean "in a single transaction", aren't you? As far as I know, currently there are no transactions support in CH because of their impact on performance. Thus you can not assume that multiple statements written in a single query (if it would be possible) will be executed as an atomic change. BTW in Oracle RDBMS DDL statements make two implicit commits: before and after change. It means that it is impossible to rollback completed DDL. And "two-statement-in-one-query" trick is impossible too in that RDBMS. |
Thanks for discussion. Making the query through clickhouse-client:
So if a correct exception with correct code is thrown, this is ok. |
@rasmus93 you can use |
This will make ck server execute multiple SQLs in a single http request and cause error. Refs: - ClickHouse/clickhouse-java#51 - apla/node-clickhouse#28 - https://blog.csdn.net/xiaomin13234038121/article/details/124367641
@blanklin030 What's your ClickHouseDriver version? I tried |
This will make ck server execute multiple SQLs in a single http request and cause error. Refs: - ClickHouse/clickhouse-java#51 - apla/node-clickhouse#28 - https://blog.csdn.net/xiaomin13234038121/article/details/124367641
This will make ck server execute multiple SQLs in a single http request and cause error. Refs: - ClickHouse/clickhouse-java#51 - apla/node-clickhouse#28 - https://blog.csdn.net/xiaomin13234038121/article/details/124367641
Hi, @serebrserg !
Can we execute several statements in one query?
For example: "CREATE TABLE .....; CREATE TABLE .....;"
For now it is not working. Is it bug of jdbc-connector or normal behavior of database?
Thanks!
The text was updated successfully, but these errors were encountered: