Datasheet

RAIS 3.0 Programmer’s Guide – Part I : Advanced Customization
12
To compensate for shifting of primary keys, the concept of evaluators has been introduced in
RAIS 3.0. Evaluators are tables containing primary key values of special records. The
evaluator table [Evaluator Unknown GM] for instance only contains one record, relating the
[unknown] record in the table [Generator Model]. Additionally, a relationship between both
tables is defined. During consolidation, records that are appended at the destination will have
a new primary key inside the destination. The RAIS 3.0 Consolidator has been designed to
compensate for this, and update foreign keys referring to that record. In clear words, if
records are appended into a new destination database, foreign key values of relating records
in other tables are updated to match primary keys of appended records. By means of this, the
table [Evaluator Unknown GM] will always contain one value, correctly pointing to the
record [unknown] in the table [Generator Model].
Safely retrieving generators with unknown models may then be done by means of below
query, explicitly using the evaluator [Evaluator Unknown GM]
Select * from [generator] where [generator].[fk model id] in (select [Evaluator Unknown
GM].[fk Generator Model id] from [Evaluator Unknown GM])
2.2.1 Examples
2.2.1.1 Evaluator for waste management facility
The standard installation of RAIS 3.0 does not provide for an evaluator table for waste
management facilities. So, in a first step, we have to create this table. If the table has already
been created in an earlier step, we may of course skip this section and continue at.
The same hidden functionality of the RAIS Creator is required as for creating new protectors.
So, please make again the field [Design Master] visible in the main form of the creator (see
section 2.1.1). Next, select and expand the group node Common Tables and click the button
Add Table.
Enter the evaluator table name [Evaluator Waste Management], select the option Simple
Table (without History), select the menu Setup and the menu node Common Tables and
click Apply. The new table will be displayed in the creator form.