Datasheet
RAIS 3.0 Programmer’s Guide – Part I : Advanced Customization
20
and again run and analyze it. It returns only a record set if our first step query returns no
record set. That’s the consistency check we wanted to have. Add the following record to the
table [Propagator – Consistency Checks]
Form Name SUB EDIT Generator
Query Name Consistency Check – Generator Duplicate Serial Number
Message Duplicate Serial Number.
There are possibilities to achieve the same with one single query, but we will see immediately
the reason why it is recommended to use hierarchical queries. Even with 2 steps, the
consistency check is intuitive and simple. Unfortunately, too simple. Go to an existing
generator, and switch to EDIT mode. Now, without doing any modifications, click APPLY to
save and you will see that the warning message for duplicate serial number appears, although
it should not. Our simple query did not take into consideration the fact that if we modify an
existing generator the serial number already exists in the table, although it is not duplicate. So
we have to exclude the existing record that is about to be modified from the query. This is
done most efficiently by excluding via the primary key of the record. Do this in the first step
query, make it have the following shape:
and try again. Try adding a new generator and try modifying an existing generator. The
consistency check now works correctly for both appending new records and modifying
existing records. If you still are not convinced of using hierarchical queries, try to achieve
this within a single query. You will need to be very good in SQL, or lots of patience.










