Re: [sqlite] Columns involved in a WHERE clause

2012-09-22 Thread Simon Slavin
On 21 Sep 2012, at 3:17pm, Marco Bambini wrote: > Can I parse the output of the EXPLAIN my_query statement in order to have an > indirect access to columns involved in the WHERE clause? Well, take a look at it. Do you think you can write a parser for it ? However, the format of the output of

Re: [sqlite] Columns involved in a WHERE clause

2012-09-22 Thread Marco Bambini
Can I parse the output of the EXPLAIN my_query statement in order to have an indirect access to columns involved in the WHERE clause? -- Marco Bambini http://www.sqlabs.com http://twitter.com/sqlabs On Sep 21, 2012, at 4:10 PM, Richard Hipp wrote: > On Fri, Sep 21, 2012 at 9:56 AM, Marco

Re: [sqlite] Columns involved in a WHERE clause

2012-09-21 Thread Simon Slavin
On 21 Sep 2012, at 3:22pm, Marco Bambini wrote: > Can I parse the output of the EXPLAIN my_query statement in order to have an > indirect access to columns involved in the WHERE clause? Is it good enough just to list the columns ? After all the WHERE clause can include any expression, and ca

Re: [sqlite] Columns involved in a WHERE clause

2012-09-21 Thread Richard Hipp
On Fri, Sep 21, 2012 at 10:22 AM, Marco Bambini wrote: > Can I parse the output of the EXPLAIN my_query statement in order to have > an indirect access to columns involved in the WHERE clause? > You could use EXPLAIN QUERY PLAN, but they would only tell you which terms were used for indexing. A

Re: [sqlite] Columns involved in a WHERE clause

2012-09-21 Thread Marco Bambini
Can I parse the output of the EXPLAIN my_query statement in order to have an indirect access to columns involved in the WHERE clause? -- Marco Bambini http://www.sqlabs.com http://twitter.com/sqlabs On Sep 21, 2012, at 4:10 PM, Richard Hipp wrote: > On Fri, Sep 21, 2012 at 9:56 AM, Marco Bam

Re: [sqlite] Columns involved in a WHERE clause

2012-09-21 Thread Simon Slavin
On 21 Sep 2012, at 3:09pm, Simon Slavin wrote: > On 21 Sep 2012, at 2:56pm, Marco Bambini wrote: > >> is there a way to extract column names involved in a WHERE clause I am very sorry, I completely missed that part of your question. Please ignore my previous answer. No, I don't think you c

Re: [sqlite] Columns involved in a WHERE clause

2012-09-21 Thread Richard Hipp
On Fri, Sep 21, 2012 at 9:56 AM, Marco Bambini wrote: > Hello, > is there a way to extract column names involved in a WHERE clause of a > query without manually parse the select statement? > > For example from a query like: > SELECT * FROM myTable WHERE col1=… AND col2=…; > I would need to extrac

Re: [sqlite] Columns involved in a WHERE clause

2012-09-21 Thread Simon Slavin
On 21 Sep 2012, at 2:56pm, Marco Bambini wrote: > is there a way to extract column names involved in a WHERE clause of a query > without manually parse the select statement? > > For example from a query like: > SELECT * FROM myTable WHERE col1=… AND col2=…; > I would need to extract both col1

[sqlite] Columns involved in a WHERE clause

2012-09-21 Thread Marco Bambini
Hello, is there a way to extract column names involved in a WHERE clause of a query without manually parse the select statement? For example from a query like: SELECT * FROM myTable WHERE col1=… AND col2=…; I would need to extract both col1 and col2. Thanks. -- Marco Bambini http://www.sqlabs.co