• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Syntax error in SQL query

 
Donna Harrington
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everybody,
Can ye help me please. I can't seem to see my syntax error in this sql query. When i compile my application it says i've a syntax 'comma' error.
Here it is:
PreparedStatement pstmt = conn.prepareStatement(" DELETE FROM TitleTable WHERE titleId = '" +tit+"', name= '"+name+"', genre ='"+genre+"', cert = '"+cert+"', rating ='"+rating+"', yearOfRelease ='"+yearOfRelease+"',synopsis = '"+synopsisOfVideo+"';");
Thanking u in advance
Donna
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am pretty sure that instead of a comma you need to use the keyword AND. Try that and let me know.
 
Donna Harrington
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brilliant Gregg Bolinger..Thanx a million for ur help!
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic