Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: updates in sqlplus

Re: updates in sqlplus

From: rsenn <rsenn_at_capaccess.org>
Date: 1997/12/06
Message-ID: <3489CD4F.4639EC9A@capaccess.org>#1/1

Mike Baldock wrote:

> Hi
>
> In sqlplus I would like to update 2 fields which are identical in two
> tables
>
> Simplified
> Table Trial has fields id,yr,no,trialid
> Table Trialloc has fields id,yr,no,trialid,location
>
> The basis of thses tables are plants in a row of a research trial I
> want
> to change the name of the trial where all the locations are like 'A%'
>
> I can easily update the trial name in the table "trialloc"
>
> update trialloc
> set trialid='NEWTRIAL"
> where location like 'A%'
>
> How can I also update trialid in the table "trial" at the same time?
>
> thanks for any help
>
> Mike Baldock
>
> Mike.Balodck_at_hri.ac.uk

Dear Mike,
  I don't have any way of testing this before I send it to you, but it looks like this might work.

Issue this command before you issue the one you already gave.

update trial
set trialid = 'NEWTRIAL'
where id in
  ( select id
    from trialloc
    where location like 'A%'
   ) ; Received on Sat Dec 06 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US