Am 31.10.2014 um 14:11 schrieb Marion & Noel Lodge:
> Hi,
> 
> I am trying to change some Primary Keys in my main table, and get the
> changes to be reflected in several Foreign Keys.
> I have gone into Tools |
> ​ ​
> Relationships, have set up the 1 to n connections between the tables and
> ​chosen "Update cascade".
> 
> However when I open the main table and attempt to change a Primary Key, I
> get the message "Referential integrity constrain violation".  I thought
> that "Update cascade" would override this.  Have I missed something, or is
> it a possible bug?
> 
> Thanks,
> 
> Noel
> ​
> --
> Noel Lodge
> lodg...@gmail.com
> 

Hi,

If it were a bug, then it would be a bug in the underlying database
program which is HSQL and not Base. Base is not a database at all.

Referencial integrity never lets you enter any foreign key value on the
n-side if there is no corresponding value in the other table's primary
key (the 1-side).
"Update cascade" allows you to update a primary key value on the 1-side.
This update will automatically change all the values in related foreign
keys. Normally you don't want cascading updates, particularly when using
auto-IDs which may be inserted and deleted but never updated.

If you want to enter arbitrary values into some field then you must not
make it a foreign key of some other table's primary key. You can make it
optional (nullable) but an orphaned foreign key value is not possible.

If you happen to work with an embedded HSQLDB (this is indicated in the
status bar), http://www.hsqldb.org/doc/1.8/guide/ch09.html is the
complete official documentation for the database program you are working
with.

Hope this helps,
A.S.



-- 
To unsubscribe e-mail to: users+unsubscr...@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

Reply via email to