Carlos,

> 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.

The current functionality seems to be reasonable to me.

How can system know about Field2 if it hasn't reached that far in parsing the 
command?

Yes, I suppose a multi-pass parser could be implemented, but I think that is 
unnecessary.


I wonder, though, what impact having a computed field before a "real" field 
would have in the on-disk representation.  Would there be a 'placeholder' for 
the field on disk?  

If so, then computed fields should be defined at the bottom of the structure, 
since the row compression logic drops the unfilled/unused fields from the end 
of rows.


Sean

------------------------------------------------------------------------------
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