Kees Nuyt <k.nuyt@...> writes: > > On Tue, 24 Dec 2013 22:55:32 -0500, dmitry babitsky > <dbabits@...> wrote: > > >*bug description:* > >Using PRAGMA busy_timeout outputs the value which in case of html output > >screws up the display. > >To be more precise, it creates an extra row/recordset with the timeout > >value, which is what then shows on the html page. > > > >There should be a way to say "set the pragma, but don't output it". > >It is especially important for -html mode which is designed for end-user > >consumption. > >What's more, it's very difficult to grep away as you can see. > > > >*To replicate:* > > > >echo "create table foo as select 1 as c;select * from foo;" |sqlite - html > >-header -cmd "PRAGMA busy_timeout =1000;" :memory: > >*<TR><TH>timeout</TH>* > >*</TR>* > >*<TR><TD>1000</TD>* > >*</TR>* > ><TR><TH>c</TH> > ></TR> > ><TR><TD>1</TD> > ></TR> > > Although it would be nice to have that PRAGMA output suppressed, there is an easy workaround > (oneliner wrapped by mail) : > > printf ".output stderr\nPRAGMA busy_timeout =1000;\n.output stdout\ncreate table foo as select 1 as > c;select * from foo;" |sqlite3 2>/dev/null -html -header :memory: > > yields: > > <TR><TH>c</TH> > </TR> > <TR><TD>1</TD> > </TR> >
Kees, Thanks for the idea, however I cannot use it. It works for you because you have 2>/dev/null But this also discards every error message that sqlite may throw, which I prefer to receive. For that reason, my code has 2>&1, which nullifies your workaround. Any other ideas short of across-the-newline grepping out unwanted output? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users