Subject | Re: [IBO] excuse the stupid questions but.. |
---|---|
Author | Daniel Albuschat |
Post date | 2005-11-03T14:48:35Z |
2005/11/1, Marcelo Machado <machado6655@...>:
If all the data you need for computation are available in the SQL query you're
executing, you can easily calculate various stuff in the select iself:
select 4+5*a from b
On the other hand, if you need information that is only available on the client
or are doing some more complicated formatting, you can use TIB_Query's
CalculatedFields.
First, you add a line to the CalculatedFields StringList specifying the name and
the type of the `virtual', calculated column:
calculated integer
Then you assign a method to the OnCalculatedField event.
In this event, do something like this:
if( Field.FieldName = 'CALCULATED' ) then
Field.AsInteger := magic_value*30+sunray_intensity
Bye,
Daniel
--
eat(this); // delicious suicide
> ... Dear friends...There are actually two ways to do this, depending on your needs.
>
> ... how to calculate fields using ibo?
> I´m using Firebird.
>
> Are the calculations made by the application or for the firebird?
If all the data you need for computation are available in the SQL query you're
executing, you can easily calculate various stuff in the select iself:
select 4+5*a from b
On the other hand, if you need information that is only available on the client
or are doing some more complicated formatting, you can use TIB_Query's
CalculatedFields.
First, you add a line to the CalculatedFields StringList specifying the name and
the type of the `virtual', calculated column:
calculated integer
Then you assign a method to the OnCalculatedField event.
In this event, do something like this:
if( Field.FieldName = 'CALCULATED' ) then
Field.AsInteger := magic_value*30+sunray_intensity
Bye,
Daniel
--
eat(this); // delicious suicide