Results 1 to 4 of 4
  1. #1
    Stephen Douglas's Avatar
    Stephen Douglas is offline Senior Member
    Join Date
    Mar 2010
    Posts
    137
    Rep Power
    0

    Default java.sql.SQLSyntaxErrorException: ORA-00971: missing SET keyword

    Please help on this :confused:

    i am receiving such an error
    [COLOR="Red"]java.sql.SQLSyntaxErrorException: ORA-00971: missing SET keyword


    my code is ::
    Java Code:
    if (column == 1) {
                            preparedStatement = connection.prepareStatement("update rms_accountstore customer_name = ? where customer_name like ?");
                            preparedStatement.setString(1, data.toString());
                            preparedStatement.setString(2, resultset.getObject(column + 1).toString());
                            [COLOR="red"]preparedStatement.executeUpdate();[/COLOR]
                        } else if (column == 2) {
                            preparedStatement = connection.prepareStatement("update rms_accountstore customer_address = ? where customer_address like ?");
                            preparedStatement.setString(1, data.toString());
                            preparedStatement.setString(2, resultset.getObject(column + 1).toString());
                            preparedStatement.executeUpdate();
                        } else if (column == 3) {
                            preparedStatement = connection.prepareStatement("update rms_accountstore tin_number = ? where tin_number like ?");
                            preparedStatement.setString(1, data.toString());
                            preparedStatement.setString(2, resultset.getObject(column + 1).toString());
                            preparedStatement.executeUpdate();
                        }
    i am getting error directed to the colored portion of my code..
    plz suggest. thnx
    Last edited by Stephen Douglas; 04-08-2010 at 09:29 PM.
    The Quieter you become the more you are able to hear !

  2. #2
    porchrat is offline Senior Member
    Join Date
    Mar 2009
    Posts
    105
    Rep Power
    0

    Default

    I think your update syntax is incorrect. This is how an update needs to work:

    UPDATE <table> SET foo=bar, foo2=bar2 WHERE <conditions>;

    Yours is missing "set":

    Java Code:
    preparedStatement = connection.prepareStatement("update rms_accountstore [b]set[/b] customer_name = ? where customer_name like ?");

  3. #3
    Stephen Douglas's Avatar
    Stephen Douglas is offline Senior Member
    Join Date
    Mar 2010
    Posts
    137
    Rep Power
    0

    Default

    Ooooh such a stupid mistake.. i have been looking for the mistake elsewhere for so long.. thank you !
    The Quieter you become the more you are able to hear !

  4. #4
    porchrat is offline Senior Member
    Join Date
    Mar 2009
    Posts
    105
    Rep Power
    0

    Default

    Quote Originally Posted by Stephen Douglas View Post
    Ooooh such a stupid mistake.. i have been looking for the mistake elsewhere for so long.. thank you !
    No worries mate. Happy to help.

    Please remember to mark the thread [SOLVED]

Similar Threads

  1. java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    By Stephen Douglas in forum New To Java
    Replies: 2
    Last Post: 04-08-2010, 09:45 PM
  2. Replies: 5
    Last Post: 01-27-2009, 04:49 PM
  3. Missing 4 ISO 3166-1 codes in java.util.Locale
    By fkeller in forum Advanced Java
    Replies: 1
    Last Post: 01-16-2009, 06:41 PM
  4. Replies: 1
    Last Post: 12-15-2008, 09:11 PM
  5. Telnet with java missing sign in response
    By chlebik in forum Networking
    Replies: 0
    Last Post: 11-11-2008, 01:13 PM

Posting Permissions

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