• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

enter special characters

 
apurv suthar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I use query- "INSERT INTO tab_name VALUES(param1,param2)" and passes email as parameter it shows syntax error at char "@"... why? I know that this can be solved by using PreparedStatement... but if I wants to use same query..how to do it?
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chris webster wrote:


oh you think he had missed the quotes and it was trying to use them as column names, ahhh that makes sense
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wendy Gibbons wrote:oh you think he had missed the quotes and it was trying to use them as column names


Yeah, this commonly happens when people don't use PreparedStatement and try to build their SQL via string concatenation. Which is why you should always use PreparedStatement unless there's an extremely good reason why you can't.
 
apurv suthar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yah..I got it...sorry for my stupidity...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic