• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session variables in sql statements  RSS feed

 
namrata suri
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written a form in an jsp which accepts three values .Apart from this I also have drop down menu from which a value is selected.

These four values are now accessed in the second jsp where I am putting these values into a database.

Here is the code:



I tried putting the <%= ... %> part in double quotes as well but am getting an error as follows:

Column 'India' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement........

The value of the session variable is getting reflected correctly but is not getting inserted into the table.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you treating the "country" column differently than all the rest? And if you're inserting a single country, why is the parameter called "countries"?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!