Subject | Re: [ib-support] Default database collation |
---|---|
Author | Helen Borrie |
Post date | 2002-05-13T11:53:16Z |
I had written:
character set used for all text columns (CHAR, VARCHAR and text BLOB)
unless you specify something different at domain or column level. However,
to make that work, you need to connect using that default character set for
the connection...so, you see, running a CREATE DATABASE script that sets
the default charset will place your session in that charset, when it
connects to the db after creating it. In future sessions, the server won't
know it, unless you set it either on connection, or with SET NAMES.
character set defined, make sure that you've tested to be certain it's not
taking the default for the database. You could test it by trying to insert
_NONE character data into the field. If it is NONE, it will take anything
at all; if it is WIN1250 (or something else) you should get a
transliteration error.
insert into aTable(oldcol, newcol)
values('something', _NONE 'something in charset WIN1250')
What could have happened is that you connected to the database using
character set NONE. Any new columns you defined without a character set
would (I think) take the character set of the connection.
Helen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________
> > You need to specify the collation order when declaring domains and/orAt 12:10 PM 13-05-02 +0200, Achim Kalwa wrote:
> > columns. You can also specify the collation order in a GROUP BY clause.
>is this different behaviour from Interbase 6.0?No, it hasn't been changed.
>So what is the default character set for?If you declare a default character set at CREATE DATABASE, that will be the
character set used for all text columns (CHAR, VARCHAR and text BLOB)
unless you specify something different at domain or column level. However,
to make that work, you need to connect using that default character set for
the connection...so, you see, running a CREATE DATABASE script that sets
the default charset will place your session in that charset, when it
connects to the db after creating it. In future sessions, the server won't
know it, unless you set it either on connection, or with SET NAMES.
>I just ran into problems by adding a new varchar-field to an existingBefore you go racing off on the assumption that the new column has no
>table: "alter table AUFTRAG add E_USER varchar(30)"
>The new field has no character set defined.
character set defined, make sure that you've tested to be certain it's not
taking the default for the database. You could test it by trying to insert
_NONE character data into the field. If it is NONE, it will take anything
at all; if it is WIN1250 (or something else) you should get a
transliteration error.
insert into aTable(oldcol, newcol)
values('something', _NONE 'something in charset WIN1250')
What could have happened is that you connected to the database using
character set NONE. Any new columns you defined without a character set
would (I think) take the character set of the connection.
Helen
All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________