Thanks to all answers. Are principles of such script OK, or I miss something?


set "_error="
sqlite3.exe %db% BEGIN;
for /f "tokens=2,3 delims=," %%a in (data.csv) do (
                        sqlite3 %db% "INSERT INTO payments(id,amount) VALUES 
('%%a','%%b')";
                        if errorlevel 1 set "_error=y"
                        )
if not defined _error (
                        sqlite3.exe %db% COMMIT;
                        ) else (
                        sqlite3.exe %db% ROLLBACK;
                        call stop_perform_another_scheduled_writings.cmd
                        call notify_admin_payment_writing_failed.cmd
                        )


L.


Reply via email to