INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

UPDATE multiple items in JOIN

UPDATE multiple items in JOIN

(OP)
Can someone tell me why this is allowed:

CODE

update
(select su.sec_usr_id,su.is_enbl_ind,t.asn_usr_id,t.stat_typ_cd,su.lst_updt_dt
  from sec_usr su, tsk t
  where su.is_enbl_ind = 0
  and su.sec_usr_id = t.asn_usr_id
  and t.stat_typ_cd = 'OPEN')u
set u.stat_typ_cd = 'CLOSED'; 

but this is not allowed and can I do this below without using MERGE or CURSORs?

CODE

update
(select su.sec_usr_id,su.is_enbl_ind,t.asn_usr_id,t.stat_typ_cd,su.lst_updt_dt
  from sec_usr su, tsk t
  where su.is_enbl_ind = 0
  and su.sec_usr_id = t.asn_usr_id
  and t.stat_typ_cd = 'OPEN')u
set u.stat_typ_cd = 'CLOSED',
u.lst_updt_dt = sysdate; 

RE: UPDATE multiple items in JOIN

(OP)
So an UPDATE query cannot be used to update two tables? UPDATEs can only be used to update one table and anything over one table has to use a MERGE?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close