4D v16リレーション |
||
|
4D v16
リレーション
リレーション
Today, we're going to learn how to create relations and see how they work. 4D is a relational database management system. Relations between tables are shown by links between the foreign key and the primary key, which is a unique identifier. Nothing could be simpler than creating a relation: just click on a field (that will be the foreign key) and drag over to another field (the primary key).
Example: if we try to draw from the intervention Time field towards an Alpha or Text field, 4D won't create the relation. In the present case, we know that interventions are assigned to a technician, so one technician can have several different interventions. In this case, we draw the relation directly from the technician's initials field in the Interventions table to the ID field of the Technicians table. To change the properties of a relation, just double-click directly on it to display the Inspector. For this first approach, we want 4D to do the work for us and make the joins (that is, the retrieval of records from related tables) automatically without any programming.
When you choose these options, 4D carries out the requests required to load the related records into memory; in particular, when displaying records.
We'll come back to the other parameters for relations found in the Inspector a little later on. To complete these automatic features for the relations, you can use the Deletion Control option in the Inspector. This lets you configure the way 4D handles the deletion of a record in the primary key table, for example, in our case, the Technicians table:
Now we're going to put all these different options into practice in the next video which covers how to enter information using relations.
|
プロパティ
プロダクト: 4D
履歴
ARTICLE USAGE
セルフトレーニング ( 4D v16) |