-
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.
-
You can't update two tables with one statement, do it one by one.
-
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
-
Forum Rules
|
|