Thread: Update query

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    13
    Rep Power
    0

    Update query


    hi,

    i have a table that contain a column "uemail".
    i m stuck with an update statment where user can update his/her email with an alternate email.

    My query:

    ("update table set uemail = '"+ getEdt()+"' where email='"+rBean.getUemail()+"'")

    here getEdt is the new object that will set new email and getUemail is the old email through which a user is logged in.

    by using the above query i am getting a successful update page but when i check the database, it contain the old email value only. and not updating it to a new value.

    i am sure thr is something wrong with my update query.

    please anyone help me out with this.

    thanks
    kunal
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    0
    Originally Posted by kochark
    hi,

    i have a table that contain a column "uemail".
    i m stuck with an update statment where user can update his/her email with an alternate email.

    My query:

    ("update table set uemail = '"+ getEdt()+"' where email='"+rBean.getUemail()+"'")

    here getEdt is the new object that will set new email and getUemail is the old email through which a user is logged in.

    by using the above query i am getting a successful update page but when i check the database, it contain the old email value only. and not updating it to a new value.

    i am sure thr is something wrong with my update query.

    please anyone help me out with this.

    thanks
    kunal
    Hey,

    You should exe commit after updating the data.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    13
    Rep Power
    0
    hi,
    thanks for replying.

    i am still not able to rectify.

    i have tried using a command in sql command prompt it goes.

    "" update users set email=abcd@gmail.com where email=qazws@gmail.com;

    i am getting an error
    Oracle-04054: database link to gmail.com does not exist.

    i am new to this so i don't understand this error.

    any suggestions.?

    thanks
    kunal

IMN logo majestic logo threadwatch logo seochat tools logo