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

Home -> Community -> Usenet -> c.d.o.server -> Re: automatic conversion to upper case!

Re: automatic conversion to upper case!

From: <karsten_schmidt_at_my-deja.com>
Date: Mon, 01 Nov 1999 10:41:24 GMT
Message-ID: <7vjqoj$p1o$1@nnrp1.deja.com>


Hi,
 depends on what you are trying to do.

 for a one-time conversion just update:  update tab set mycol = upper(mycol) where mycol != upper(mycol);

 if you have a lot of data, you might want to optimise this a little.  (e.g. commit every 500 rows)

 if you want this to happen for each insert, create a trigger:

 create or replace trigger my_trig
 before insert or update on tab
 for each row
 begin
  :new.mycol := upper(:new.mycol);
 end;

 btw, you might want to add a check constraint, so nobody diables your trigger by mistake and screws you data.

Karsten

In article <7vdf2k$lao$1_at_nnrp1.deja.com>,   Nandakumar <N.Kumar_at_rocketmail.com> wrote:
>
>
> hi
>
> what would be the easiest way to make oracle convert the varchar2
values
> into upper case? ie to handle at the data base side.
>
> would appreciate any information in this regard!
> Thanks
>
> --
> Nandakumar
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Nov 01 1999 - 04:41:24 CST

Original text of this message

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