Hi all,

I have a component that has only one argument: Is it okay pass a struct to 1 argument as oppose to creating many arguments?

<cfcomponent>
    <cffunction name="addToCustomers" access="public" returntype="void">
    <cfargument name="structCollection" type="struct">
    <cfset createID = createUUID()>
    <cfquery name="qAddtoCustomers" datasource="#request.dsn#">
                INSERT INTO customers (
                customers_id,
                customers_gender,
                customers_firstname,
                customers_lastname,
                customers_dob,
                customers_email_address,
                customers_nick,
                customers_default_address_id,
                customers_telephone,
                customers_fax,
                customers_password,
                customers_newsletter,
                customers_group_pricing,
                customers_email_format,
                customers_authorization,
                customers_referral)
                VALUES (
                <cfqueryparam value="#createID#" cfsqltype="cf_sql_varchar" />,
                <cfqueryparam value="#arguments.structCollection.customers_gender#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_firstname#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_lastname#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#createODBCDateTime(arguments.structCollection.customers_dob)#" cfsqltype="cf_sql_date">,
                <cfqueryparam value="#arguments.structCollection.customers_email_address#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_nick#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_default_address_id#" cfsqltype="cf_sql_numeric">,
                <cfqueryparam value="#arguments.structCollection.customers_telephone#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_fax#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_password#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_newsletter#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_group_pricing#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_email_format#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_authorization#" cfsqltype="cf_sql_varchar">,
                <cfqueryparam value="#arguments.structCollection.customers_referral#" cfsqltype="cf_sql_varchar">)
            </cfquery>   
    </cffunction>
</cfcomponent>

thanks
sophek
_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.HostMySite.com 
  www.teksystems.com/

Reply via email to