Re: How to update the record based on certain criterias.

From: kpn <kpn_at_hotmail.com>
Date: Tue, 9 Jul 2002 10:01:30 +0800
Message-ID: <agdg6k$pu226_at_imsp212.netvigator.com>


Sorry all,

I miss one important criteria. That is the record has it own prefix originally no matter it belong to which category. They start with 2xxxxx, 3xxxxx, 4xxxxx,5xxxxx,6xxxxxx. What do I mean is to update the records ONLY belong to "TV" or "DV", and if their profix begin wth 2, then I'v add "T", if their prefix begin with 3, then I'v add "D". And so on. So, how can I do that?

Sorry for my previous wrong description!!!

"Lothar Armbruester" <lothar.armbruester_at_t-online.de> ???????:PM0003A545EF85559D_at_hades.none.local...
> 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.de
Received on Tue Jul 09 2002 - 04:01:30 CEST

Original text of this message