Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Updating a field of one table from another
"todd seidel" <todd.seidel_at_tfn.com> wrote in message
news:a566f6f6.0205091056.1f4afe58_at_posting.google.com...
> I'm attempting to update a field on one table
> with a different field from another. Here's the query that I'd like
to
> use
>
> update FC_MOD m, FC f
> set FC_MOD.parent_key= FC.tfn
> where concat(F.ticker,'.CF')=M.ticker
>
> this is based on this simple select
>
> select f.tfn from FC f, FC_MOD M
> where concat(F.ticker,'.CF')=M.ticker
>
> I'm trying to update the parent_key field in the fc_mod table with
the
> tfn of the fc table based on the joining statement
> concat(f.ticker,'.CF')=m.ticker
>
> I'm not sure how to do this...I've done some research but haven't
> found anything that works based on the criteria of this
Todd,
Take a look at the oracle docs (I'll cite 8i 'cuz I have them open) on in-line views and correlated queries. I believe that's what you are intending:
http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/serve r.817/a85397/state27a.htm#2068178
See the 'SET VALUE example' and the 'Correlated Update Example' If I'm off the mark and let me know. :)
-- Pablo Sanchez, High-Performance Database Engineering mailto:pablo_at_hpdbe.com http://www.hpdbe.com Available for short-term and long-term contractsReceived on Thu May 09 2002 - 16:33:55 CDT
![]() |
![]() |