Man I need to learn more sql. -----Original Message----- From: C. Hatton Humphrey [mailto:chumph...@gmail.com] Sent: Thursday, April 01, 2010 6:47 AM To: cf-community Subject: Re: porting cf code to a stored proc
> How would do this in pure stored procedure sql? > > Either @personkey or @cfuserid will be passed, the other will be null, > replacing the attributes vars. > > INSERT INTO rhkprod_tblCartAdjustments > ( <cfif len(attributes.personKey)> tblPeopleFK </cfif> > <cfif len(attributes.cfUserID)> cfUserID </cfif> > ,tblProductsFK ,adjusted ,originalQuantity ,adjustedQuantity ) > VALUES > ( <cfif len(attributes.personKey)> #attributes.personKey#</cfif> > <cfif len(attributes.cfUserID)> '#attributes.cfUserID#' </cfif> > ,@tblProductsFK ,1 ,@cartQuantity ,@quantity ) IF @PersonKey IS NULL INSERT INTO rhkprod_tblCartAdjustments ( tblPeopleFK ,tblProductsFK ,adjusted ,originalQuantity ,adjustedQuantity ) VALUES (@personKey ,@tblProductsFK ,1 ,@cartQuantity ,@quantity ) ELSE INSERT INTO rhkprod_tblCartAdjustments (cfUserID,tblProductsFK ,adjusted ,originalQuantity ,adjustedQuantity ) VALUES (@cfUserID ,@tblProductsFK ,1 ,@cartQuantity ,@quantity ) Until Later! C. Hatton Humphrey http://www.eastcoastconservative.com No trees were killed in the sending of this message, but a large number of electrons were terribly inconvenienced. On Thu, Apr 1, 2010 at 5:14 AM, Matthew Smith <chedderslam@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:314836 Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-community/unsubscribe.cfm