Shane.  That's very interesting considering the effort to make the one
thing happen exactly once without external software dependency.
Does the capability to write specially named local files but not have a
periodic loop nor network capability somehow get your application off the
ground?
Based on your problem statement, the user would have to initiate your
script and know when/if it is required to be run...

I had in mind adding periodic and conditional dot commands to SQLite shell
- to simulate continuous operation of application code.  If you've figured
out a way around needing such things to make a useful standalone SQLite
application, I would be very interested to understand how that works.

Peter





On Sun, Jan 14, 2018 at 2:33 PM, Shane Dev <devshan...@gmail.com> wrote:

> Hi Simon,
>
> I have found a way achieve this purely in the SQLite shell. The trick is to
> make all rows in tcout1 SQL statements and then execute them.
>
> sqlite> CREATE TABLE tcout1(sql text);
> sqlite> CREATE TABLE tcout2(sql text);
> sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> '.headers off';";
> sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> '.once tc'||strftime('%s','now');";
> sqlite> insert into tcout1(sql) select "insert into tcout2(sql) select
> 'select * from tc;';";
> sqlite> .once tcout1.sql
> sqlite> select * from tcout1;
> sqlite> .read tcout1.sql
> sqlite> select * from tcout2;
> .headers off
> .once tc1515968593
> select * from tc;
>
>
> On 13 January 2018 at 19:57, Simon Slavin <slav...@bigfraud.org> wrote:
>
> > On 13 Jan 2018, at 6:48pm, Shane Dev <devshan...@gmail.com> wrote:
> >
> > > Is there a way to execute the contents of certain rows (the second row
> in
> > > this example) and replace it with its own result to create second
> table /
> > > view which could interpreted by the sqlite shell?
> >
> > Not inside the SQLite shell.
> >
> > Looks like you need to learn programming.  Or at least how to script your
> > OS shell.  Which OS are you using ?  And if it’s Linux/Unix, which shell
> > are you using ?
> >
> > Simon.
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to