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
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
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.
in Python
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)
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 more where clauses to my query like
select a from mytable where