Stef Mientki wrote:
> to test complex queries, I want to use the command line utility ( or an 
> equivalent that remembers what I type).
>   
The sqlite command line program sqlite3.c will remember what you type if 
you build your own executable from the source. The command line will use 
the readline or editline libraries if they are available when building 
the executable. These libraries provide full command line history 
functionality.

These libraries are not used in the precompiled executables that you can 
download because of licensing issues. SQLite's public domain license is 
not compatible with the GPL and BSD license used by these libraries, so 
they can't be linked into the executables that are distributed by Richard.

I always build my own command line sqlite from source to ensure I get 
the history functions provided by these very useful libraries.

 
> Now I've a table which contains the names of a set of other tables.
> In Python I can easily create the SQL string (containing the field name) 
> and commit it to the database.
>
> Is there a way realize this in the command line ?
> So I need to get the result of a query into a variable and then use that 
> variable in a new query.
>   
If I understand your question (which seems a little vague to me), there 
is no way to build and execute SQL queries that include the result of 
other queries using the command line.

You can use one query to build the text of another query, but there is 
no way to execute the resulting query using the command line. The best 
you could do would be to pass the SQL query text result from one 
invocation of the command line as input to a second invocation of the 
command line where it would be executed. In effect you are using your 
command shell to store the result of the first query and pass it back 
into a second sqlite command. You would be replacing Python programming 
with bash shell scripting.

HTH
Dennis Cote
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to