ITTIA DB SQL C API  5.4.0
db_foreign_key_def_t Struct Reference

#include <ittia/db.h>

Data Fields

db_objname_t fk_name [DB_INDEX_NAME_SIZE]
db_objname_t ref_table [DB_TABLE_NAME_SIZE]
int8_t match_option
int8_t update_rule
int8_t delete_rule
int8_t deferrable
int8_t check_time
int8_t nfields
struct {
   db_fieldno_t   org_field
   db_fieldno_t   ref_field
fields [DB_MAX_FOREIGNKEY_FIELD_COUNT]

Detailed Description

Foreign key definition.

Examples:
phonebook_c_schema.c.

Field Documentation

Name of the foreign key constraint.

Must be unique for each table.

Name of the table referenced by the foreign key.

How to match multiple fields.

See also:
DB_FK_MATCH_SIMPLE, DB_FK_MATCH_FULL

Set whether the constraint can be deferred until commit.

See also:
DB_FK_NOT_DEFERRABLE, DB_FK_DEFERRABLE

Set whether the constraint is initially deferred until commit.

See also:
DB_FK_CHECK_IMMEDIATE, DB_FK_CHECK_DEFERRED

Number of fields in the foreign key.

Field number in the original table.

Field number in the referenced table.

struct { ... } db_foreign_key_def_t::fields[ DB_MAX_FOREIGNKEY_FIELD_COUNT ]

List of fields in the foreign key.