SQLite Forum

return count from instead of insert trigger?
Login

return count from instead of insert trigger?

(1) By sixcorners on 2021-08-03 14:05:55 [link]

I get this error from my orm.
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: insert into...

I'm trying to write to a view with an INSTEAD OF INSERT trigger. The [docs](https://www.sqlite.org/lang_createtrigger.html#instead_of_triggers) say that instead of trigger firings are not counted.  Is there a way to report a number?

(2) By sixcorners on 2021-08-03 15:19:14 in reply to 1

Nevermind I [fixed](https://discourse.hibernate.org/t/insert-trigger-results-in-unexpected-row-count-error/5585) it on the ORM side.