Subject | RE: [firebird-support] Domains in computed columns |
---|---|
Author | Rick Debay |
Post date | 2009-03-04T22:18:01Z |
> AFAIK you cant specify a type for a computed field.If that's correct, then the question becomes "why can I specify a type
as in the first example?"
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Alexandre Benson
Smith
Sent: Wednesday, March 04, 2009 5:06 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Domains in computed columns
Rick Debay wrote:
> If I define a computed column with an explicit data type, it works:AFAIK you cant specify a type for a computed field.
>
> 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?
>
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
Disclaimer: This message (including attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. RxStrategies, Inc. shall not be liable for the improper or incomplete transmission of the information contained in this communication or for any delay in its receipt or damage to your system. RxStrategies, Inc. does not guarantee that the integrity of this communication has been maintained nor that this communication is free from viruses, interceptions or interference.