Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

update error

 
jyotsana dang
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i wrote a query for updation but it gives a syntax error.
rs=stmt.executeQuery("select level, project_title, student_names, co_supervisor, year from projects_supervised where project_id in("+selected_Id+")");
incorrect syntax near ')'
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generate the query as a string, then output the string before trying to execute it.

This way at least you can paste the code into a db client. It may be the code you are using to generate the selected_Id is incorrect.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic