sqlplus update table from table

  • From: Barbara Baker <barb.baker@xxxxxxxxx>
  • To: ORACLE-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 16 Apr 2010 11:46:42 -0600

hi, all.
oracle 9.2.0.7, linux

I have identical tables in 2 databases (dwprod and repdb)

I want to update column STATUS in table wof in database dwprod

         to be equal to STATUS in table wof in database repdb

(using a database link)

when the status in dwprod is ‘D’

and the date and keys are equal and the date is april 1 2008



I’ve tried a bunch of In’s Where’s Minuses, etc, but I’m not getting it.



Any ideas?

Thanks SO MUCH.

Barb



update ad_mart.wof a

set a.status = b.status

where (a.job_nbr,a.adj_nbr_key,a.issue)

IN

(select

job_nbr,adj_nbr_key,issue

from ad_mart.wof a ,

     ad_mart.wof@repdb b

where

  (    a.job_nbr = b.job_nbr

  and  a.adj_nbr_key = b.adj_nbr_key

  and a.issue = b.issue

  and a.issue = '01-APR-08'

  and a.status='D')

)

/

Other related posts: