On Sun, Mar 15, 2015 at 5:19 AM, Petr L?z?ovsk? <lazna at volny.cz> wrote:

> As far as I understood you comment (english is not my first language),
> executing script could not provided specified resultcode because many fails
> can occur and exitcode is only one?
>

Essentially, yes. The result code of 1 appears to have been created for
it's own explicit informational purpose(s) and obviously it was reported
first. That is all.


>
> But multiple fails can occurs on long cmdline too. What happens on this
> case? My logic says the internal sqlite command parser stop on first error
> founded, set-up exitcode, print error message and terminate. After
> correction this error, than start displaying second error, until all errors
> are corrected (ideal).
>
> L.
>

Well, beyond the result codes document itself, the implementation details
for this case (per cmdline within the shell) are discoverable by you
and may depend upon which of a variety of (third-party) command-line
editing libraries, the sqlite3 command-line shell program is linked against.


>
> > On Sat, Mar 14, 2015 at 7:33 AM, Petr L?z?ovsk? <lazna at volny.cz>wrote:
>
> > Just discovered the resulcodes differ if perform:
>
> >   ----------------------------------------
> >   sqlite3.exe %db% < script.sql
>
> >   the %errorlevel% is 1
> >   ------------------------
>
> >   but by
>
> >   ------------------------
> >   sqlite3.exe %db% "UPDATE table SET 'xxxx=yyyy'";
>
> >   the errorlevel is 19 (correct as by "
> https://www.sqlite.org/c3ref/c_abort.html";)
> >   ----------------------------------------------
>
> >   both command produce same (correct) erromessage:
>
> >   Error: near line 1: UNIQUE constraint failed: table.xxxx
>
>
>
> >   Why I got different exitcodes? Is is possible to get proper exitcode
> if command loaded from script file too?
>
>
>
> > According to your logic ...which error code do you believe should be
> returned if a plurality of the SQLite statements in your piped script file
> were to cause some variety of different  error events?
>
>
--
   --
      --
         --???--
        K e V i N

Reply via email to