Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Insensitive result set
Sun, May 11 2008 10:14 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

select * from companies order by _Name

Produces an insensitive result set even though a sensitive one was requested. There is an index called CompanyName which is _Name COLLATE ANSI_CI ASC

Why is it insensitive?

EDB 1.09b3

Roy Lambert
Mon, May 12 2008 4:21 AMPermanent Link

"Ole Willy Tuv"
Roy,

<< Why is it insensitive? >>

Because the implicit collation of the sort specification doesn't match the
collation of the available index.

The default collation in EDB is ANSI (case sensitive). To get a sensitive
result set, you must explicitly specify the matching collation:

select * from companies order by _Name collate ANSI_CI

Ole Willy Tuv
Mon, May 12 2008 6:15 AMPermanent Link

"Jose Eduardo Helminsky"
Roy

I have realized that it is interesting to define COLLATE at field level and
you can use the SQL statement without any COLLATE clause.

Eduardo

Mon, May 12 2008 7:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ole


So simple when you know Smiley

Roy Lambert
Mon, May 12 2008 1:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eduardo,

<< I have realized that it is interesting to define COLLATE at field level
and you can use the SQL statement without any COLLATE clause. >>

Yes, and you're also guaranteed that both indexed and non-indexed searches
will return the same data.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, May 12 2008 1:22 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jose


Yeah, I've decided all of my VARCHAR's are becoming ANSI_CI - should make life a lot easier, at least for SQL for Delphi I'll just need to LowerCase both sides of comparisons.

Roy Lambert
Image