dictionary_banner (2K)

dict_related_column(multi4)a - Update Child Relationship

dict_related_column(multi4) (25K)

The purpose of this function is to allow the user to update the details of entries on the DICT_RELATIONSHIP table of the data dictionary. This will also allow amendments to the DICT_RELATED_COLUMNS table.

This form is accessed by an option on the navigation bar in the List Relationship screen.

For a complete description of how this type of form works please see Transaction Pattern MULTI 4.

Field List
Field NameTypeDescription
database_id_snr STRING The identity of the parent/senior database in the relationship.
table_id_snr STRING The identity of the parent/senior table in the relationship.
table_alias_snr STRING Where multiple relationships between the same tables exist this is a means of providing an alias for the parent/senior table.
database_id_jnr STRING The identity of the child/junior database in the relationship.
table_id_jnr STRING The identity of the child/junior table in the relationship.
table_alias_jnr STRING Where multiple relationships between the same tables exist this is a means of providing an alias for the child/junior table.
seq_no NUMERIC If there is more than one relationship between the same tables - in other words, it has duplicates - then this value is a means of making the key unique. The default value is zero for the first entry, and should be incremented for duplicate entries.
relation_name STRING A user-defined name for the relationship.
relation_desc TEXT Optional. A user-defined description for the relationship.
relation_type STRING This specifies how the relationship is to be treated when deleting entries from the parent/senior table. Possible values are:
  • 'RESTRICTED' - cannot delete the parent entry if any associated entries exist on this child table.
  • 'CASCADE (framework)' - when the parent entry is deleted all associated entries on this child table will also be deleted. These entries will be processed in the sequence specified in ORDERBY.
  • 'NULLIFY (framework)' - when the parent is deleted all matching entries on this child table will have their foreign key field(s) set to NULL.
  • 'CASCADE (FK constraint)' - this will be actioned by a foreign key constraint in the database and not by the framework.
  • 'NULLIFY (FK constraint)' - this will be actioned by a foreign key constraint in the database and not by the framework.
  • 'IGNORE (no action)' - the parent will be deleted without affecting any of the child entries.
Notice here that those items containing '(framework)' will be actioned by the RADICORE framework, which includes looging all deleted records in the AUDIT database, while those containing '(FK constraint)' will be actioned by a foreign key constraint in the database and will be completed faster and without any AUDIT logging.
orderby STRING This is only used when REL-TYPE = 'CASCADE (framework)'. It identifies the sequence in which child entries will be processed when they are deleted.
parent_field STRING When dealing with a single occurrence from the child table there is code in the standard table class which will attempt to access the parent (foreign) table and bring back one of its fields for inclusion in the data array for the child. This is used to specify which field to return. Possible values are:
  • ' ' - do not perform any lookup on the parent table.
  • '<column>' - perform a lookup and return the named field.
  • 'CALCULATED' - use the contents of CALC_FIELD as the field name(s).
calc_field STRING This is only used when PARENT-FIELD = 'CALCULATED'. It provides a means of returning one or more values from the parent table. For example:
  • "field1, field2, ..., fieldn" - can be used to return multiple values.
  • "fieldname AS aliasname" - can be used where multiple relationships exist in order to return a different fieldname from each relationship.
  • "CONCAT(field1, ' ', field2) AS field3" - can be used to return a derived or calculated value.
  • Any combination of the above.
key_name STRING This will default to the PRIMARY key, but will show the names of other unique keys if they are available.
The following fields are for the related columns:
column_id_snr STRING There will be a separate row for each field within the selected key of the senior (parent) table.
column_id_jnr STRING The identity of the corresponding field in the junior (child) table.

http://www.tonymarston.net
http://www.radicore.org