Learn R Programming

tab2xml (version 1.1.0)

validate_fk: Validate foreign key column

Description

Checks if a foreign key column exists in the reference table and ensures make all values in the foreign key column match the existing values in the primary key column of the referenced table.

Usage

validate_fk(table_pk, name_pk, table_fk, name_fk)

Value

`TRUE`. Generates warnings if the foreign key column is missing from the reference table or if it contains values that are not present in the column primary key of the referenced table.

Arguments

table_pk

A data frame that represents the table containing the primary key.

name_pk

A string indicating the name of the table to which reference.

table_fk

A data frame that represents the table containing the foreign key.

name_fk

A character string indicating the name of the reference table.