How UPDATE Statements are Handled

Previous Next

A SQL statement that updates a column is checked within the table to which the column belongs except for the following three situations:

If a column is part of the primary key of the constellation, the Update right is checked only in the uppermost supertype table. Any rights defined for subtype tables are ignored.

If the column is a subtype indicator column that is switched from 'Y' to 'N', this causes the subtype data to be deleted (if the subtype object data is physically stored in a separate table), and the supertype record to be updated (its subtype indicator column is set to N).

However, denying the delete right on the subtype table is not enough to prevent loss of the subtype object data. This may appear confusing, but an UPDATE of the subtype indicator column is also considered to be an UPDATE to the subtype table (and its mandatory columns). So if the update right is specified on the subtype table, the subtype record is deleted anyway (only if either both rights are completely denied or the update of the subtype indicator is denied by specifying a suitable condition, the subtype data cannot be removed).

If the subtype object is physically stored in the same table as its supertype, only an UPDATE statement is actually executed.

If the column is a subtype indicator that is switched from 'N' to 'Y', this is considered to be an update on the supertype and subtype tables. This means that, at least, the right to update the subtype indicator column, and the right to update the subtype table, must be specified, to be able to add subtype object data to an existing supertype object.

NOTE: If the column is a subtype indicator that is switched from 'N' to 'Y' (where the subtype object data is physically stored in a separate table), entering data of a new supertype object, causes a subtype and supertype record to be inserted at Store Record. If for whatever reason the Store Record is executed before the subtype object's data fields are filled (for example immediately after selecting the subtype indicator in the supertype box, and before navigating to the subtype box), filling subtype data fields, again followed by a Store Record, causes an update to be executed instead of an insert.