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

    Join Date
    May 2011
    Posts
    13
    Rep Power
    0

    Oracle 10g Update query


    hello,

    need help asap!

    i am creating a library management system using struts 2.
    i have a form that display a table having column(bookname, author, publisher,..etc) and it contains an operation "edit book" with each row.
    now i m stuck with an update query(or any other query) by which i can edit an entire row (or any column) onclicking the edit button.

    im using oracle 10g database.

    please help!

    thanks and regards
    kunal
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    Either you want a static update query that updates every column whether it changed or not
    or you need to dynamically build an update query that only contains the changed columns.
    Basic format will be

    SQL Code:
    UPDATE MYTABLE
    SET COLUMN1 = :COLUMN1,
          COLUMN2 = :COLUMN2
    WHERE PK_COLUMN = :PK_VALUE_FROM_CURRENT_ROW
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    13
    Rep Power
    0
    thank you.

    i got a fair idea what to do.

IMN logo majestic logo threadwatch logo seochat tools logo