I am shocked that works... this indicates that CF processes the value of the function and then processes its output (the tag) too?

-dhs


Dean H. Saxe, CISSP, CEH
[EMAIL PROTECTED]
"If liberty means anything at all, it means the right to tell people what they do not want to hear."
    -- George Orwell, 1945


On Aug 1, 2007, at 11:26 AM, AppDeveloper wrote:

<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

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 FusionLink
-------------------------------------------------------------


-------------------------------------------------------------
Annual Sponsor - Figleaf Software

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 FusionLink
-------------------------------------------------------------

Reply via email to