Subject | Re: [IB-Architect] Declare Variables as Domains |
---|---|
Author | Martijn Tonies |
Post date | 2001-12-13T07:41:06Z |
Hi,
use the same datatype as existing columns?
declare variable emp_key EMPLOYEE%EMP_NO;
This makes variable emp_key have the same type as the column in
EMPLOYEE (don't watch the syntax) and if you change the type
of EMP_NO, you would have to re-compile the procedure/trigger
(see also 'Invalid Database Objects' thread)...
I guess this is sort of a domain (EMP_NO), but without the
constraints...
--
Martijn Tonies
Upscene Productions
InterBase Workbench - The Developer Tool for InterBase
http://www.interbaseworkbench.com
"Experience is what you get when you didn't get what you wanted"
> But on use the of global variable based variables, I applaud itIf it comes to 'based on', what about the feature in Oracle that let's you
> wholeheartedly. From the very dawn of time (yea, even before the
> first line of engine code was typed on the Pro-350) GPRE supported
> variations on "declare foo based_on bar" where "bar" was a global
> variable. The practice is excellent for both clarity and maintainability.
use the same datatype as existing columns?
declare variable emp_key EMPLOYEE%EMP_NO;
This makes variable emp_key have the same type as the column in
EMPLOYEE (don't watch the syntax) and if you change the type
of EMP_NO, you would have to re-compile the procedure/trigger
(see also 'Invalid Database Objects' thread)...
I guess this is sort of a domain (EMP_NO), but without the
constraints...
--
Martijn Tonies
Upscene Productions
InterBase Workbench - The Developer Tool for InterBase
http://www.interbaseworkbench.com
"Experience is what you get when you didn't get what you wanted"