Subject | Re: Rif: [firebird-support] Chararacter set NONE to ISO8859_1 |
---|---|
Author | Aldo Caruso |
Post date | 2015-07-23T00:09:12Z |
thanks for your answer.
The question is what prevents data loss in the first procedure ?
Suppose the filed in question is
FIRST_NAME VARCHAR(60) CHARACTER SET NONE
so lets create a temporary field
TMP_NAME VARCHAR(60) CHARACATER SET ISO8859_1
and then lets fill it
UPDATE TABLE1 SET TMP_NAME = CAST(FIRST_NAME AS VARCHAR(60) CHARACTER SET OCTETS)
Whichever character (from 0 to 255) were in FIRST_NAME would be blindly copied to TMP_NAME.
This has the same effect as assuming that the characters in FIRST_NAME where loaded as ISO8859_1, so simply changing FIRST_NAME type from NONE to ISO8859_1 would be equivalent.
Aldo
The first procedure provides you safe from data loss.
you can directly execute the change of the charset after doing a complete
backup of the database.
-------Messaggio originale-------
Da: Aldo Caruso aldo.caruso@... [firebird-support]
Data: 21/07/2015 18.38.39
A: firebird-support@yahoogroups.com
Oggetto: [firebird-support] Chararacter set NONE to ISO8859_1
Hi,
I have some VARCHAR fields whose character set were incorrectly
defined as NONE. I would like to use ISO8859_1 instead.
I read on "The Firebird Book" that in order to do so you must add a
new temporary field, with the right character set, fill it with the data
from the original field ( using OCTECT as an intermediat chararacter set
) and finally drop and recreate the original field with the right
character set, filling it with the data that was stored in the temporary
field. The process ends up dropping the temporary field.
I wonder what is wrong with simply invoking "ALTER TABLE X ALTER
COLUMN Y TYPE CHAR(N) CHARACTER SET ISO8859_1"
Thanks in advance for any help.
Aldo Caruso
------------------------------------
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu. Try FAQ and other links from the left-side menu
there.
Also search the knowledgebases at http://www.ibphoenix
com/resources/documents/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------
Yahoo Groups Links
-----
Nessun virus nel messaggio.
Controllato da AVG - www.avg.com
Versione: 2015.0.6081 / Database dei virus: 4392/10282 - Data di rilascio:
21/07/2015
[Non-text portions of this message have been removed]