Results 1 to 5 of 5
  1. #1
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default Simple SQL update doesn't work :( (Probebly easy error)

    Hello!
    I'v spent my day trying to understand the built in derby database SQL thingy
    And Im Finaly starting to get it! :D

    Anyways, I get this problem when Im trying to modd a value:
    Java Code:
    Collums 'PWNSOME' is either not in any table in the FROM list or appears..
    What Im trying to do is set the Firstname collumn value, on All the rows which have the id=8, to Pwnsome.
    Now that doesnt work very well :(

    Heres my code:
    PHP Code:
    Statement statement = conn.createStatement();
    		statement.execute("select * FROM APP WHERE ID = 8");
    		statement.execute("UPDATE APP SET FIRSTNAME = Pwnsome");
    What am I doing wrong?

  2. #2
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    AAAAAAAAAHHHHHHHHHH!
    Neevermiind!! :D
    I found out I must set ' marks around my string value :D

  3. #3
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    W8W8! No, still ONE problem remains..
    It changed all my firstnames to pwnsome..
    Didnt I select the ones with id 8?

  4. #4
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    Nvm, figured that out :P
    Sry for wasting ur time..
    Admins may remove this thread :P

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Simple Error ???
    By darkblue24 in forum New To Java
    Replies: 3
    Last Post: 03-26-2010, 08:15 AM
  2. Replies: 3
    Last Post: 10-26-2009, 11:42 AM
  3. My Simple Array Does Not Work!
    By Simplev_v in forum New To Java
    Replies: 16
    Last Post: 09-07-2009, 02:43 PM
  4. Simple animation won't work
    By nolsen01 in forum New To Java
    Replies: 4
    Last Post: 07-08-2009, 11:36 PM
  5. Replies: 1
    Last Post: 08-22-2008, 10:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •