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

Initialize

Purpose

The CMetaRepository class Initialize function creates a connection to the MDS repository database.

Description

The connection remains until the Deinitialize function is called or the process or thread is terminated. Applications should always call the Deinitialize function before terminating to ensure that the database connection is terminated properly.

Note: For multi-threaded application, each thread must call Initialize (or SignOn) and each thread will have a separate connection to the MDS repository database.

Requirements

Initialize must be called before any other MDS APIs.

Syntax

HRESULT Initialize (LPCTSTR User, 
   LPCTSTR Password, 
   HENV henv = SQL_NULL_HENV);
 

Argument

In/Out

Description

User

In

User name. The user name determines access to objects in the repository. Users are created in the MetaManager utility.

Lookup of the user name is not case sensitive.

Password

In

Password for user.

Lookup of the password is case sensitive.

henv

In
(Optional)

ODBC HENV pointer. ODBC only permits one HENV pointer per process. If a client application is using ODBC separately from MDS, it should create the HENV pointer and pass it to MDS.

If henv is SQL_NULL_HENV on Initialize, MDS will create a HENV pointer. The CMetaRepository.GetOdbcHenv() function can be used to get the HENV pointer created by MDS.