ShipBase is an empty string and therefore, your code is being evaluated to look like this:
, , You can solve that by instead of using #ShipBase#, do this: <cfqueryparam value="#ShipBase#" cfsqltype="cf_sql_integer" null="#not len(trim(ShipBase))#"> This will make it null if the shipbase is empty. Dave -----Original Message----- From: Ben Conner [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2008 12:54 PM To: cf-newbie Subject: query syntax error Hi, I'm getting the following error on an insert: [Macromedia][SQLServer JDBC Driver][SQLServer]Line 22: Incorrect syntax near ','. The error occurred in D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 115 Called from D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 80 Called from D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 47 Called from D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 1 Called from D:\sites\qcliving.com\htdocs\Admin\index.cfm: line 169 Called from D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 115 Called from D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 80 Called from D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 47 Called from D:\sites\qcliving.com\htdocs\Admin\ProductForm.cfm: line 1 Called from D:\sites\qcliving.com\htdocs\Admin\index.cfm: line 169 113 : #crwidth#, 114 : #crheight#, 115 : #CurrentLevel#) 116 : 117 : </cfquery> SQL INSERT INTO Products(ProductName, Sku, ShortDesc, LongDesc, CategoryID, ManufacturerID, UnitCost, Weight, ShipBase, Image, ImgWidth, ImgHeight, ProductLevel) VALUES ('test', 'test', 'test', 'test', 1914, 204, 4, NULL, , '', 0, 0, 2) Productlevel is an Int field. The source query is: <cfquery name="LastProduct" datasource="#Application.DSN#"> INSERT INTO Products(ProductName, Sku, ShortDesc, LongDesc, CategoryID, ManufacturerID, UnitCost, Weight, ShipBase, Image, ImgWidth, ImgHeight, ProductLevel) VALUES ('#ProductName#', '#sku#', '#ShortDesc#', '#LongDesc#', #CategoryID#, #ManufacturerID#, #UnitCost#, <cfif weight GT 0>#Weight#<cfelse>NULL</cfif>, #ShipBase#, '#ImageFile#', #crwidth#, #crheight#, #CurrentLevel#) </cfquery> I've looked at this until my eyes are crossed and just don't see it. Anyone? --Ben ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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-newbie/message.cfm/messageid:4137 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
