1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <helpdocument version=
"1.0">
5 ***********************************************************************
7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 * Copyright 2008 by Sun Microsystems, Inc.
11 * OpenOffice.org - a multi-platform office productivity suite
13 * $RCSfile: 05020000.xhp,v $
14 * $Revision: 1.12.4.1 $
16 * This file is part of OpenOffice.org.
18 * OpenOffice.org is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU Lesser General Public License version 3
20 * only, as published by the Free Software Foundation.
22 * OpenOffice.org is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License version 3 for more details
26 * (a copy is included in the LICENSE file that accompanied this code).
28 * You should have received a copy of the GNU Lesser General Public License
29 * version 3 along with OpenOffice.org. If not, see
30 * <http://www.openoffice.org/license.html>
31 * for a copy of the LGPLv3 License.
33 ************************************************************************
38 <topic id=
"textsharedexplorerdatabase05020000xml" indexer=
"include">
39 <title id=
"tit" xml-lang=
"en-US">Relations
</title>
40 <filename>/text/shared/explorer/database/
05020000.xhp
</filename>
44 <section id=
"relationen">
45 <bookmark xml-lang=
"en-US" branch=
"hid/HID_CTL_RELATIONTAB" id=
"bm_id3153345" localize=
"false"/>
46 <paragraph role=
"heading" id=
"hd_id3153323" xml-lang=
"en-US" level=
"1" l10n=
"U" oldref=
"1"><link href=
"text/shared/explorer/database/05020000.xhp" name=
"Relations">Relations
</link></paragraph>
47 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3146957"><bookmark_value>relational databases (Base)
</bookmark_value>
48 </bookmark><comment>mw added
"(Base)"</comment>
49 <paragraph role=
"paragraph" id=
"par_id3146957" xml-lang=
"en-US" l10n=
"U" oldref=
"2">This command opens the
<emph>Relation Design
</emph>window, which allows you to define relationships between various database tables.
</paragraph>
51 <paragraph role=
"paragraph" id=
"par_id3154823" xml-lang=
"en-US" l10n=
"CHG" oldref=
"19"><ahelp hid=
"HID_CTL_RELATIONTAB">Here you can link together tables from the current database through common data fields.
</ahelp> Click the
<emph>New Relation
</emph> icon to create the relationships, or simply drag-and-drop with the mouse.
</paragraph>
52 <section id=
"howtoget">
53 <embed href=
"text/shared/00/00000450.xhp#relationen"/>
55 <paragraph role=
"note" id=
"par_id3145316" xml-lang=
"en-US" l10n=
"U" oldref=
"3">This function is only available if you are working with a relational database.
</paragraph>
56 <paragraph role=
"paragraph" id=
"par_id3149235" xml-lang=
"en-US" l10n=
"CHG" oldref=
"4">When you choose
<emph>Tools - Relationships
</emph>, 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 the
<emph>Add Tables
</emph> icon. The
<link href=
"text/shared/02/14020100.xhp" name=
"Add Tables">Add Tables
</link> dialog opens in which you can select the tables that you want.
</paragraph>
57 <embed href=
"text/shared/00/00000450.xhp#sytabelle"/>
58 <paragraph role=
"note" id=
"par_id3152812" xml-lang=
"en-US" l10n=
"U" oldref=
"17">If the
<emph>Relation Design
</emph> window is open, the selected tables cannot be modified, even in Table Design mode. This ensures that tables are not changed while the relations are being created.
</paragraph>
59 <paragraph role=
"paragraph" id=
"par_id3150541" xml-lang=
"en-US" l10n=
"U" oldref=
"5">The selected tables are shown in the top area of the design view. You can close a table window through the context menu or with the Delete key.
</paragraph>
60 <embed href=
"text/shared/explorer/database/02010100.xhp#darstellungaendern"/>
61 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3148922"><bookmark_value>primary keys;inserting (Base)
</bookmark_value>
62 <bookmark_value>keys;primary keys (Base)
</bookmark_value>
63 <bookmark_value>external keys (Base)
</bookmark_value>
64 </bookmark><comment>mw added
"(Base)" to all entries
</comment>
65 <paragraph role=
"heading" id=
"hd_id3148922" xml-lang=
"en-US" level=
"2" l10n=
"U" oldref=
"6">Primary key and other key
</paragraph>
66 <paragraph role=
"paragraph" id=
"par_id3149168" xml-lang=
"en-US" l10n=
"U" oldref=
"7">If you want to define a relation among the different tables, you should enter a
<link href=
"text/shared/00/00000005.xhp#primaerschluessel" name=
"primary key">primary key
</link> that clearly identifies a data field of the 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 an external key.
</paragraph>
67 <paragraph role=
"paragraph" id=
"par_id3147085" xml-lang=
"en-US" l10n=
"U" oldref=
"8">All data fields referring to a primary key will be identified in the table window by a small key symbol.
</paragraph>
68 <paragraph role=
"heading" id=
"hd_id3153193" xml-lang=
"en-US" level=
"2" l10n=
"U" oldref=
"12">Define relations
</paragraph>
69 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3155430"><bookmark_value>relations; creating and deleting (Base)
</bookmark_value>
70 </bookmark><comment>mw added
"(Base)"</comment>
71 <paragraph role=
"paragraph" id=
"par_id3155430" xml-lang=
"en-US" l10n=
"U" oldref=
"13">All existing relations are shown in the relations windows by a line that connects the primary and other 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.
</paragraph>
72 <paragraph role=
"paragraph" id=
"par_id3149984" xml-lang=
"en-US" l10n=
"U" oldref=
"18">Alternatively, you can also click the
<emph>New Relation
</emph> icon in the top area of the relation field and define the relation between two tables in the
<link href=
"text/shared/explorer/database/05020100.xhp" name=
"Relations"><emph>Relations
</emph></link> dialog.
</paragraph>
73 <embed href=
"text/shared/00/00000450.xhp#SyRelationen"/>
74 <paragraph role=
"warning" id=
"par_id3153093" xml-lang=
"en-US" l10n=
"U" oldref=
"14">If you use $[officename] as the front-end for a relational database, the creation and deletion of relationships is not placed in an intermediate memory by $[officename], but is forwarded directly to the external database.
</paragraph>
75 <paragraph role=
"paragraph" id=
"par_id3155856" xml-lang=
"en-US" l10n=
"U" oldref=
"15">By double-clicking a connection line, you can assign certain properties to the relation. The
<emph>Relations
</emph>dialog opens.
</paragraph>