Missing keyword to update related column [message #428023] |
Mon, 26 October 2009 21:24 |
carillpower
Messages: 48 Registered: April 2009 Location: malaysia
|
Member |
|
|
Hi all, i have a doubt here...i have a code that will change a data which use for relate between 2 tables. Here's are the code
update (
select a.ssn a_ssn,b.emplid b_emplid,b.ssn b_ssn,
CASE
WHEN a.ssn = a.ssn THEN a.ssn = b.emplid
ELSE a.ssn = b.ssn
END a_change
from ps_A a, ps_B b
where b.ssn = a.ssn)
set a_ssn = a_change
But currently it shows an error like this
ERROR at line 4:
ORA-00905: missing keyword
Kindly if there's any suggestion on this, it would be helpful
|
|
|
|
Re: Missing keyword to update related column [message #428036 is a reply to message #428023] |
Mon, 26 October 2009 23:40 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
carillpower wrote on Tue, 27 October 2009 03:24
update (
select a.ssn a_ssn,b.emplid b_emplid,b.ssn b_ssn,
CASE
WHEN a.ssn = a.ssn THEN a.ssn = b.emplid
ELSE a.ssn = b.ssn
END a_change
What's the "THEN a.ssn = b.emplid" part?
replace it with "THEN b.emplid". This also goes for the ELSE branch, which of course will never be hit as long as a.ssn has a value.
[Updated on: Mon, 26 October 2009 23:41] Report message to a moderator
|
|
|