RE: [sqlite] Query generation

2006-12-06 Thread Fred Williams
s@sqlite.org > Subject: [sqlite] Query generation > > > Hi, > I am generating queries dynamically from my program based on > the input. > The primary part of the query is always > > select a from mytable where (b=0) and > > based on the user input I add mo

Re: [sqlite] Query generation

2006-12-06 Thread Darren Duncan
At 2:15 PM +0530 12/7/06, Lloyd wrote: Hi, I am generating queries dynamically from my program based on the input. The primary part of the query is always select a from mytable where (b=0) and based on the user input I add more where clauses to my query like select a from mytable where (b=0)

Re: [sqlite] Query generation

2006-12-06 Thread Lloyd
Thanks, 0=0 works well enough for me. (This hint is what I wanted) Thanks again, Lloyd On Wed, 2006-12-06 at 10:00 +0100, Mario Frasca wrote: > Lloyd wrote: > > >select a from mytable where (b=0) and > > > >and this is a syntax error. > > > > > you're not saying which language you're using.

Re: [sqlite] Query generation

2006-12-06 Thread Mario Frasca
Lloyd wrote: select a from mytable where (b=0) and and this is a syntax error. you're not saying which language you're using. in Python a common solution looks like this: clauses = [] # add strings to the clauses list, like clauses.append('(b=0)') # join the parts using appropriate glue

[sqlite] Query generation

2006-12-06 Thread Lloyd
Hi, I am generating queries dynamically from my program based on the input. The primary part of the query is always select a from mytable where (b=0) and based on the user input I add more where clauses to my query like select a from mytable where (b=0) and (x=10) but in one case there in no