PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Craig Jackson <CRAIGJ at epub dot med dot iacnet dot com>
Subject: RE: Capital letters in Names
Date: May 19 1998 2:36AM

>in SQL, you can use "select * from tablename where lower(name) like
>'name_in_lower_case" or "select * from tablename where upper(name) like
>'NAME_IN_UPPER_CASE"

>to perform a case-insensitive search.  However, it can be slow, because
>it will not be able to use indexes on that column.

The only way to do this using an index is to add an extra column to the table,
something like name_lower.  Then declare update and insert triggers on the
table which update name_lower whenever a new row is inserted or name is
updated.

You can then create an index on name_lower and a query like "select a,b,name
from tablename where name_lower = 'name_in_lower_case'" will use it.

Craig Jackson
Craig_Jackson@iacnet.com
Electronic Publishing,
Information Access Company