Results 1 to 3 of 3

Thread: Oracle - Update joint tables

  1. #1
    Join Date
    Jan 2004
    Posts
    52

    Oracle - Update joint tables

    Hi -

    I have table A, and table B. Table A has 3 fields (hostname, progID, and detail), hostname is a PK in table A and FK in table B.

    I need to update hostname in both tables

    I tried below statement, but got set key missing

    UPDATE A, B
    SET A.hostname = 'NEWVALUE'
    WHERE A.hostname=B.hostname
    AND B.hostname='OLDVALUE'

    my goal is to update hostname in both tables.

    Thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You can't update two tables with one statement, do it one by one.

  3. #3
    Join Date
    Apr 2009
    Posts
    2

    Update Statements

    HI,

    It's not possiable to update 2 tables in one single statements.

    As you said, first disable the primary key and do the update in the both tables, After updating again enable the primary key.

    Thanks
    Nani.

Posting Permissions

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