Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

update statement with EXISTS clause

530678Apr 21 2009 — edited Apr 23 2009
I saw this code in one of the procedures we are using ... is it possible to avoid EXIST caluse:

update table_x p
set p.internal_issue_ky = (select sh.internal_issue_ky
from security_history sh, XT_SECURITY xs
where sh.internal_wins_issue_id = xs.internal_wins_issue_id
and sh.as_of_dt = xs.as_of_date
and p.internal_wins_issue_id = sh.internal_wins_issue_id
and p.effective_dt between sh.as_of_dt and sh.next_as_of_dt
)
where exists
(select sh.internal_issue_ky
from security_history sh, XT_SECURITY xs
where sh.internal_wins_issue_id = xs.internal_wins_issue_id
and sh.as_of_dt = xs.as_of_date
and p.internal_wins_issue_id = sh.internal_wins_issue_id
and p.effective_dt between sh.as_of_dt and sh.next_as_of_dt
)


Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2009
Added on Apr 21 2009
3 comments
14,095 views