A foreign Key (FK) is a constraint that references the unique primary key (PK) of another table.
Facts About Foreign Keys
Foreign Keys act as a cross-reference between tables linking the foreign key (Child record) to the Primary key (parent record) of another table, which establishing a link/relationship between the table keys
Foreign keys are not enforced by all RDBMS
The concept of referential integrity is derived from foreign key theory
Because Foreign keys involve more than one table relationship, their implementation can be more complex than primary keys
A foreign-key constraint implicitly defines an index on the foreign-key column(s) in the child table, however, manually defining a matching index may improve join performance in some database
The SQL, normally, provides the following referential integrity actions for deletions, when enforcing foreign-keys
The deletion of a parent (primary key) record may cause the deletion of corresponding foreign-key records.
Forbids the deletion of a parent (primary key) record, if there are dependent foreign-key records. No Action does not mean to suppress the foreign-key constraint.
The deletion of a parent (primary key) record causes the corresponding foreign-key to be set to null.
The deletion of a record causes the corresponding foreign-keys be set to a default value instead of null upon deletion of a parent (primary key) record
In a recent discussion, the question came up concern which Infosphere Datastage connectors and/or stages are supported by IBM for dashDB. So, it seems appropriate to share the insight gained from the question being answered.
What Datastage Connectors and/or stages are Supported for dashDB
You have three choices as to connectors, which may best meet you your needs based on the nature of your environment and the configuration chooses which have been applied:
The ‘Comment on Column’ provides the same self-documentation capability as ‘Comment On table’, but drives the capability to the column field level. This provides an opportunity to describe the purpose, business meaning, and/or source of a field to other developers and users. The comment code is part of the DDL and can be migrated with the table structure DDL. The statement can be run independently, or working with Aginity for PureData System for Analytics, they can be run as a group, with the table DDL, using the ‘Execute as a Single Batch (Ctrl+F5) command.
Basic ‘COMMENT ON field’ Syntax
The basic syntax to add a comment to add a comment to a column is:
COMMENT ON COLUMN <<Schema.TableName.ColumnName>> IS ‘<<Descriptive Comment>>’;
Example ‘COMMENT ON Field’ Syntax
This is example syntax, which would need to be changed and applied to each column field:
COMMENT ON COLUMN time_dim.time_srky IS ‘time_srky is the primary key and is a surrogate key derived from the date business/natural key’;