2015-12-14 15:14 GMT+01:00 Clemens Ladisch <clemens at ladisch.de>:

> Cecil Westerhof wrote:
> > sqlite3 "${DATABASE}" "begin immediate" 2>/dev/null
> > errorCode="${?}"
> > if [[ "${errorCode}" -eq 5 ]] ; then
> >     printf "${DATABASE} is locked\n"
> >
> > I saw that when it is locked I get back a 5. Is this always the case?
>
> sqlite3 returns the SQLite error code, and 5 indeed is SQLITE_BUSY.
> (Non-SQL errors result in 1, which would be the same as SQLITE_ERROR.)
>

?And here are the other codes; ;-)
    https://sqlite.org/c3ref/c_abort.html?


-- 
Cecil Westerhof

Reply via email to