Functions to Set the Property Value - Teradata Meta Data Services

Teradata Meta Data Services Programmer Guide

Teradata Meta Data Services
Release Number
English (United States)
Last Update
Product Category
Teradata Tools and Utilities

Functions to Set the Property Value

HRESULT SetBinary(void* val, const int sz);
HRESULT SetBinary(unsigned long val);
HRESULT SetBinaryString(const void *val, const int sz);

If the data is hex data as follows:

unsigned char b[] = { 0x00, 0x00, 0x0c, 0x04} 									

use the SetBinary function.

If the data is string hex data, such as is created with the sprintf function

sprintf(Buf , "%08lX", DatabaseId);

that for the decimal value 3076, hex value C04 will write the hex string “3030303030633034”in the buffer, you must use the SetBinaryString function.

void SetBool(const short val);
void SetChar(const char val);

A char represents a signed binary integer value in the range –128 to 127.

void SetDate(const double val);

SetDate stores the date value using the DATE data type. DATE is represented as an 8-byte floating-point number. Days are represented by whole number increments starting with 30 December 1899, midnight as time zero. Hour values are expressed as the absolute value of the fractional part of the number. The following table illustrates this.


Date and time


30 December 1899, midnight


1 January 1950, midnight


4 January 2000, midnight


4 January 2000, 6 A.M.


4 January 2000, noon


4 January 2000, 9 P.M.


void SetDbl(const double val)     // same as SetDouble
void SetDouble(const double val)  // same as SetDbl
void SetFloat(const float val)
void SetInt(const long val)       // same as SetLong
void SetLong(const long val)      // same as SetInt
void SetShort(const short val)
void SetString(LPCTSTR val);

Passing in a NULL pointer to SetString is equivalent to setting the property value to NULL.

void SetStringLiteral(LPCTSTR val);

MDS will write the string exactly as specified. For strings set with the SetString function, MDS will add single quotes around the value when creating the SQL to issue to Teradata to write the value to the MDS repository. For strings set with the SetStringLiteral function, MDS will not add the single quotes. Therefore when using SetStringLiteral, val must contain a single quoted string or a Teradata built in function name. The supported functions are:

  • DATE
  • The SetStringLiteral function enables specification of Teradata literals or case sensitivity characters. For example:

  • TIME ‘15:30’
  • DATE ‘1998-06-01’
  • ‘XmL’ (CS)
  • ‘XmL’ (NOT CS)
  • ‘1A1F’XC
  • void SetUChar(const unsigned char val);

    The char type is used to store the integer value of a member of the character set. That integer value is the ASCII code corresponding to the specified character. Character values of type unsigned char have a range from 0 to 0xFF hexadecimal or 0 to 255 decimal.

    HRESULT SetValue(VARIANT value); 

    SetValue accepts a Windows VARIANT structure and sets the CMetaProperty value and type according to those in the VARIANT. This function is used to support the CMetaCOM APIs and will only be available on Windows platforms. Only the following VARIANT types are supported:

  • VT_I2
  • VT_I4
  • VT_R8
  • VT_UI1
  • Any other VARIANT type will cause SetValue to return the META_E_UNSUPPORTED_VARIANT_TYPE error code.

    Set NULL Functions

    The following functions set the variant type according to the Set method called and set the property value to NULL. The data value written to the repository for this property will be the database NULL value.

    void SetNull(); // can be used for all data types
    void SetBinaryNull();
    void SetBoolNull();
    void SetCharNull();
    void SetDateNull();
    void SetDblNull();     // same as SetDoubleNull
    void SetDoubleNull();  // same as setDblNull
    void SetFloatNull();
    void SetIntNull();     // same as SetLongNull
    void SetLongNull();    // same as SetIntNull
    void SetShortNull();
    void SetStringNull();
    void SetUCharNull();