Ryan, Simon, thank you both for the help. The script works fine, and I now also understand how to use this bail mechanism. It is great!
once more: THANK YOU! gert 2015-04-01 23:17 GMT+02:00 Simon Slavin <slavins at bigfraud.org>: > > On 1 Apr 2015, at 8:09pm, Gert Van Assche <gertva at gmail.com> wrote: > > > But this is definitely not the right way to do it. If I understand the > doc > > correctly, it should be an expression, but I don't see how I can do > this... > > You can trigger a bail by causing any SQL error. For example, inserting a > duplicate value in a column which is declared UNIQUE, maybe a primary key. > Or inserting a NULL value in a column defined as NOT NULL. Or failing any > other constraint check. So you may be able to use CASE or a calculation to > arrange that under the condition you're watching, one of these happens. > > You may be able to check the value returned by sqlite3 as it exits to see > whether it bailed or exited normally. > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >