Try the following script:

Select "statement";
.exit
Select "after exit";

Running the script as an init file produces only the first text. An .exit 
command in an init file will only terminate the execution of the init file 
itself, not the sqlite shell as a whole. This is intended.

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Stéphane AULERY
Gesendet: Freitag, 31. August 2018 19:30
An: sqlite-users@mailinglists.sqlite.org
Cc: saul...@legtux.org
Betreff: [EXTERNAL] [sqlite] .exit in script is not working

Hello,



When I use the -init option the .exit statement at the end of my script is 
never executed.



I launch sqlite from a batch file on Windows Server 2012 and Windows 7 64 bit.





Command line :



sqlite3.exe -init myscript.scr





myscript.scr :



.log sqlite.log

.bail off

.nullvalue ""



CREATE TABLE STOCKSMAG (

Article TEXT,

CodeDepot TEXT,

QteStock INTEGER,

ECclient INTEGER,

Dispo INTEGER,

ECfour INTEGER,

Proj INTEGER,

DateGen DATETIME,

SeuilReappro INTEGER

);



.import STOCKSMAG.txt STOCKSMAG







.output STOCKSCUMUL.txt



SELECT

     Article,

     SUM (QteStock) AS QteStock,

     SUM (ECclient) AS ECclient,

     SUM (Dispo) AS Dispo,

     SUM (ECfour) AS ECfour,

     SUM (Proj) AS Proj

FROM STOCKSMAG

GROUP BY Article

ORDER BY Article;



.exit





STOCKSMAG.txt :



Article|CodeDepot|QteStock|ECclient|Dispo|ECfour|Proj|DateGen|SeuilReappro

000001|117|0|0|0|0|0|30/08/2018|

000001|118|0|0|0|0|0|30/08/2018|

000001|121|0|0|0|0|0|30/08/2018|

000001|125|0|0|0|0|0|30/08/2018|



Regards,



--

Stéphane Aulery

Développeur



Service informatique

Narbonne Accessoires

04.68.44.16.54



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to