Subject | Re: [firebird-support] Changing field size to smaller |
---|---|
Author | Lucas Franzen |
Post date | 2004-08-10T12:09:37Z |
Riho-Rene,
Riho-Rene Ellermaa schrieb:
UPDATE corresp SET temp = SUBSTRING ( details FROM 1 FOR 140 );
otherwise it can't work.
You cannot pump VARCHAR(210) in VARCHAR(140) fields, the engine itself
will never cut the value for you to make it fit.
Riho-Rene Ellermaa schrieb:
> I use this script (DETAILS was varchar(210)):change this to:
>
> ALTER TABLE corresp add TEMP Varchar(140) CHARACTER SET WIN1252 COLLATE
> WIN1252;
> update corresp set temp=details;
UPDATE corresp SET temp = SUBSTRING ( details FROM 1 FOR 140 );
otherwise it can't work.
You cannot pump VARCHAR(210) in VARCHAR(140) fields, the engine itself
will never cut the value for you to make it fit.
> ALTER TABLE corresp drop details;now this will work, since the temp column is just a varchar(140).
> ALTER TABLE corresp add details Varchar(140) CHARACTER SET WIN1252
> COLLATE WIN1252;
> update corresp set details=TEMP;
> ALTER TABLE corresp drop TEMP;Luc.
>
> I can't move the data! Script causes "arithmetic or string truncation
> error" when old Details field data is longer than 140