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


`
On 02/11/2013 09:18 AM, Uwe Brauer wrote:
Hello

(It seems that my message did not pass to the gmane newserver, that is
why I resend this message)

I am using Kubuntu 10.04 and installed the latest LO 4.0 (the problem
occurs also in 3.6, and in OO 3.3).

I set up the intrinsic (hsql) data base. I created two tables using the
templates: one is Task (from business) the other Accounts (from
personal). All the field values are the default ones.  I use an existing
field as a primary key (autovalue on), namely TaskId (numeric) and
AccountId (numeric). I insert some data and save them.


I then set up a relation between the two tables, where I relate the
fields corresponding to the primary keys. (TaskId-->AccountId) I save
the relation and reopen it.

Now I want to edit the relation and I am offered the possibility to add
more fields. So I select the notes file in either table but I receive
the following error.

  Primary or unique constraint required on main table.
  "Accounts" in statement [ALTER TABLE "Tasks"
   ADD FOREIGN KEY ("TaskId","Notes") REFERENCE "Accounts"("AccountI","Notes")]
I am puzzled, in the intrinsic database only relations between primary
keys are possible?? Is this a property of the intrinsic database, or is it a
bug? I am thinking of submitting a bug report.

Any help would be appreciated

Uwe Brauer
How do you define an "intrinsic database"? I do not understand the term. 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.

--Dan

--
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


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.