ColdFusion is likely building the contents of the common_where_clause.cfm
tag before it parses the whole template, so it sounds like it's trying to
evaluate those cfqueryparam tags before it realizes they're supposed to be
contained in a cfquery statement.

If you store your common SQL statement snippets in an application variable
instead of separate files, does it throw the same error?

- Jim

-----Original Message-----
From: Funky Music [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 25, 2002 2:23 PM
To: CF-Talk
Subject: CFQUERYPARAM in cfincludes


Hello CF-people!

I have got a question - I am updating a coldfusion application to certain

standards - one thing is the insert of cfqueryparams in all query
operations.

Now I have the problem that the query is split into several files, because

many queries use the same SQL parts.

If I want to replace the simple values in the include files with
cfqueryparams but this does not work:

>>>>>
Context error in tag CFQUERYPARAM The CFQUERYPARAM tag must be nested
between the <CFQUERY> and the </CFQUERY> tags
<<<<<

Why? The cfqueryparam is within the cfquery tag:

- template 1
<cfquery>
SELECT field1,field2,field3
WHERE <cfinclude template="common_where_clause.cfm">;
</cfquery>

- template common_where_clause.cfm
(field1 = #val(form.test)# AND field2 = #val(form.test2)#)


Best regards,

Peter

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to