You need to redirect "standard error" to "standard output". In linux/bash this 
is achieved by adding "2>&1" to your command line.

-----Ursprüngliche Nachricht-----
Von: sqlite-users-boun...@mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Kaja 
Varunkumar
Gesendet: Montag, 27. Juni 2016 11:28
An: sqlite-users@mailinglists.sqlite.org
Betreff: [sqlite] Regarding redirecting SQL results and errors to a single 
output file.

Hello,

sqlite -echo test.sqlite < test44.sql > test44.out.
When I am running above command in windows command prompt, succeed query 
redirected to test44.out and errors are displayed on the command prompt.
Here I want all the succeed and failed queries in one file.

*EXAMPLE :-*
 C:\Users\vkaja\Desktop\testing_mysql>sqlite -echo test.sqlite < test44.sql
> ./output/test44.out
Error: near line 13: no such function: log_file_check
Error: incomplete SQL: exit

*In test.out :-*
--include mkemp.txt
--Join Select
--General

SELECT E.*, D.DNAME FROM EMP E, DEPT D WHERE E.EMPNO = 102 AND E.DEPTNO = 
D.DEPTNO;
102|NAME2|TITLE2|1958-02-02 02:02:02||20000.0|1|Software
102|NAME2|ASSISTANT||||1|Software
--Support table aliases
SELECT E.ENAME AS EMP_NAME, D.DNAME AS DEPT_NAME  FROM EMP E, DEPT D WHERE 
E.DEPTNO = D.DEPTNO;
NAME1|Software
NAME2|Software
NAME3|Sales
NAME4|Software
NAME5|Sales
NAME6|Software
NAME7|Software
NAME8|Marketing
NAME9|Marketing
NAME1|Software
NAME2|Software
NAME3|Sales
NAME4|Software
NAME5|Sales
NAME6|Software
NAME7|Software
NAME8|Marketing
NAME9|Marketing

-- Select With Order By
SELECT EMP.EMPNO, EMP.ENAME, EMP.JOB, EMP.HIREDATE, EMP.SAL, EMP.COMM, 
EMP.DEPTNO FROM DEPT DEPT, EMP EMP ORDER BY EMP.EMPNO, EMP.HIREDATE;
10|Jack|ASSISTANT||||100
10|Jack|ASSISTANT||||100
10|Jack|ASSISTANT||||100
10|Jack|ASSISTANT||||100
10|Jack|ASSISTANT||||100
10|Jack|ASSISTANT||||100
102|NAME2|ASSISTANT||||1
102|NAME2|ASSISTANT||||1
102|NAME2|ASSISTANT||||1
102|NAME2|TITLE2|1958-02-02 02:02:02||20000.0|1
102|NAME2|TITLE2|1958-02-02 02:02:02||20000.0|1
102|NAME2|TITLE2|1958-02-02 02:02:02||20000.0|1
103|NAME3|ASSISTANT||||2
103|NAME3|ASSISTANT||||2
103|NAME3|ASSISTANT||||2
103|NAME3|TITLE3|1997-03-12 08:09:54||1000.5|2
103|NAME3|TITLE3|1997-03-12 08:09:54||1000.5|2
103|NAME3|TITLE3|1997-03-12 08:09:54||1000.5|2
104|NAME4|ASSISTANT||||1
104|NAME4|ASSISTANT||||1
104|NAME4|ASSISTANT||||1
104|NAME4|TITLE4|1997-04-02 00:00:00||2.22|1
104|NAME4|TITLE4|1997-04-02 00:00:00||2.22|1
104|NAME4|TITLE4|1997-04-02 00:00:00||2.22|1
105|NAME5|ASSISTANT||||2
105|NAME5|ASSISTANT||||2
105|NAME5|ASSISTANT||||2
105|NAME5|TITLE5|1997-06-12 08:09:54||1000.5|2
105|NAME5|TITLE5|1997-06-12 08:09:54||1000.5|2
105|NAME5|TITLE5|1997-06-12 08:09:54||1000.5|2
106|NAME6|ASSISTANT||||1
106|NAME6|ASSISTANT||||1
106|NAME6|ASSISTANT||||1
106|NAME6|TITLE6|1997-06-12 02:02:02||2.22|1
106|NAME6|TITLE6|1997-06-12 02:02:02||2.22|1
106|NAME6|TITLE6|1997-06-12 02:02:02||2.22|1
107|NAME7|ASSISTANT||||1
107|NAME7|ASSISTANT||||1
107|NAME7|ASSISTANT||||1
107|NAME7|TITLE7|1997-06-22 02:02:02||20000.0|1
107|NAME7|TITLE7|1997-06-22 02:02:02||20000.0|1
107|NAME7|TITLE7|1997-06-22 02:02:02||20000.0|1
108|NAME8|ASSISTANT||||3
108|NAME8|ASSISTANT||||3
108|NAME8|ASSISTANT||||3
108|NAME8|TITLE8|1997-07-12 08:09:54||2000.5|3
108|NAME8|TITLE8|1997-07-12 08:09:54||2000.5|3
108|NAME8|TITLE8|1997-07-12 08:09:54||2000.5|3
109|NAME9|ASSISTANT||||3
109|NAME9|ASSISTANT||||3
109|NAME9|ASSISTANT||||3
109|NAME9|TITLE9|2010-07-20 02:02:02||2.22|3
109|NAME9|TITLE9|2010-07-20 02:02:02||2.22|3
109|NAME9|TITLE9|2010-07-20 02:02:02||2.22|3
110|NAME1|ASSISTANT||||1
110|TEMP|ASSISTANT||||4
110|NAME1|ASSISTANT||||1
110|TEMP|ASSISTANT||||4
110|NAME1|ASSISTANT||||1
110|TEMP|ASSISTANT||||4
110|NAME1|TITLE1|1990-02-02 02:02:02||2000.9|1
110|NAME1|TITLE1|1990-02-02 02:02:02||2000.9|1
110|NAME1|TITLE1|1990-02-02 02:02:02||2000.9|1
110|TEMP|ASSISTANT|2010-07-20 02:02:02|||4
110|TEMP|ASSISTANT|2010-07-20 02:02:02|||4
110|TEMP|ASSISTANT|2010-07-20 02:02:02|||4

-- check the log file

Thanks,
varun
_______________________________________________
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
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


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

Reply via email to