Ask Your Question
1

Base Relations - error 170

asked 2015-04-07 06:17:35 +0200

peter.whitehead.96199 gravatar image

In LibreOffice 4.4 Base (OS Windows 7) in relationship window, when attempting to establish relations between 2 tables, both via icon or drag-and-drop, keep getting error report: "SQL Status: S0011 Error code: -170 Primary or unique constraint required on main table: "category table" in statement [ALTER TABLE "Product Table" ADD FOREIGN KEY ("Category") REFERENCES "category table" ("Category")]"

How do I setup a primary or unique constraint? (cannot find primary or unique constraints in Help index, or any of my database texts)

edit retag flag offensive close merge delete

Comments

It does seem to be broken in many instances. Could graphically create primary-to-primary connection, but others failed. Unclear to me so far if the relationships are being created and are not being displayed graphically. Could try to run ALTER TABLE statement directly in Tools -> SQL dialog box, hope for a different result.

doug gravatar imagedoug ( 2015-04-07 22:59:35 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2015-04-08 14:36:15 +0200

pierre-yves samyn gravatar image

Hi - If you want to define a relation among the different tables, you should enter a primary key for, at least, one of the two tables involved in the relationship.

In LibreOffice, you define the primary key in the design view of a table, by choosing the relevant command from the context menu of a row header for the selected field.

DesignMode

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-04-07 06:17:35 +0200

Seen: 1,240 times

Last updated: Apr 08 '15