Nope, if you HAVE to put your SQL outside a CFQUERY tag, you have to
use inline values.  Make sure you're very careful about sanitizing any
such values before using them, or you could be leaving yourself open
to SQL injection attacks.

And don't forget preserveSingleQuotes() when you dump the generated
SQL into the CFQUERY tag.

cheers,
barneyb

On 2/21/06, Russ <[EMAIL PROTECTED]> wrote:
> I am trying to optimize some queries, and as such, trying to put several 1
> row insert queries into one.  I am trying to use a function to generate the
> sql, and then just loop through each record and generate the sql I need.
> The issue I'm running into is that cfqueryparam is not supported outside of
> cfquery.  Is there some way to escape it, or am I stuck with putting the sql
> inline with the loop?
>
>
> Here is an example of what I want:
>
> <cfsavecontent variable="myqry">
>
> set @userId=<cfqueryparam cfsqltype="cf_sql_integer" value="#userID#">
>
> </cfsavecontent>
>
> Russ
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233006
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to