Could someone please verify whether inner join is valid with UPDATE statment in PL SQL?
e.g.
Update table t
set t.value='value'
from tableb b inner join
on t.id=b.id
inner join tablec c on
c.id=b.id
inner join tabled d on
d.id=c.id
where d.key=1
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This synthax won’t work in Oracle SQL.
In Oracle you can update a join if the tables are “key-preserved”, ie:
Assuming that
b_pkis the primary key ofb, here the join is updateable because for each row of A there is at most one row from B, therefore the update is deterministic.In your case since the updated value doesn’t depend upon another table you could use a simple update with an EXIST condition, something like this: