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: what's wrong with this trigger?

Re: what's wrong with this trigger?

From: nelliott <nelliott_at_nelliott.tcp.co.uk>
Date: Fri, 21 Aug 1998 19:53:01 +0100
Message-ID: <6537397948%nelliott@nelliott.tcp.co.uk>


All you need to do to get it to convert the customer name into uppercase is as follows:

begin
  if updating then
    :new.customer_name_idx := UPPER(:new.customer_name);   end if;
end;

NOTE: The database trigger needs to be a PRE INSERT UPDATE trigger.

Hope this helps.

Nigel Elliott

In message <35DB61EF.44C28FC9_at_headroom.com>

          Troy Perchotte <max_at_headroom.com> wrote:

> I have a field that I would like to contain the upper case value of
> another field.
>
> If a user changes the value of my 'customer_name field', I would like to
> have the new value, in upper case, written to the 'customer_name_idx'
> field. (This is done because I use the customer_name_idx field for
> doing faster searches)
>
> A trigger something like the following (preferably one that actually
> works though):
>
> ...
> begin
> if updating then
> update customers
> set customer_name_idx=upper(:new.customer_name);
> end if;
> end;
>
> Troy Perchotte
>
Received on Fri Aug 21 1998 - 13:53:01 CDT

Original text of this message

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