Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread How to get the System Default Collation?
Mon, Jul 9 2012 12:18 PMPermanent Link

Rolf Frei

eicom GmbH

Hi

I'm must to know, what the actual collation of the system is, as I want to
uses this to create my DB. In DBISAM I did use this;:


CREATE TABLE ......
LANGUAGE " + LanguagesList[GetIndexFromLanguageID(GetUserDefaultLangID)] + "
SORT "Default Order"
......

How can I do this in EDB2? How can I get "DES", "ENU" or whatever the DB is
created on?

Regardds
Rolf
Tue, Jul 10 2012 3:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Rolf


I don't think you can. In ElevateDB the collation is applied column by column and not to the database as a whole.

Roy Lambert [Team Elevate]
Tue, Jul 10 2012 7:36 AMPermanent Link

Rolf Frei

eicom GmbH

Roy,

I think you didn't understand my question. I need to get the system or user
default Collation of the Windows system, so I can pass that value to the
Create Table statements as the collation of the fields. I don't want to
hardcode this Collation, instead it must use the actual system collation. I
don't have an idea how I can get that collation or what EDb function does
return the system default collation, which I can pass to the Create
Statment.

Regards
Rolf

"Roy Lambert"  schrieb im Newsbeitrag
news:378ECFD6-AC51-4211-B6FB-FEB07B9132F3@news.elevatesoft.com...

Rolf


I don't think you can. In ElevateDB the collation is applied column by
column and not to the database as a whole.

Roy Lambert [Team Elevate]
Tue, Jul 10 2012 8:55 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Rolf


Have a look at this link

http://stackoverflow.com/questions/5774928/get-short-windows-language-name

You'll probably have to add code yourself to convert from what's reported to Tim's collation names but it should be easy enough.

Roy Lambert [Team Elevate]
Tue, Jul 10 2012 9:00 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Rolf


A slightly simpler version

http://www.festra.com/wwwboard/messages/1207.html


Roy Lambert [Team Elevate]
Tue, Jul 10 2012 9:00 AMPermanent Link

John Hay

Rolf

> I'm must to know, what the actual collation of the system is, as I want to
> uses this to create my DB. In DBISAM I did use this;:
>
>
> CREATE TABLE ......
> LANGUAGE " + LanguagesList[GetIndexFromLanguageID(GetUserDefaultLangID)] + "
> SORT "Default Order"
> .....
>
> How can I do this in EDB2? How can I get "DES", "ENU" or whatever the DB is
> created on?


You can create your own function like

function default_collation_name:string;
var
 p:array[0..3] of char;
 i:integer;

begin
 i := 4;
 getlocaleinfo(getuserdefaultlangid,LOCALE_SABBREVLANGNAME,p,i);
 result := p;
end;

John

Tue, Jul 10 2012 11:32 AMPermanent Link

Rolf Frei

eicom GmbH

Roy and John,

Thanks. I thougth EDB would give me a simple function for this. I have now
looked at the Windows API and found the EDB routine GetLocalData. With this
call it seems to give me what I want:

 Collation := edbenv.GetLocaleData(LOCALE_USER_DEFAULT,
LOCALE_SABBREVLANGNAME);

Regards
Rolf


"John Hay"  schrieb im Newsbeitrag
news:9FEA8641-0090-4B52-9184-77A6A2A9BEBC@news.elevatesoft.com...

Rolf

> I'm must to know, what the actual collation of the system is, as I want to
> uses this to create my DB. In DBISAM I did use this;:
>
>
> CREATE TABLE ......
> LANGUAGE " + LanguagesList[GetIndexFromLanguageID(GetUserDefaultLangID)] +
> "
> SORT "Default Order"
> .....
>
> How can I do this in EDB2? How can I get "DES", "ENU" or whatever the DB
> is
> created on?


You can create your own function like

function default_collation_name:string;
var
 p:array[0..3] of char;
 i:integer;

begin
 i := 4;
 getlocaleinfo(getuserdefaultlangid,LOCALE_SABBREVLANGNAME,p,i);
 result := p;
end;

John
Image