I doubt you can see them as being on a par with SP's - SP's are more 
secure, faster (albeit once you tweak the Query Engine in some cases), 
easier to manage and maintain when making mods to the SP alone (not 
necessarily the cfstoredproc call) and they are of course can be called 
cross language - which cfquery cannot do.

It is a battle as old as the hills ;-)  Some people like CFQUERY, some 
people like CFSTOREDPROC, in any case you can now on bet your house that 
cfqueryparam under the hood is doing exactly what the UDF is doing (or 
at the very least an horrible dynamic sql block) as it is still SQL 
which is being generated in the end, nothing more, nothing less.

As a DB man first, CF second SP's are my vice when it comes to SQL, the 
only time I use cfquery now is to perform a QoQ.

The problem you have with using CF in this way is that it can become 
messy to read etc especially when you have loops etc all over the shop.






Michael Dinowitz wrote:

>The SQL function approach looks nice and all but it still just doesn't feel as 
>'clean' as a normal CFQUERY using CFQUERYPARAM. When I use a CFQUERYPARAM on 
>the list, it generates the following:
>
>SELECT *
>FROM Content
>WHERE (ContentType IN (?,?,?,?,?)) 
>
>Query Parameter Value(s) -
>Parameter #1(CF_SQL_INTEGER) = 7
>Parameter #2(CF_SQL_INTEGER) = 11
>Parameter #3(CF_SQL_INTEGER) = 16
>Parameter #4(CF_SQL_INTEGER) = 19
>Parameter #5(CF_SQL_INTEGER) = 20
>
>This looks very neat and clean. I was hoping SQL did the same. 
>
>On a related note, I'm seeing that queries using CFQUERYPARAM are running on 
>par with stored procedures. 
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2356
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to