# EssOtlDeleteDTSMemberAlias

Description

EssOtlDeleteDTSMemberAlias() deletes an alias name for a Dynamic Time Series (DTS) member.

Syntax

    ESS_STS_T EssOtlDeleteDTSMemberAlias (hOutline, pszDTSMember, pszAliasTable);

ESS_HOUTLINE_T | hOutline
ESS_STR_T | pszDTSMember
ESS_STR_T | pzsAliasTable

Parameters

hOutline | The Essbase outline handle returned from the EssOtlOpenOutline() call.
pszDTSMember | Name of the DTS member which provides the alias.
pzsAliasTable | Name of the alias table which provides the alias. If NULL, use the default alias table.

Return Value

If successful the return value is zero. Otherwise, one of the following is returned:

OTLAPI_ERR_DTSMBRNOTDEFINED
OTLAPI_BAD_ALIASTABLE
OTLAPI_ERR_NOALIAS

Example

    #include "essapi.h"
    #include "essotl.h"
    #include "esserror.h"

    ESS_STS_T ESS_OtlDeleteDTSMemberAlias(ESS_HCTX_T hCtx)
    {
    	ESS_STS_T 		sts =ESS_STS_NOERR;
    	ESS_OBJDEF_T	Object;
    	ESS_HOUTLINE_T	hOutline;
    	ESS_APPNAME_T	szAppName;
    	ESS_DBNAME_T	szDbName;
    	ESS_OBJNAME_T	szFileName;
    	ESS_CHAR_T	pszAliasTable[ESS_ALIASNAMELEN];
    	ESS_CHAR_T	pszDTSMember[ESS_MBRNAMELEN];
    	ESS_PROCSTATE_T	pState;
    	ESS_ULONG_T	ulErrors;
    	ESS_ULONG_T	ulCount;
    	ESS_POUTERROR_T	pMbrErrors = NULL;

    	strcpy(szAppName, "sample");
    	strcpy(szDbName, "Basic");
    	strcpy(szFileName, "Basic");
    	strcpy(pszDTSMember, "Q-T-D");
    	strcpy(pszAliasTable, "Default");

    	Object.hCtx = hCtx;
    	Object.ObjType = ESS_OBJTYPE_OUTLINE;
    	Object.AppName = szAppName;
    	Object.DbName = szDbName;
    	Object.FileName = szFileName;

    	sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE, ESS_TRUE, &hOutline);

    	if(sts)
    	{
    		printf("Could not open outline\n");
    		return sts;
    	}

    	sts = EssOtlDeleteDTSMemberAlias(hOutline, pszDTSMember, pszAliasTable);
    	if(sts)
    	{
    		printf("Could not get DTS member alias\n");
    		return sts;
    	}

    	sts = EssOtlWriteOutline(hOutline, &Object);
    	if(sts)
    	{
    		printf("Could not write outline\n");
    		return sts;
    	}

    	sts = EssOtlRestructure(hCtx, ESS_DOR_ALLDATA);
    	if(sts)
    	{
    		printf("Could not restructure outline\n");
    		return sts;
    	}

    	memset (&pState, 0, sizeof(ESS_PROCSTATE_T));
    	sts = EssGetProcessState(hCtx, &pState);
    	{
    		while ((sts == ESS_STS_NOERR ) && (pState.State != ESS_STATE_DONE))
    		{
    			memset (&pState, 0, sizeof(ESS_PROCSTATE_T));
    			sts = EssGetProcessState(hCtx, &pState);
    		}
    	}

    	sts = EssUnlockObject(hCtx, ESS_OBJTYPE_OUTLINE, szAppName, szDbName, szFileName);
    	if (sts)
    	{
    		printf("Could not unlock outline\n");
    		return sts;
    	}

    	EssOtlCloseOutline(hOutline);
    	return sts;
    }

See Also

EssOtlEnableDTSMember
EssOtlGetEnabledDTSMembers
EssOtlGetDTSMemberAlias
EssOtlSetDTSMemberAlias