CreateMDSRelationshipDesc - Teradata Meta Data Services

Teradata Meta Data Services Programmer Guide

Product
Teradata Meta Data Services
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
Product Category
Teradata Tools and Utilities

CreateMDSRelationshipDesc

Purpose

The CMetaAIM CreateMDSRelationshipDesc function creates a new relationship description between two classes.

Description

Relationships can be between two classes either within one AIM, or across different AIMs. The origin class and the destination class can be the same class.

The default OwnerID is the logged in user.

Note: A class description can be defined in multiple relationships, however, all relationships that have the same class ID as the origin or destination class must have unique names. Since all relationships within a metamodel must have unique names, this is only an issue if relationships with the same name were created in two different metamodels with the same class as an origin or destination class. The create of the second relationship will fail.

Requirements

Updates to an existing Relationship Description object are not permitted. Both lOriginClassOID and lDestClassOID are not a NULLLOID.

Both classes must have been previously defined to MDS before creating the relationship.

Syntax

HRESULT CreateMDSRelationshipDesc(
	CMetaRelationshipDesc *&pRelObj,
	LPCTSTR strRelName,
	LPCTSTR strRelDesc,
	const OBJECTID_t lOriginClassOID,
	const OBJECTID_t lDestClassOID,
	const short sUniqueNamesFlag,
	const short sPropagateDeleteFlag,
	const GUID& gGUID,
	const OBJECTID_t lOwnerID = 0,
	const OBJECTID_t SecurityProfileID = 0);
 

Argument

In/Out

Description

pRelObj

Out

If pRelObj is a pointer to NULL, the object is created by the API. The calling application is responsible for freeing the object.

Name

In

Name of the relationship.

Desc

In

Relationship description.

OriginClassOID

In

Internal Object ID Origin class description.

DestClassOID

In

Internal Object ID of Destination class description.

UniqueNamesFlag

In

Enforce unique names in destination collections.

PropagateDeleteFlag

In

Set the Propagate Delete flag on in the relationship. Specify MD_PROPDEL to specify delete propagation, MD_NULL to not set the flag.

GUID

In

Global unique identifier to assign to this relationship. Set to NULLGUID to have MDS generate the GUID for the Relationship Description.

OwnerID

In
(Optional)

OwnerID of this object.

SecurityProfileID

In
(Optional)

Security Profile assigned to the object.