Perhaps there is something for you:

Generated Columns

Generated columns are a way of creating columns
that are derived from values in other columns.
This is different than Views since views are
only materialized during the SQL execution,
while these generated values actually exist in the table itself.

Sample:
create table emp (
  name char(10),
  uname generated always as (ucase(name)),
  salary int not null,
  bonus int not null,
  variablepay int not null,
  compensation generated always as
    (salary+bonus+(salary*variablepay/100)));

drop index ix_emp;
create index ix_emp on emp (uname);

The DB2 optimizer is clever enough to realize
that it can take advantage of the UNAME column
since it recognizes that ucase(name) is
equivalent to UNAME.
This can result in substantial performance gains
since this column calculation does not need to be done
on each data value, and the index can also be used directly.


For further information: DB2 SQL Reference Volume 1

Mit freundlichen Gr��en
Joachim M�ller

--------------------------------------------------------
Datenbanken
DOUGLAS Informatik & Service GmbH
Kabeler Stra�e 4
D-58099 Hagen

Tel.:+49-2331-690-249
Fax:+49-2331-690-78-249
Mobile: +49-170-2221-249

mailto:[EMAIL PROTECTED]
http://www.douglas-informatik.de


                                                                                       
                                   
                    Turgut Kalfaoglu                                                   
                                   
                    <[EMAIL PROTECTED]>        An:     [EMAIL PROTECTED]    
                                   
                    Gesendet von:                 Kopie:                               
                                   
                    [EMAIL PROTECTED]        Thema:  Re: DB2EUG: How to make all 
searches CASE INSENSITIVE           
                    a.best.com                                                         
                                   
                                                                                       
                                   
                                                                                       
                                   
                    01.07.01 09:53                                                     
                                   
                    Bitte antworten an                                                 
                                   
                    db2eug                                                             
                                   
                                                                                       
                                   
                                                                                       
                                   





> Is there a way to make the db2 database CASE
> INSENSITIVE so that a string like "Evaluation" would

select blah from table where translate(name)='SMITH'

note that this imposes overhead; just like any other 'case insensitive'
method. If worried about performance, you may want to store an uppercase
version of that field into your table as well.. Search it based on the
uppercase fieldname, display the mixed case version. That's what I do
with my web crawler.

-turgut


=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see
http://people.mn.mediaone.net/scottrmcleod





=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod

Reply via email to