https://questdb.io logo
Title
h

Hristo Katsarski

04/27/2023, 12:21 PM
Hello QDB team, Have question on the number of rows updated, returned from a Java PreparedStatement. We have an update SQL like that:
UPDATE 'stock' set open = ?, high = ?, low = ?, close = ?, volume = ? WHERE code = ? AND ddate = ?
The open, high, low and close are set as doulbe-s, volume as long, code is String and ddate a Timestamp. The expected number updated rows is returned by:
int cntUpd = prepStmt.executeUpdate();
and should be 1 but I'm getting other random values. When querying the data via QDB web-console the updated row is correct, and there are no other updated rows. Looks like the result of an update should be ignored. Table is partitioned and with WAL.
b

Bolek Ziobrowski

04/27/2023, 12:27 PM
Hi @Hristo Katsarski. I don't think WAL-enabled tables support returning count . See : For a WAL table, the following existing operations may have different behaviors from a non-WAL table:
UPDATE
No row count returnedNo support for
JOIN
at https://questdb.io/docs/concept/write-ahead-log/ .
Update on non-WAL table should return correct count . We're working on removing this and other limitations of WAL tables .
h

Hristo Katsarski

04/27/2023, 12:32 PM
Hi Bolek, Thank you for your prompt response. I was looking at various places in the the QDB docs but haven't found this information. Good to know, thanks!