Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: UPDATE QUERY QUESTION
Jon,
Doesn't look right according to your series of updates UPDATE SECTIONS
SET PHASE = DECODE(conductor, '2-2, 2-2', 'A', '2-3', 'AB', '2-4', 'ABC', '4-2, 6-2', 'ABC', '4-2-, 6-2', 'ABC', '4-3', 'AB', '4/0-3, 2/0-1', 'ABC', '6-1, 4-1', 'A', '6-2', 'A', '6-2, 4-2', 'ABC', PHASE );
In article <86skka$dfr9_at_svlss.lmms.lmco.com>,
"Jon" <J_S_Finley_at_yahoo.com> wrote:
> Sorry for the ignorance again...
> Is this correct?
> UPDATE SECTIONS
> SET PHASE = DECODE(conductor, '2-4', 'ABC'
> '4-2, 6-
2', 'ABC'
> '4-3', 'ABC'
> '4/0-3, 2/0-
', 'ABC'
> '6-1, 4-
1', 'A'
> '6-2', 'A'
> '6-2, 4-
2', 'ABC')
>
> Jon wrote in message <86s74h$dfq2_at_svlss.lmms.lmco.com>...
> >I need to do a single update query with the following:
> >
> >UPDATE sections SET PHASE = 'A' WHERE CONDUCTOR = '2-2, 2-2';
> >UPDATE sections SET PHASE = 'AB' WHERE CONDUCTOR = '2-3';
> >UPDATE sections SET PHASE = 'ABC' WHERE CONDUCTOR = '2-4';
> >UPDATE sections SET PHASE = 'ABC' WHERE CONDUCTOR = '4-2, 6-2';
> >UPDATE sections SET PHASE = 'ABC' WHERE CONDUCTOR = '4-2-, 6-2';
> >UPDATE sections SET PHASE = 'AB' WHERE CONDUCTOR = '4-3';
> >UPDATE sections SET PHASE = 'ABC' WHERE CONDUCTOR = '4/0-3, 2/0-1';
> >UPDATE sections SET PHASE = 'A' WHERE CONDUCTOR = '6-1, 4-1';
> >UPDATE sections SET PHASE = 'A' WHERE CONDUCTOR = '6-2';
> >UPDATE sections SET PHASE = 'ABC' WHERE CONDUCTOR = '6-2, 4-2';
> >
> >I'm new to Oracle can anyone help me get this done with one query.
> >
> >This is how I do it in ACCESS
> >
> >UPDATE SECTIONS SET SECTIONS.PHASE =
> >IIf([conductor]="2-4","ABC",IIf([conductor]="4-2,
> >6-2","ABC",IIf([conductor]="4-3","ABC",IIf([conductor]="4/0-3,
> >2/0-","ABC",IIf([conductor]="6-1,
> >4-1","A",IIf([conductor]="6-2","A",IIf([conductor]="6-2,
> >4-2","ABC",[PHASE])))))));
> >
> >I thought about decode would that work or is there something real
simple
> >that I am missing here. I apologize for my ignorance I'm very new
to this
> >program.
> >Thanks
> >-Jon
> >
> >
> >
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sat Feb 05 2000 - 09:20:00 CST
![]() |
![]() |