Subject Re: [firebird-support] Definig variable as a domain
Author Randall Sell
Annoying Yahoo mail doesn't allow me to append to the end of your msgs. Only on top, anyway...

I guess what I was asking is, what exactly is it doing, if you define a variable as a domain, sans the "type of" keywords? Why doesn't the compiler see this as a syntax error? And is there a way to know what real data type it thinks it is?

We have litterally hundred of SP references that use this domain:
CREATE DOMAIN SURROGATEKEY
AS Bigint
NOT NULL
;

Where the variables are defined incorrectly, a la:
DECLARE VARIABLE FOO SURROGATEKEY

But they all seem to be working. So what might I do, to test your statement that these will fail at some point?

cheers,
-randall





________________________________
From: Helen Borrie <helebor@...>
To: firebird-support@yahoogroups.com
Sent: Mon, 15 March, 2010 6:36:09 PM
Subject: Re: [firebird-support] Definig variable as a domain


At 06:16 PM 15/03/2010, Helen Borrie wrote:

>PERCENTAGE is not a data type. The TYPE OF keyword signals to the engine that you want the variable to have the same data type as the data type of the named domain. Note that any constraints applicable to the domain do apply to the variable.

Should be "do NOT apply to the variable".

In answer to your next question, if you have written a whole bunch of PSQL on the assumption that a domain is a data type then you will have to fix them all.

./heLen







[Non-text portions of this message have been removed]