Case 2: Parts.User <-> User.user (relationship without referential constraint)
So when there is a relationshop without any constraint, why would you want to declare it? this is just an "optical" feature of MS Access. You won't need to (and you can't to be precise) transfer it into SAPDB. A foreign-key is always a true contraint that checks each value to exist in the referenced table.
Case 3: User.department_nr <-> Departments.department_nr (relationship with referential constraint, but no delete rule, only "Aktualisierungsweitergabe", which means, if I change the department_name it will be passed on to the user table, because Access knows the "bound column" (the relationship is realized through the department number, but at the user table there will be shown the department name)).
Well, something like "ON UPDATE CASECADE" is missing in SAPDB. Well, think of what would you do to the DBMS if you update a field. You might cause thousends of cascaded updates. Even if "ON UPDATE CASCADE" existed, i wouldn't use it. Instead you can change the column department_nr not to be the primary key, but you can put a unique index on it. Instead use a a SERIAL for the primary-key and reference this instead.
Here are now my questions: 1. Can I create a (foreign key) relationship between two tables like case 2? Without referential constraint means that if a part is deleted the user will never be deleted, even if this user only used this part.
I can't help you here. I would perhaps use ON DELETE SET NULL, although i would like to have username if a user is deleted. Only using the username is also fatal, since you might want to change the username some day. There might also be a user that being created with the same username like a user that's already deleted.
I would tend to use ON DELETE SET NULL, and display "deleted" if the field is NULL due to the fact that the referenced user got deleted.
2. Is there a way to realize bound columns?
What is a bound column?
3. What if I define no delete rule and the value at the referenced table (Table 2) is not at the referencing table (Table 1), but at another table (Table 3), which itself has a referential constraint rule with Table 2. Will the Value at Table 2 be deleted or not (it's the 'matching row' and 'Reference Cyle' I don't really understand).
I think i don't get you problem here.
BTW: the default delete rule is ON DELETE RESTRICT. So there is no case where there is no delete rule.
_______________________________________________ sapdb.general mailing list [EMAIL PROTECTED] http://listserv.sap.com/mailman/listinfo/sapdb.general
