Skip to content

Execute batch doesn't work for new "delete" syntax #296

@doom369

Description

@doom369

Query:

ALTER TABLE reporting_average_minute delete WHERE device_id = ?

try (PreparedStatement deleteQuery = connection.prepareStatement(query)) {
       deleteQuery.setInt(1, deviceId);
       deleteQuery.addBatch();
       deleteQuery.executeBatch();
}

could no be executed in the batch due to error:

java.sql.SQLSyntaxErrorException: Query must be like 'INSERT INTO [db.]table [(c1, c2, c3)] VALUES (?, ?, ?)'. Got: ALTER TABLE reporting_average_minute delete WHERE device_id = ?
	at ru.yandex.clickhouse.ClickHousePreparedStatementImpl.executeBatch(ClickHousePreparedStatementImpl.java:355) ~[clickhouse-jdbc-0.1.50.jar:?]
	at ru.yandex.clickhouse.ClickHousePreparedStatementImpl.executeBatch(ClickHousePreparedStatementImpl.java:348) ~[clickhouse-jdbc-0.1.50.jar:?]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions