Hi all,

When running SQLite3 from command line, is there a way to interrupt the CMD
file when a condition is true?

I'm importing a lot of plain text files that should all count the same
number of lines, so I want to compare the record count of all imported data
with the first file that was imported.

I can detect this easily with a query like this:

       .import 'x.txt' T1
       .import 'y.txt' T2
       .mode list
       .output importerror.txt
       SELECT CASE (select count(*) from T1) WHEN (select count(*) from T2)
then 'OK' else 'Not all files contain the same number of lines' END;

This is in an "script.sql" file and I run it by executing a batch file
(runscript.cmd).

       type script.sql | sqlite3.exe test.db


My question is: when the import fails (detected in the script.sql file), I
would like to stop executing the batch file (runscript.cmd).

Is there a way to do so?

thanks for your thoughts,


Gert

Reply via email to