Can you also post an example or two of exactly what data you might be passing into the sp? Do you ever pass in zero length strings or nulls into the sp for both values?
On Wed, Apr 7, 2010 at 10:04 AM, Matthew Smith <[email protected]>wrote: > > Yes, I understand that. > > I'm just trying to understand why it is trying to cast it as an int. Is it > something that the COALESCE or NULLIF does automatically? Is it looking at > the first argument and casting the second as the same datatype? I don't > think it is becuase if I switch the two around I get the same error. > > > On Wed, Apr 7, 2010 at 5:34 AM, Medic <[email protected]> wrote: > > > > > You wouldn't be able to cast the cf_user_id as an int since it's got a > > nasty > > little underscore in it. Why not go the other route and cast app_user_id > as > > a varchar since you're only looking to see if it's null. > > > > On Tue, Apr 6, 2010 at 10:28 PM, Matthew Smith <[email protected] > > >wrote: > > > > > > > > INSERT INTO rhkprod_tblCartAdjustments ( > > > tblPeopleFK > > > ,cfUserID > > > ,tblProductsFK > > > ,adjusted > > > ,originalQuantity > > > ,adjustedQuantity > > > ) > > > SELECT NULLIF(@app_user_id, '') > > > ,NULLIF(@cf_user_id, '') > > > ,@tblProductsFK > > > ,1 > > > ,@cartQuantity > > > ,@quantity > > > WHERE COALESCE(NULLIF(@app_user_id, ''), NULLIF(@cf_user_id, '')) IS > > NOT > > > NULL > > > > > > I am getting: > > > Error Executing Database Query. [Macromedia][SQLServer JDBC > > > Driver][SQLServer]Conversion failed when converting the varchar value > > > '1506_18149772' to data type int. > > > > > > If I comment out the following: > > > > > > WHERE COALESCE(NULLIF(@app_user_id, ''), NULLIF(@cf_user_id, '')) IS > > NOT > > > NULL > > > > > > It works. > > > > > > @app_user_id is an int, @cf_user_id is a varchar. Is there some sort > of > > > conversion going on? Can I cast or convert the @cf_user_id to an int > > > somehow? I don't need the value, just need to know that it is not > null. > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:315204 Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-community/unsubscribe.cfm
