Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SQL Insert Statement Data Type Mismatch Error  RSS feed

 
Cath Brown
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a very simple web application that has a Microsoft Access database as the data source. I have been able to sucessfully create update and query statements using parameters but am having issues with an insert statement. I am using JSTL 1.1.2

The following code creates the data type mismatch error.


The table has NUMBER as the data type for both of these fields and the variables I am feeding into it are both numbers. If I hard code the first number into the sql statement then it works. I have tried swapping the variables around and as long as the first one is hard coded the parameter for the second one works no matter which is first or second.

However I can get the following code to work, which of course leaves me vulnerable to sql injection attacks which is not really a good thing.


So I am just looking for any suggestions as to why my first piece of code doesn't work seeing as it is the simplest of SQL statements and the most standard syntax.

Thanks
 
Cath Brown
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More info
The ${ID} comes from


This value is passed as a hidden field from the previous page where it was picked up from the parameter of the page before that, which grabbed it from the database.

The ${feature} comes from

The insert statement I am trying to do is within this forEach loop. This value is taken from a multiple select on the previous page and is posted to this page.

This code also works and directly precedes the insert statement.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!