Subject Re: [firebird-support] Re: UNICODE_FSS in select statement - ERROR
Author Tetram Corp
Hi,

you said to use
update yourtable
set tempunicode = cast (ExistingColumn as varchar(50) character set
UNICODE_FSS)

is the cast mandatory (I thought it was implicit) or is it just because
you wanted to provide a generic query (usable in most cases) ?

Thierry


Helen Borrie a écrit :
>
> At 08:30 PM 12/03/2009, you wrote:
>
> >It is not non-unicode caracters it is characters from win1251 set
> (latin)
>
> win1251 is not unicode, and a "collation" called UNICODE_FSS is not a
> valid collation for the win1251 character set.
>
> You will need to create a new (temporary) column and use it to convert
> your data, viz.
>
> alter table yourtable
> add tempunicode varchar(50) character set UNICODE_FSS
>
> Commit that; then do
>
> update yourtable
> set tempunicode = cast (ExistingColumn as varchar(50) character set
> UNICODE_FSS)
>
> Commit that; then check that the new column has the data correctly.
>
> Then drop the ExistingColumn; then do
>
> alter table yourtable
> add ExistingColumn varchar(50) character set UNICODE_FSS
>
> Commit that; then do
>
> update yourtable
> set ExistingColumn = tempunicode
>
> Check the data; then finally, drop the tempunicode column.
>
> >Here is one add: I was backup and restore my firebrid database 2.0
> with firebird 2.1.1 in all cases when this don't work!
>
> Backing up and restoring does not convert single-byte data (e.g.
> win1251) into unicode, which is multi-byte.
>
> Also consider converting this data to UTF8, rather than UNICODE_FSS,
> which is very limited in its capability and not very portable.
>
> ./hb
>
>