SQLite Forum

RAISE(ROLLBACK,...) giving 'no transaction error'
Login
If inside a trigger I use `RAISE(ROLLBACK,...)` I get an error that there is no transaction.  That's correct.

If I use `ABORT` instead of `ROLLBACK` my understanding is it will not rollback a transaction, only abort the current statement.

So, how do I cope with both at the same time?

I need a trigger that will rollback the whole transaction when run from inside a transaction but give no error (and abort just the statement) when run from outside an explicit transaction.