Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to update the record based on certain criterias.
kpn wrote:
> Hi all,
>
[...]
>
> For example, I've four categories of products, TV, DV, DC, VHC. Each
> category has more than 400 records. Due to some reasons, we want to
> add each
> product code with a prefix. The products belong to TV will append a
> "T" at
> front of each record, and the products belong to DV will add a "D" at
> front
> of each record .
>
> Can someone provide the scripts or procedures for me? Thanks.
Hello kpn,
try this:
update your_table set
prodcode = decode(category,'TV',prodcode||'T', 'DV',prodcode||'D', 'DC',prodcode||'C', 'VHC',prodcode||'V', prodcode);
..and have a look at the decode function in the manual.
Hope that helps,
Lothar
-- Lothar Armbrüster | la_at_oktagramm.de Hauptstr. 26 | la_at_heptagramm.de D-65346 Eltville | lothar.armbruester_at_t-online.deReceived on Mon Jul 08 2002 - 11:11:59 CDT
![]() |
![]() |