Relácie

Tento príkaz otvorí okno Návrh vzťahu, kde je možné nastaviť vzťahy medzi rôznymi tabuľkami databázy.

Pomocou spoločných dátových polí je možné navzájom prepojiť tabuľky aktuálnej databázy. Kliknite na ikonu Nová relácia pre vytvorenie relácie alebo poľa jednoducho pretiahnite.

Pre prístup k tomuto príkazu...

In a database file window, choose Tools - Relationships.


Note Icon

Táto funkcia je dostupná len ak pracujete s relačnou databázou.


When you choose Tools - Relationships, a window opens in which all the existing relationships between the tables of the current database are shown. If no relationships have been defined, or if you want to relate other tables of the database to each other, then click on the Add Tables icon. The Add Tables dialog opens in which you can select the tables with which to create a relation.

Add Table Icon

Vložiť tabuľky

Note Icon

Ak je otvorené okno Návrh relácie, nemožno vybrané tabuľky upravovať ani v návrhovom režime. To zaisťuje, že sa počas vytvárania relácií nezmenia tabuľky.


The selected tables are shown in the top area of the relation design view. You can close a table window through the context menu or with the Delete key.

Presunutie tabuľky a zmena jej veľkosti

Tabuľky môžete usporiadať podľa svojich potrieb a zmeniť ich veľkosť. Ak chcete tabuľku posunúť, pretiahnite jej horný okraj na požadovanú pozíciu. Okno tabuľky zväčšíte alebo zmenšíte tak, že umiestnite kurzor myši na jeho okraj alebo roh a ťahaním myšou ho upravíte na požadovanú veľkosť.

Primary key and foreign keys

If you want to define a relation among the various tables, you should enter a primary key that uniquely identifies a data field of an existing table. You can refer to the primary key from other tables to access the data of this table. All data fields referring to this primary key will be identified as a foreign key.

Všetky dátové polia odkazujúce na primárny kľúč budú označené v okne tabuliek malým symbolom kľúča.

Definovanie relácií

All existing relations are shown in the relations windows by a line that connects the primary and foreign key fields. You can add a relation by using drag-and-drop to drop the field of one table onto the field of the other table. A relation is removed again by selecting it and pressing the Delete key.

Je tiež možné kliknúť na ikonu Nová relácia v hornej časti okna relácie a určiť vzťah medzi dvoma tabuľkami v dialógu Relácie.

New Relation Icon

Nová relácia

Warning Icon

If you use LibreOffice as the front-end for a relational database, the creation and deletion of relationships is not placed in an intermediate memory by LibreOffice, but is forwarded directly to the database.


Kliknutím na spojnicu je možné relácii priradiť vlastnosti. Otvorí sa dialóg Relácie.