Subject RE: [IBO] Creating Database on the Fly Part Deux
Author Thomas Steinmaurer
> -----Original Message-----
> From: Lucas Franzen [mailto:luc@...]
> Sent: Thursday, July 19, 2001 11:15 PM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Creating Database on the Fly Part Deux
>
>
> Paul,
>
>
> > I'll try it, I just hope I don't have to add the collation order to
> > every one of 10,000 varchar fields :-(
>
> You shoulkd think about using domains and adding the collation order to
> it!

this is the clean (always prefered) solution to go.

but if you need a fast "dirty solution" without using domains you could do

1) First dirty solution for newly databases

a) extract your database metadata

b) create a clean database with your choosen character set (WIN1252 should
be fine). for example:

CREATE DATABASE
'servername:/path/file.gdb'
PAGE_SIZE 4096
DIALECT1
USER 'SYSDBA' PASSWORD 'masterkey'
DEFAULT CHARACTER SET WIN1252;

Don't run your metadata script at this time.

c) Connect to your newly created database with a given user who should be
the owner of all database objects.

execute:

UPDATE RDB$CHARACTER_SETS SET RDB$DEFAULT_COLLATE_NAME = 'PXW_INTL850'
where RDB$CHARACTER_SET_NAME = 'WIN1252';

=> each newly created character field is created with database default
character set (WIN1252) and collation PXW_INTL850

d) run your metadata script

Be aware that after each backup/restore the default collation PXW_INTL850
for WIN1252 in RDB$CHARACTER_SETS is resetted to collation WIN1252


2) Second dirty solution for existing databases

a) hacking system tables

b) doing a backup/restore and hope you don't get any 'cannot transliterate
...' messages for existing data :-)). I've already done it, it was a
nightmare :-))).

> (but be aware that your maximum index length is just around one third of
> the original (sth. like 84 instead of 252 then).

and on a compound index this limit shrinks further ...

http://www.mers.com/IBINDEXLENGHT.HTML


Thomas>