Hi Josh,

<cfqueryparam> is meant for use inside of your <cfquery> tags becuase
it does more than string parsing.

Try this out:

<cfquery datasource="media" name="get_office">
select office_id
from office
where office_num in (<cfqueryparam list='Yes'
value='#attributes.office_num#'
cfsqltype='CF_SQL_VARCHAR'>)">
</cfquery>

Cheers,

Joe

----- Original Message -----
From: Joshua OConnor-Rose <[EMAIL PROTECTED]>
Date: Thu, 29 Jul 2004 08:16:59 -0700 (PDT)
Subject: Question about cfqueryparam
To: CF-Talk <[EMAIL PROTECTED]>

Sorry if this question has been answered already.

I searched the list but putting that particular
tagname returns plenty and most of it is advice to use
it.

For search pages I started to put the where statement
together into a variable request.filter

this worked fine but we just upgraded the server from
4.5 to 6.1 and I wanted to start throwing in
cfqueryparam.

So when I use this:
<cfset request.filter = "where 0=0">
<cfif len(attributes.office_num)>
<cfset request.filter = request.filter & " and
office_num in (<cfqueryparam list='Yes'
value='#attributes.office_num#'
cfsqltype='CF_SQL_VARCHAR'>)">
</cfif>

And then do this:

<cfquery datasource="media" name="get_office">
select office_id
from office
#request.filter#
</cfquery>

I get an error.

I can't quite figure out what I'm missing

any help?

-Joshua O'Connor-Rose
-All is Good

__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to