DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2007
    Posts
    5

    Updating a Table from a JAVAServlett

    Hi,

    I have some problems with the syntax in my SQL UPDATE statement, it looks like this;

    state.executeUpdate("UPDATE TABLE presentation SET Names ='"+ name +"' , SET Pres ='"+ press +"', SET Musik ='"+ musik +"', SET City ='"+ city+"', SET Clubb='"+ club+"'");

    I have tried many variations with " " and ' "
    Only when I try and run my servlet I get the following exception:

    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

    My question is: how should the SQL syntax look olike in my SQL statement?

    /Robert

  2. #2
    Join Date
    May 2007
    Posts
    59
    If I remember correctly, you only need to write "SET" only one time. So that would make:

    state.executeUpdate("UPDATE TABLE presentation SET Names ='"+ name +"' , Pres ='"+ press +"', Musik ='"+ musik +"', City ='"+ city+"', Clubb='"+ club+"'");

Similar Threads

  1. Updating on screen text fields with multiple table data
    By William Ed Carden in forum VB Classic
    Replies: 2
    Last Post: 10-17-2005, 05:09 PM
  2. Replies: 0
    Last Post: 12-23-2002, 11:12 PM
  3. Updating Oracle Table with Access 97
    By Bill Wong in forum VB Classic
    Replies: 2
    Last Post: 06-13-2002, 11:56 AM
  4. Replies: 1
    Last Post: 07-17-2001, 12:29 PM
  5. DTS - UPDATING AND APPENDING A TABLE
    By TAG in forum Database
    Replies: 0
    Last Post: 12-28-2000, 10:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links