where clause determined at runtime
[prev]
[thread]
[next]
[Date index for 2005/01/26]
Hello,
I have several queries where the nature of the where clause is not
known until runtime. I have separate queries defined for each
possibility - and select the appropriate one based on conditions at
runtime - ie, user input.
For example,
__PACKAGE__->set_sql( 'undone_all', <<"");
select _id
from dances left join dancedb
on _id = Dance_id
where Dance_id IS NULL
__PACKAGE__->set_sql( 'undone', <<"");
select _id
from dances left join dancedb
on _id = Dance_id
where Dance_id IS NULL
and _id in (%s)
QUESTION: Is there a "better" way of doing this? - perhaps by,
somehow, constructing/modifying the sql at runtime?
Thanks,
Warren
 |
where clause determined at runtime
Warren Pollans 18:56 on 26 Jan 2005
|