• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sql exception

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
I am updating a table with a set of values.
My code is

st.executeUpdate("update bulletinboard set (userid='"+s1+"',dateofposting='"+s2+"',messagetitle='"+s3+"',message='"+s4+"', administratorid='"+s5+"',typeofmessage='"+s6+"',expirydate='"+s7+"') where messageid=2");
I get an error as

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'messageid='.
Plz give me ur solutions..
Thanks in advance.
regards,
Aarthi.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Aarthi,
Try this :
st.executeUpdate("update bulletinboard set (userid='"+s1+"',dateofposting='"+s2+"',messagetitle='"+s3+"',message='"+s4+"', administratorid='"+s5+"',typeofmessage='"+s6+"',expirydate='"+s7+"') where messageid='2'");
I have changed the where clause.
Hope this helps.
Rgds,
Kirtikumar Puthran
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic