GetDestCollection - 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

GetDestCollection

Purpose

The CMetaObject class GetDestCollection function returns the collection of objects of the destination class associated with this CMetaObject for the specified relationship.

Description

If a strObjName in the collection is not specified (NULL), then all objects in the collection are returned.

If strObjName is specified, only the objects of the specified name in the collection are returned. The name search is not case sensitive.

Specifying an empty string (“”) for strObjName returns only objects in the collection with no name.

GetDestCollection only returns the current versions of objects referenced by the current version of this CMetaObject.

The relationship ID is specified by the GUID relationship ID or the internal relationship ID (one must be set).

For the GetDestCollection function, CMetaObject must be set with the ObjectID of an object in the origin class of the relationship.

If the destination class of the relationship is a superclass, this function will only return objects in the destination class. To return objects in the subclasses, use the GetDestCollection3 function.

Requirements

The internal object id must be set in the object and it must be for a version of the object.

The objects in the list returned by GetDestCollection are not in any order. Use GetDestCollectionByProperty to specify properties to sort the list by.

Syntax

HRESULT GetDestCollection(
vector<CMetaObject> &objectList, 
const GUID &gRelID, 
const OBJECTID_t lRelID = NULLLOID, 
LPCTSTR strObjName = NULL);
 
HRESULT GetDestCollection(
vector<CMetaObject> &objectList, 
const GUID &gRelID, 
const OBJECTID_t lRelID, 
LPCTSTR strObjName,
const bool WithLock);
 

Argument

In/Out

Description

objectList

In/Out

Reference to the list of CMetaObjects that holds the collection returned. The list is cleared before adding the return collection.

gRelID

In

Relationship GUID.
Can be set to NULLGUID if lRelID is set.

lRelID

In
(Optional)

Relationship internal ID.
Optional, if gRelID is set.

strObjName

In
(Optional)

Specific name of the objects in the collection to be returned.

WithLock

In

WithLock=true keeps the Dest Collection table locked for WRITE. Use within an explicit transaction. Set WithLock to true when one of the Dest Collection objects will subsequently be updated within the transaction. Prevents deadlocks caused by Teradata promotional locks.