Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Addendum
This may not be it at all, but...
Update B set b.offset =
(select a.offset from A where a.primarykey = B.primarykey)
In article <37445DBE.D1A195C1_at_bigfoot.com>,
Doug Cowles <dcowles_at_bigfoot.com> wrote:
> These tables are actually not exactly the same, they have 388
> primary key columns in common (those are the ones I care about)
> the count on table b is 527 and the other is 458. 388 overlap.
> I tried something a little different but no luck - I tried
> update B set offset = A.offset
> where A.primarykey = B.primarykey.
> It returns 527 rows updated, wheras there are only 388 in common.
There
> are no duplicates in the key column. Also, not all the updates made
it. I am
>
> confused.
>
> Doug Cowles wrote:
>
> > I need to do a large update and can't quite figure it out.
Essentially,
> >
> > I have two tables of the same name and fieldtypes in two different
> > schemas.
> > The only difference is that on one table, a field called "offset"
has
> > values in
> > it and on the other table (table B), it doesn't. The idea is to get
> > table b to
> > look exactly like table a.
> >
> > I tried
> >
> > Update B set offset =
> > (select offset from A where primarykey = B.primarykey)
> >
> > and got
> > cannot update mandatory (NOT NULL) column to NULL.
> > The offset is not null on both tables, so there are no null
values. My
> > correlation
> > logic must be askew.
> >
> > Would appreciate any advice,
> >
> > - Dc.
>
>
--== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.--- Received on Fri May 21 1999 - 16:30:55 CDT