Subject Re: [firebird-support] Domains in computed columns
Author Alexandre Benson Smith
Rick Debay wrote:
> If I define a computed column with an explicit data type, it works:
>
> FIELD_NAME DECIMAL(5,2) COMPUTED BY (...some formula...)
>
> If I use a domain name, I get an error message:
>
> ISC ERROR CODE:335544569
> ISC ERROR MESSAGE:
> Dynamic SQL Error
> SQL error code = -104
> Token unknown - line 21, char 24
> COMPUTED
>
> FIELD_NAME DOMAIN_NAME COMPUTED BY (...some formula...)
>
>
> Is this the expected behavior?
>

AFAIK you cant specify a type for a computed field.

But you can cast it to the desired type.

FIELD_NAME COMPUTED BY (cast(...some formula... as DECIMAL(5,2)))


see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br