Information Technology Reference
In-Depth Information
Relational Operation Update
Suppose we want to replace the value of an attribute A in the relation R with the
value V. Basically, we consider two cases. In the first case, A is not a foreign key.
It corresponds to a data item in the corresponding record type N and thus we need
a modify network command to perform the replacement. In the second case, A is a
foreign key. Replacing a value in this case involves changing the set linkages, rather
than the attribute value. Value (A) is the content of attribute A in the record type N
before update.
Algorithm Update
If A {A1, A2,… An} /* A is a non-foreign key attribute */
then if A = K(R) /* K(R) = key field in record R */
then drop the update /* disallow update record key */
else do
get N k record by secondary indices IX k
modify N k record /* update non-key field by A=V */
end
else if V null and value(A) = null /* A is a foreign key */
then connect N k to new-owner-record N n /* insert N k into
new owner record set */
else if V = null and value(A) null
then disconnect N k from old-owner-record N k-1
/* remove N k from old owner record set */
else if V null and value(A) null
then reconnect N k from old-owner-record N k-1 to new-
owner-record N n . /* change N k owner */
Other functions implied by the network IDMS include:
• Mandatoryorfixedsetmembership will disallow the disconnect operation to
preserve original inherent constraint of network database.
• Fixedsetmembershipwilldisallowforeignkeychange.
Search WWH ::




Custom Search