Reference

The Reference category is located in the Root > Script > Objects category, and can contain the following items that define how references are modeled for your DBMS.

Item

Description

[Common items]

The following common object items may be defined for references:

  • Add

  • AfterCreate, AfterDrop, AfterModify

  • BeforeCreate, BeforeDrop, BeforeModify

  • ConstName

  • Create, Drop

  • Enable

  • MaxConstLen

  • ModifiableAttributes

  • ReversedQueries, ReversedStatements

  • SqlAttrQuery, SqlListQuery

For a description of each of these common items, see Common object items.

CheckOn Commit

Specifies that referential integrity testing is performed only after the COMMIT. Contains the keyword used to specify a reference with the CheckOnCommit option.

Example:

CHECK ON COMMIT

DclDelIntegrity

Specifies a list of declarative referential integrity constraints allowed for delete. The list can contain any or all of the following values, which control the availability of the relevant radio buttons on the Integrity tab of reference property sheets:

  • RESTRICT

  • CASCADE

  • SET NULL

  • SET DEFAULT

DclUpdIntegrity

Specifies a list of declarative referential integrity constraints allowed for update. The list can contain any or all of the following values, which control the availability of the relevant radio buttons on the Integrity tab of reference property sheets:

  • RESTRICT

  • CASCADE

  • SET NULL

  • SET DEFAULT

DefineJoin

Specifies a statement to define a join for a reference. This is another way of defining the contents of the create reference statement, and corresponds to the %JOINS% variable.

Usually the create script for a reference uses the %CKEYCOLUMNS% and %PKEYCOLUMNS% variables, which contain the lists of child and parent columns separated by commas.

If you use %JOINS%, you can refer to each paired parent and child columns separately. A loop is executed on Join for each paired parent and child columns, allowing to have a syntax mix of PK and FK.

Example (Access 2000):

P=%PK% F=%FK%

EnableChange JoinOrder

Specifies whether, when a reference is linked to a key as shown in the Joins tab of reference properties, the auto arrange join order check box and features are available. The following settings are available:

  • Yes - The join order can be established automatically, using the Auto arrange join order check box. Selecting this check box sorts the list according to the key column order. Clearing this check box allows manual sorting of the join order with the move buttons.

  • No - The auto arrange join order property is unavailable.

EnableCluster

Specifies whether clustered constraints are permitted on foreign keys.

  • Yes - Clustered constraints are permitted.

  • No - Clustered constraints are not permitted.

EnablefKey Name

Specifies the foreign key role allowed during database generation. The following settings are available:

  • Yes - The code of the reference is used as role for the foreign key.

  • No - The foreign key role is not allowed.

FKAutoIndex

Determines whether a Create Index statement is generated for every foreign key statement. The following settings are available:

  • Yes - Automatically generates a foreign key index with the foreign key statement. If you select the foreign key check box under create index when generating or modifying a database, the foreign key check box of the create table will automatically be cleared, and vice versa.

  • No – Foreign key indexes are not automatically generated. Foreign key and create index check boxes can be selected at the same time.

FKeyComment

Specifies a statement for adding an alternate key comment.

SqlListChildren Query

Specifies a SQL query used to list the joins in a reference.

Example (Oracle 10g):

{CKEYCOLUMN, FKEYCOLUMN}
[%ISODBCUSER%?select
 p.column_name, f.column_name
from sys.user_cons_columns f,
 sys.all_cons_columns p
where f.position = p.position
  and f.table_name=%.q:TABLE%
[ and p.owner=%.q:POWNER%]
  and p.table_name=%.q:PARENT%
  and f.constraint_name=%.q:FKCONSTRAINT%
  and p.constraint_name=%.q:PKCONSTRAINT%
order by f.position
:select p.column_name, f.column_name
from sys.all_cons_columns f,
 sys.all_cons_columns p
where f.position = p.position
  and f.owner=%.q:SCHEMA%
  and f.table_name=%.q:TABLE%
[ and p.owner=%.q:POWNER%]
  and p.table_name=%.q:PARENT%
  and f.constraint_name=%.q:FKCONSTRAINT%
  and p.constraint_name=%.q:PKCONSTRAINT%
order by f.position]

UseSpFornKey

Specifies the use of the Sp_foreignkey statement to generate a foreign key. The following settings are available:

  • Yes - The Sp_foreignkey statement is used to create references.

  • No - Foreign keys are generated separately in an alter table statement using the Create order of reference.

See also UseSpPrimKey (Pkey).