Subject Re: [IBO] Still Formatting problems
Author Helen Borrie
At 12:40 PM 06-08-01 +0000, you wrote:
>I took your advice and made a domain with numeric(12,2)
>B.T.W. I work with QuickDesk
>When I change the floating-point field in QuickDesk to this domain I
>get the following error
>
>unsuccessful metadata update.
>Cannot change datatype for EP_VAT. Conversion from base type DOUBLE
>PRECISION to 64-bit numeric is not supported.
>
>When I change the floating-point field directly, not with a domain It
>works, but instead of changing to a Numeric(12,2) field it changes to
>a double-precision field.
>
>Is there a way to change a field from floating-point to numeric
>(12,2) ?

You can always do it with a script:

ALTER TABLE mytable
ADD NEW_COL NUMERIC(12,2);
COMMIT;

UPDATE mytable
SET NEW_COL=CAST(OLD_COL AS NUMERIC(12,2));
COMMIT;

ALTER TABLE mytable
DROP OLD_COL;
COMMIT;

ALTER TABLE mytable
ADD OLD_COL NUMERIC(12,2);
COMMIT;

UPDATE mytable
SET OLD_COL=NEW_COL;
COMMIT;

ALTER TABLE mytable
DROP NEW_COL;
COMMIT;

Don't forget to run gbak before you start...

Cheers,
Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________