<cffunction name="qparam" access="public" returntype="void"
output="true">
<cfargument name="cfsqltype" type="String" required="false"
default="cf_sql_varchar" />
<cfargument name="value" type="string" required="True" default="" />
<cfset VAR type = arguments.cfsqltype />
<cfif left(type,7) NEQ "cf_sql_">
<cfset type = "cf_sql_" & type />
</cfif>
<cfqueryparam cfsqltype="#type#" value="#arguments.value#" />
</cffunction>
The only problem with this is that you must put <cfoutput> tags around your
query inside of your <cfquery> tags for it to work, or it will choke on the
# signs. so you just use it like this:
<cfquery....>
<cfoutput>
SELECT * FROM thistable WHERE this = #qparam("int","2338")#
</cfoutput>
</cfquery>
Taken from
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:42338
Precia
On 8/1/07, Charlie Stell <[EMAIL PROTECTED]> wrote:
>
> Does anyone know if CFQueryParam is offered in a function version?
>
> Im trying to build out a dynamic query string and then use that for the
> where clause...
>
> Thanks!
> Charlie
>
> -------------------------------------------------------------
> Annual Sponsor - Figleaf Software <http://www.figleaf.com/>
>
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform<http://www.acfug.org/?fa=login.edituserform>
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com/>
> -------------------------------------------------------------
-------------------------------------------------------------
Annual Sponsor FigLeaf Software - http://www.figleaf.com
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------