VistaDB 5






VistaDB.DDA Namespace > IVistaDBTable Interface : CreateForeignKey Method
The name of foreign key constraint. This name will be used by core engine in order to create new index on foreign key. The index name may be used to set active index. But this index cannot be deleted until constraint is set
The foreign key expression. It should match the order and type of primary key columns
The table containing primary key to refer by foreign key
The rule to follow in primary table update operation
The rule to follow in primary table delete operation
User's description of this constraint
CreateForeignKey Method
Create foreign key constraint that instantiates respective relationship in the database
Syntax
'Declaration
 
Sub CreateForeignKey( _
   ByVal constraintName As System.String, _
   ByVal foreignKey As System.String, _
   ByVal primaryTable As System.String, _
   ByVal updateIntegrity As VistaDBReferentialIntegrity, _
   ByVal deleteIntegrity As VistaDBReferentialIntegrity, _
   ByVal description As System.String _
) 
'Usage
 
Dim instance As IVistaDBTable
Dim constraintName As System.String
Dim foreignKey As System.String
Dim primaryTable As System.String
Dim updateIntegrity As VistaDBReferentialIntegrity
Dim deleteIntegrity As VistaDBReferentialIntegrity
Dim description As System.String
 
instance.CreateForeignKey(constraintName, foreignKey, primaryTable, updateIntegrity, deleteIntegrity, description)
void CreateForeignKey( 
   System.string constraintName,
   System.string foreignKey,
   System.string primaryTable,
   VistaDBReferentialIntegrity updateIntegrity,
   VistaDBReferentialIntegrity deleteIntegrity,
   System.string description
)
procedure CreateForeignKey( 
    constraintName: System.String;
    foreignKey: System.String;
    primaryTable: System.String;
    updateIntegrity: VistaDBReferentialIntegrity;
    deleteIntegrity: VistaDBReferentialIntegrity;
    description: System.String
); 
function CreateForeignKey( 
   constraintName : System.String,
   foreignKey : System.String,
   primaryTable : System.String,
   updateIntegrity : VistaDBReferentialIntegrity,
   deleteIntegrity : VistaDBReferentialIntegrity,
   description : System.String
);
void CreateForeignKey( 
   System.string* constraintName,
   System.string* foreignKey,
   System.string* primaryTable,
   VistaDBReferentialIntegrity updateIntegrity,
   VistaDBReferentialIntegrity deleteIntegrity,
   System.string* description
) 
void CreateForeignKey( 
   System.String^ constraintName,
   System.String^ foreignKey,
   System.String^ primaryTable,
   VistaDBReferentialIntegrity updateIntegrity,
   VistaDBReferentialIntegrity deleteIntegrity,
   System.String^ description
) 

Parameters

constraintName
The name of foreign key constraint. This name will be used by core engine in order to create new index on foreign key. The index name may be used to set active index. But this index cannot be deleted until constraint is set
foreignKey
The foreign key expression. It should match the order and type of primary key columns
primaryTable
The table containing primary key to refer by foreign key
updateIntegrity
The rule to follow in primary table update operation
deleteIntegrity
The rule to follow in primary table delete operation
description
User's description of this constraint
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also