OT: SQL Error with Syntax
OK, I cannot see where this SYNTAX error is can anyone else see the possible problem? Below are two queries, both are the same, one is PRE-CF (variables) one is POST CF after CF processes the variables that makes it a query. (WHERE weight = apos;30apos;) Is just what is outputted in the error, it is actually ('30') !--- Dynamic Query --- SELECT zone#getzone.service# AS ship_value FROM #variables.service_table# WHERE weight = '#attributes.weight#' ORDER BY weight desc !--- Above output --- SELECT zone202 AS ship_value FROM 2da WHERE weight = apos;30apos; ORDER BY weight desc !--- PRODUCES This Error --- Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near '2'. 181 : WHERE weight = '#attributes.weight#' 182 : ORDER BY weight desc 183 : /cfquery 184 : cfset variables.process = Yes 185 : cfset variables.ups_rate = getrate.ship_value VENDORERRORCODE 170 SQLSTATE HY000 Paul Giesenhagen QuillDesign ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: OT: SQL Error with Syntax
If the weight field is number then it should be weight = 30 and not weight = '30' [EMAIL PROTECTED] 03/10/03 09:58AM OK, I cannot see where this SYNTAX error is can anyone else see the possible problem? Below are two queries, both are the same, one is PRE-CF (variables) one is POST CF after CF processes the variables that makes it a query. (WHERE weight = apos;30apos;) Is just what is outputted in the error, it is actually ('30') !--- Dynamic Query --- SELECT zone#getzone.service# AS ship_value FROM #variables.service_table# WHERE weight = '#attributes.weight#' ORDER BY weight desc !--- Above output --- SELECT zone202 AS ship_value FROM 2da WHERE weight = apos;30apos; ORDER BY weight desc !--- PRODUCES This Error --- Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near '2'. 181 : WHERE weight = '#attributes.weight#' 182 : ORDER BY weight desc 183 : /cfquery 184 : cfset variables.process = Yes 185 : cfset variables.ups_rate = getrate.ship_value VENDORERRORCODE 170 SQLSTATE HY000 Paul Giesenhagen QuillDesign ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: OT: SQL Error with Syntax
Quoting integers in SQL Server is valid, and can help protect against some hack attempts. -Justin Scott - Original Message - From: Randell B Adkins [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Monday, March 10, 2003 10:00 AM Subject: Re: OT: SQL Error with Syntax If the weight field is number then it should be weight = 30 and not weight = '30' [EMAIL PROTECTED] 03/10/03 09:58AM OK, I cannot see where this SYNTAX error is can anyone else see the possible problem? Below are two queries, both are the same, one is PRE-CF (variables) one is POST CF after CF processes the variables that makes it a query. (WHERE weight = apos;30apos;) Is just what is outputted in the error, it is actually ('30') !--- Dynamic Query --- SELECT zone#getzone.service# AS ship_value FROM #variables.service_table# WHERE weight = '#attributes.weight#' ORDER BY weight desc !--- Above output --- SELECT zone202 AS ship_value FROM 2da WHERE weight = apos;30apos; ORDER BY weight desc !--- PRODUCES This Error --- Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near '2'. 181 : WHERE weight = '#attributes.weight#' 182 : ORDER BY weight desc 183 : /cfquery 184 : cfset variables.process = Yes 185 : cfset variables.ups_rate = getrate.ship_value VENDORERRORCODE 170 SQLSTATE HY000 Paul Giesenhagen QuillDesign ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4