On 15-9-2012 19:02, Carlos H. Cantu wrote:
> Example:
>
> create table a (
>   field1 computed by (field2 * 0.5),
>   field2 numeric (9,2)
> );
>
> returns:
>
> Column does not belong to referenced table.
> Dynamic SQL Error.
> SQL error code = -206.
> Column unknown.
> FIELD2.
> At line 2, column 22.
>
> BUT
>
> create table a (
>   field2 numeric (9,2),
>   field1 computed by (field2 * 0.5)
> );
>
> Works fine.

I think it is logical that a calculated field can only contain columns 
defined before its own definition, but the documentation isn't really 
explicit. The Interbase 6 manual does say "Columns referenced in the 
expression must exist before the column can be defined.", but it is 
unclear if this applies to the definition order in the CREATE TABLE 
statement, or if it is just a statement of fact.

Mark
-- 
Mark Rotteveel

------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to