Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Locale setting
Thu, Oct 30 2008 5:21 AMPermanent Link

"Petter Topp"
Hi all.

I have just discovered that I have been rather inconsistent on setting the
tables locale when creating a new one.
Some of my tables are set to the Norwegian locale and other to ANSI
Standard. (This was discovered when installing my apps. on a XPe device -
error 15878).
Now I wonder:

1. Must this setting (Locale) be set manually, or will dbsys at some point
set this value depending on the structure of the table?
2. What effect will the ANSI Standard have, except sorting order for special
charaters (The correct Local should be Norwegian)?
3. Are there perfomance issues related to the Locale setting.

Regards
Petter Topp
Norway
Delphi 2007, Dbisam 4

Thu, Oct 30 2008 5:50 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Petter


DBSys won't do it for you, it can be used but it will require manual intervention. As part of my conversion to ElevateDB I decided I'd move everything to ANSI. Here's the small function you should be able to adapt it for your needs simply.

procedure AlterCollation(ACurDir: string);
var
 SearchRec: TSearchRec;
 iRet: Integer;
begin
 glProgress1.Caption := 'Altering collation to ANSI .. [%d%%]';
 glProgress1.Percent := 0;
 Cntr := 0;
 if ACurDir[Length(ACurDir)] <> '\' then ACurDir := ACurDir + '\';
 iRet := FindFirst(ACurDir + '*.dat', faAnyFile, SearchRec);
 Changer.DatabaseName := ACurDir;
 while iRet = 0 do begin
  if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then begin
   inc(Cntr);
   glProgress1.Percent := Min(100, Cntr);
   glProgress1.Update;
   Changer.Close;
   Changer.SQL.Clear;
   Changer.SQL.Text := 'ALTER TABLE ' + Copy(ExtractFileName(SearchRec.Name), 1, Pos('.', ExtractFileName(SearchRec.Name)) - 1) + ' LOCALE CODE 0 NOBACKUP';
   Changer.ExecSQL;
   Changer.Close;
   try
    Assist.Active := True;
   except
   end;
   if Assist.Active then Assist.Close;
  end;
  iRet := FindNext(SearchRec);
 end;
 FindClose(SearchRec);
end;


Roy Lambert
Image