Subject RE: [ib-support] Changing charset in domains
Author Riho-Rene Ellermaa
What about something in lines

ALTER TABLE mytable ALTER mycolumn ....

to change from mydomain into varchar(20) charset win1252


Riho-Rene Ellermaa
senior programmer
Hansabank

>
>
> 0- drop index of this field if exists
> 1- add a new column
> alter table tx add newcol varchar(20) character set none;
> 2- copy the data to it.
> update tx set newcol = oldcol;
> 3- drop old column
> alter table tx drop oldcol;
> 4- recreate oldcol with new char set that you need
> alter table tx add oldcol varchar(20) character set none;
> 5- copy back the data.
> update tx set oldcol = newcol;
> 6- drop the temporary column
> alter table tx drop column newcol;
> 7- recreate index of this field if you need.
>
> Write a script like this and run it. (or write a SP and call )
> There is may be other way to do it via playing system
> tables, but i dont
> know how.
>
> I hope help this.
>
> Hi!
>
> I have domain varchar(20) which is used in couple of tables.
> I want to change it's charset from none to win1252. How can I
> do it without
> dropping any tables. I must do it in my customers database, so I would
> prefer to autorun some script inside my program.
>
> Riho-Rene Ellermaa
> senior programmer
> Hansabank
>