> I spent a few more minutes trying something, and it's working the way I want 
> it.
> This is my final solution:
>
> The function:
> <cffunction name="updatePKG" returntype="any">
> <cfargument name="in_table" type="any" required="false" default="">
> <cfargument name="in_column" type="any" required="false" default="">
> <cfargument name="in_new_value" type="any" required="false" default="">
> <cfargument name="in_where" type="any" required="false" default="">
> <cfset loc = structnew() />
>
> <cfstoredproc procedure = "sp_test" datasource="#Application.Global.dsn#" 
> username="#Application.Global.dsnUN#" password="#Application.Global.dsnPW#" >
> <cfprocresult name= "rs1">
>
> <cfprocparam type = "IN"     cfsqltype="cf_sql_varchar" 
> value="#arguments.in_table#">
> <cfprocparam type = "IN"     cfsqltype="cf_sql_varchar" 
> value="#arguments.in_column#">
> <cfprocparam type = "IN"     cfsqltype="cf_sql_varchar" 
> value="'#arguments.in_new_value#'">
> <cfprocparam type = "IN"     cfsqltype="cf_sql_varchar" 
> value="#arguments.in_where#">
> <cfprocparam type = "OUT" cfsqltype="cf_sql_varchar" variable="results">
>
> </cfstoredproc>
> <cfset loc = {
> r1 = rs1,
> r2 = "#results#"
> } />
> <cfreturn loc>
> </cffunction>

I would recommend that you replace this:

<cfset loc = structNew()>

with this:

<cfset var loc = structNew()>
<cfset var rs1 = "">

This will create local variables, rather than variables accessible to
the entire CFC or function container, and is a best practice unless
you explicitly want to create variables with a broader scope.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more info

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322299
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to