This content has been marked as final. Show 3 replies
Usually when I have problems like this, I remove the conditional logic. I try not to use dynamic SQL like that as well, it does work so I am not saying dont do it, but I try to take care of the logic outside the sql statement if you get what I mean. Sometimes a comma is in the wrong spot, I would just get the straight sql working even in sql query analyzer, take your query and run it there and make sure it works. I would then do a <cfdump> of the variables you plan on using before you even run your <cfquery>
That should lead you to the answer.
First dump the form scope to see what values are being passed. Is FORM.projID numeric? Then turn on debugging so CF will display the sql query sent to the database. What is the actual sql that was generated?
In addition to what everyone else said, you realize that your logic makes it possible for empty rows to be inserted into your table, right. And you know that's bad, right?