Problems passing in params to a query
Wasn't exactly sure how to word the title. What I am attempting to do is create a set of queries that I can pass in the table name and any additional code besides the base query. If I write the code directly like this it works:
select * from mytable where name = 'some name'
and if I shorten it and pass in the table name like this it works:
select * from #tablename#
but, if I pass in the where clause it fails, I don'teven need to pass it in from the client, simply turning the where clause into a variable fails. This fails:
<cfset whereC = "where name = 'some name' " >
...
select * from #tablename# #whereC#
Please, can someone tell my why this fails? there should be no reason for it, or am I overlooking something very simple?
Thanks,
Jim
