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

FindAllOccurrences

Purpose

The CMetaObject class FindAllOccurrences function returns a list of version keys for the versions of the object that satisfy a search condition.

Description

The types of searches possible are: find a property value, find when a class contained a property, and find when a metamodel contained a class.

When a CMetaProperty object is used, two types of search are allowed:

  • If the object is for a class definition, it is determined if the class currently contains the property (ClassHasProperties). The property is specified by its name.
  • If the object is for a class data object, the versions of the object are searched to return those versions that contain the property value. When a character string value is provided, a substring search is performed; for all other types of property values, an equality search is made.
  • When a class name, class GUID, or class loid is given, the calling object is assumed to be a metamodel definition and it is determined if the class exists in the metamodel (AIMHasClasses).

    Requirements:

  • The object ID (internal or globally unique) must be set and it must be for one of the versions of an object.
  • If a CMetaProperty parameter is not used, a class ID (internal or globally unique) or a class name must be set.
  • If a CMetaProperty parameter is used, the property name must be set.
  • Syntax

    HRESULT FindAllOccurrences(
    vector<CMetaVersionedObjectKey>& returnKeys,
    CMetaProperty& prop,
    const TCHAR *strLabel = NULL);
     
    HRESULT FindAllOccurrences(
    vector<CMetaVersionedObjectKey>& returnKeys,
    const GUID& gClassID,
    const OBJECTID_t lClassID = NULLLOID,
    const TCHAR *className = NULL,
    const TCHAR *strLabel = NULL);
     

    Argument

    In/Out

    Description

    returnKeys

    In/Out

    Reference to the list of CMetaVersionedObjectKeys that will hold the collection returned. The list is cleared before adding the return collection.

    prop

    In

    Specifies a property to search for. The property name must be set.

    gClassID

    In

    Class GUID.

    IClassID

    In
    (Optional)

    Class internal ID.

    className

    In
    (Optional)

    Class name.

    strLabel

    In
    (Optional)

    Label string to filter the objects; only object versions with the label will be returned