Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

**8*****problem in searching using sybase

3 posts in Internet Last posting was on 2000-05-31 14:58:54.0Z
andrew Posted on 2000-05-25 10:23:48.0Z
Message-ID: <392CFF34.502C31D9@cyber-village.net>
Date: Thu, 25 May 2000 18:23:48 +0800
From: andrew <andrewlee@cyber-village.net>
X-Mailer: Mozilla 4.7 [en-gb] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: **8*****problem in searching using sybase
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.internet
Lines: 23
NNTP-Posting-Host: 202.186.196.38
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.internet:339
Article PK: 1067396

Dear people;
I am having a problem in searching data in sybase. There are two fields
in a table which contains data about stock tickers and tickers name.

tickers tickerName
AII123 Kuala Lumpur Composite

I am using sql to search for the tickerName in my table. My select
statement is as below.
select * from table where tickerName='$var'

I am using php as my programming language.
My problem is the variable $var is actually taken from a textfield. The
search works fine when user actually type 'Kuala Lumpur Composite' and
there is a perfect match. My problem is the user might type everything
in lower case or a mix of uppercase and lowercase. When this happen, no
match can be found. Is there a way to rectify this problem. PLease help
as i'm near my dateline.
thanks
andrew
PS: can you please cc any answer to andrewlee@mailcity.com
thank you very much


Michael Peppler Posted on 2000-05-25 14:20:32.0Z
Message-ID: <392D36B0.D9744605@peppler.org>
Date: Thu, 25 May 2000 07:20:32 -0700
From: Michael Peppler <mpeppler@peppler.org>
Organization: Data Migrations, Inc
X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.14 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: andrew <andrewlee@cyber-village.net>
Subject: Re: **8*****problem in searching using sybase
References: <392CFF34.502C31D9@cyber-village.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.internet
Lines: 33
NNTP-Posting-Host: gw.peppler.org 206.55.243.57
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.internet:337
Article PK: 1067393


andrew wrote:
>
> Dear people;
> I am having a problem in searching data in sybase. There are two fields
> in a table which contains data about stock tickers and tickers name.
>
> tickers tickerName
> AII123 Kuala Lumpur Composite
>
> I am using sql to search for the tickerName in my table. My select
> statement is as below.
> select * from table where tickerName='$var'
>
> I am using php as my programming language.
> My problem is the variable $var is actually taken from a textfield. The
> search works fine when user actually type 'Kuala Lumpur Composite' and
> there is a perfect match. My problem is the user might type everything
> in lower case or a mix of uppercase and lowercase. When this happen, no
> match can be found. Is there a way to rectify this problem. PLease help
> as i'm near my dateline.

A couple of solutions:

Make sure the case is correct before you pass the $var variable to
the select.
Use lower() or upper() (though that might invalidate the index)
Convert your server to case-insensitive sort-order.

Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com


Eric T. J. Hogue Posted on 2000-05-31 14:58:54.0Z
From: "Eric T. J. Hogue" <Eric.Hogue@wpafb.af.mil>
References: <392CFF34.502C31D9@cyber-village.net> <392D36B0.D9744605@peppler.org>
Subject: Re: **8*****problem in searching using sybase
Date: Wed, 31 May 2000 10:58:54 -0400
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <eneRaHxy$GA.110@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.internet
NNTP-Posting-Host: b3o.bips.wpafb.af.mil 198.97.67.102
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.internet:336
Article PK: 1067394

One other solution is to create a special search field that always contains
the uppercase version of the name.

tickers tickerName tickerNameSearch
AII123 Kuala Lumpur Composite KUALA LUMPUR COMPOSITE

Then you can create an index on the search field, use upper($var) for your
searches, and thereby run an index match that is case-insensitive.

Eric

"Michael Peppler" <mpeppler@peppler.org> wrote in message
news:392D36B0.D9744605@peppler.org...
> andrew wrote:
> >
> > Dear people;
> > I am having a problem in searching data in sybase. There are two fields
> > in a table which contains data about stock tickers and tickers name.
> >
> > tickers tickerName
> > AII123 Kuala Lumpur Composite
> >
> > I am using sql to search for the tickerName in my table. My select
> > statement is as below.
> > select * from table where tickerName='$var'
> >
> > I am using php as my programming language.
> > My problem is the variable $var is actually taken from a textfield. The
> > search works fine when user actually type 'Kuala Lumpur Composite' and
> > there is a perfect match. My problem is the user might type everything
> > in lower case or a mix of uppercase and lowercase. When this happen, no
> > match can be found. Is there a way to rectify this problem. PLease help
> > as i'm near my dateline.
>
> A couple of solutions:
>
> Make sure the case is correct before you pass the $var variable to
> the select.
> Use lower() or upper() (though that might invalidate the index)
> Convert your server to case-insensitive sort-order.
>
> Michael
> --
> Michael Peppler -||- Data Migrations Inc.
> mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
> Int. Sybase User Group -||- http://www.isug.com
> Sybase on Linux mailing list: ase-linux-list@isug.com