🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #11017

Re: Case-insensitive collations

#11017
From: CleverComponents Team
Date: Mon, 23 Dec 2002 23:10
49 lines
2896 bytes
Hi Mike,

Let me post small part from article (yet to be published soon):
=== (Migration from Paradox and dBase to Interbase / Firebird - Practical
Guide) ===
3) Secondary Indexes
Interbase has same indexes definition as Paradox/dBase with few exceptions:
- Index names should be unique across one Intrebase database. Same rule
applies for Paradox table only so you will have to check index names to
avoid duplication.
- Interbase support Case Sensitive indexes only. This is the one and the
only option for Interabase indexes.

If you need create case insensitive index you have two options:
a) Use case insensitive COLLATE clause order (see example):
  CREATE TABLE "TABLE" (
    "ID" INTEGER,
    "NAME" VARCHAR(50) CHARACTER SET ISO8859_1 COLLATE EN_US);

  CREATE INDEX "IND_TABLE_NAME" ON "TABLE" ("NAME");

Index "IND_TABLE_NAME" will be in fact case insensitive because of case
insensitive COLLATE EN_US used for field "NAME".

Following SQL will use "IND_TABLE_NAME" index and return case insensitive
result set:
  SELECT "NAME"
  FROM "TABLE_NAME"
  ORDER BY "NAME"

All SQL operations (comparison, ORDER BY and GROUP BY) on fields with case
insensitive COLLATE order will be also case insensitive by default.
You can overwrite COLLATE order for every comparison, ORDER BY and GROUP BY
operations but in this case index will not be used.

Following SQL will not use "IND_TABLE_NAME" index and return case sensitive
result set:
  SELECT "NAME"
  FROM "TABLE_NAME"
  ORDER BY "NAME" COLLATE ISO8859_1

Please remember about that drawback with COLLATE clause.
===
To be more specific collations like EN_US, DU_NL, FR_FR etc. seems to be
case insensitive so probably you can rely on naming convention but if you
can run some tests then it will be more obvious.

My best regards,
Alex
Technical Details
Message-ID: <3e079781$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3e0750bf$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a0e,191dc90c586a0f92
X-Google-Attributes: gid114a0e,public
X-Google-ArrivalTime: 2002-12-23 15:10:05 PST
From: "CleverComponents Team" <info@clevercomponents.com>
Newsgroups: borland.public.interbase.sql
References: <3e0750bf$1@newsgroups.borland.com>
Subject: Re: Case-insensitive collations
Date: Mon, 23 Dec 2002 15:10:34 -0800
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 216.103.70.227
Message-ID: <3e079781$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1040684929 216.103.70.227 (23 Dec 2002 15:08:49 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail