Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index

"Dan" == Dan Lewis <> writes:

   > `
   > On 02/11/2013 09:18 AM, Uwe Brauer wrote:
   >> Uwe Brauer
   >      How do you define an "intrinsic database"? I do not understand
   >      the term.

Well in my understanding there are two possibilities, 

    -  either Base can connect to an external database such as mysql via
       a number of drivers or

    -  it uses a database it ships (I think it is based in
       hsql). Because of a lack of a word I denoted this as intrinsic.

   >      Primary-foreign key pairs are created when a table is
   > normalized. (There several levels of normalized tables.) These pairs
   > are based upon the relationships between the fields of the original
   > table.
   >      So, you probably should put all the fields of the two tables into
   > a single table with the exception of any fields that belong to both
   > tables. For example the single table contains only one primary key
   > ("ID") and one field named "Notes". Then look for any fields (other
   > than "ID") that determine the values of other fields. (In other words,
   > begin to normalize the table.) Without knowing all of the fields that
   > you are using, it would be difficult to know what fields these might
   > be.
   >      FYI, very seldom will two tables have a 1:1 relationship (linking
   > the primary keys of the two tables). Very likely, yours doesn't
   > either. Most often, these relationships involve a primary key of one
   > table and a foreign key of the other.

I am not entirely sure I understand: I set up a new base, no the primary
keys are not any existing field of the table (autovalue is On)

My tables are the following (they are just toy models in order to
understand the relation ship concept)

Name Type
Id   (generated by OO as a primary key)
Task Id Integer
Description Memo Longchar
Notes Memo Longchar

Name Type
Id (generated by OO as a primary key)
Author Id Integer 
FirstName Memo Longchar
Nationality Notes Memo Longchar

Now I try to make a relation between the two tables, and in the GUI I
select the field Task Id and Author id in the other table, since both
fields have the same type.

I receive  the following error:

SQL Status: 23000
Error code: -177

Integrity constraint violation - no parent 1, table: Authors in
statement [ALTER TABLE "Authors" ADD  FOREIGN KEY ("AuthorID")
REFERENCES "Tasks" ("ID")] 

Now the gui allow me to add more fields so I add both primary keys, gain
an error:
SQL Status: S0011
Error code: -170

Primary or unique constraint required on main table: "Tasks" in
statement [ALTER TABLE "Authors" ADD FOREIGN KEY ("AuthorID","ID")
REFERENCES "Tasks" ("TaskID","ID")]

The only one which works, using the GUI is between the primaries keys!!!

Did you try it out your self and you are able to set more relations
between the tables?

As I said, in another mail,  when I connect the data base to mysql via
ODBC then I can set more relations, but they are not saved..


For unsubscribe instructions e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.