skaterdav85 Posted August 19, 2010 Share Posted August 19, 2010 I have a few hidden input fields that contain integers and I am going to insert these values into a sql server db into fields of type int. I tried using the CAST() function in my query, but it keeps throwing an error saying:[Macromedia] [sqlServer JDBC Driver][sqlServer]Incorrect syntax near the keyword 'AS'.Is there anything wrong with my query? <cfquery datasource="db1">INSERT INTO testSetup (id1, id2, id3, position, testStartDate)VALUES( <cfqueryparam cfsqltype="cf_sql_varchar" value="form.id1">, CAST(#form.id2# AS INTEGER), CAST(#form.id3# AS INTEGER), 1, <cfqueryparam cfsqltype="cf_sql_varchar" value="form.startDate">)</cfquery> 1 Link to comment Share on other sites More sharing options...
jardrake Posted December 28, 2012 Share Posted December 28, 2012 Whoa, what's up with using your # everywhere instead of their real values like ( and ). Anyways, what type of database are you using, are you sure it supports integer and not int? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now