[sqlite] Easiest way to pass SQL query parameters in command line?

2015-11-05 Thread Clemens Ladisch
Yuri wrote: > I am looking for a way to have a parametrized query, when parameter is passed > through the command line. Isn't the query itself passed through the command line? Show some example. Regards, Clemens

[sqlite] Easiest way to pass SQL query parameters in command line?

2015-11-05 Thread Simon Slavin
> On 5 Nov 2015, at 10:13pm, Yuri wrote: > > In my case script is like this: > #!/bin/sh > (cat $1 && echo ";") | sqlite3 my-db.sqlite > > Command to run it: > ./my-sql-run sqls/my-query.sql > > I need to pass some parameter, like "select * from table where > kind=%%MYPARAM%%" Use echo or to

[sqlite] Easiest way to pass SQL query parameters in command line?

2015-11-05 Thread Yuri
On 11/05/2015 14:00, Clemens Ladisch wrote: > Isn't the query itself passed through the command line? Show some example. In my case script is like this: #!/bin/sh (cat $1 && echo ";") | sqlite3 my-db.sqlite Command to run it: ./my-sql-run sqls/my-query.sql I need to pass some parameter, like "

[sqlite] Easiest way to pass SQL query parameters in command line?

2015-11-05 Thread Yuri
I am looking for a way to have a parametrized query, when parameter is passed through the command line. Much like a prepared statement and '?' parameters. Is this possible? I can't find anything like this in the sqlite3 man page. Another way would be if sqlite had a function to access the enviro