# EssOtlEnableDTSMember

Description

EssOtlEnableDTSMember enables a new DTS member for the outline.

Syntax

    ESS_FUNC_M EssOtlEnableDTSMember (hOutline, pszDTSMember,
    usGen, bEnable);

ESS_HOUTLINE_T | hOutline;
ESS_STR_T | pszDTSMember;
ESS_USHORT _T | usGen;
ESS_BOOL_T | bEnable;

Parameters

hOutline | The Essbase outline handle returned from the EssOtlOpenOutline() call.
pszDTSMember | Name of the DTS member
usGen | Generation to assign to the DTS member
bEnable | Flag to enable the DTS member

Return Value

Returns zero if successful.

Notes

- This function also fills in the ESS_DTSMBRNAME_T structure passed to it.

Example

    #include "essapi.h"
    #include "essotl.h"
    #include "esserror.h"
    ESS_STS_T ESS_OtlEnableDTSMember(ESS_HCTX_T hCtx, ESS_HINST_T hInst)
    {
    	ESS_STS_T	sts =ESS_STS_NOERR;
    	ESS_HOUTLINE_T	hOutline;
    	ESS_OBJDEF_T	Object;
    	ESS_APPNAME_T	szAppName;
    	ESS_DBNAME_T	szDbName;
    	ESS_OBJNAME_T	szFileName;
    	ESS_PROCSTATE_T	pState;
    	ESS_ULONG_T	ulErrors;
    	ESS_ULONG_T	ulCount;
    	ESS_POUTERROR_T	pMbrErrors = NULL;

    	strcpy(szAppName, "1Sample");
    	strcpy(szDbName, "Basic");
    	strcpy(szFileName, "Basic");

    	memset(&Object, '\0', sizeof(ESS_OBJDEF_T));
    	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 = EssOtlEnableDTSMember(hOutline, "H-T-D", 1, ESS_TRUE);
    	if(sts)
    	{
    		printf("Could not enable DTS member alias\n");
    	}

    	sts = EssOtlVerifyOutline(hOutline, &ulErrors, &ulCount, &pMbrErrors);
    	if(sts)
    	{
    		printf("Could not verify outline\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);
    	{
    		printf("sts from Proc State is %d and ProcState is %d\n", sts, pState.State);
    		while ((sts == ESS_STS_NOERR) && (pState.State != ESS_STATE_DONE))
    		{
    			memset (&pState, 0, sizeof(ESS_PROCSTATE_T));
    			sts = EssGetProcessState(hCtx, &pState);
    		printf("sts from Proc State is %d and ProcState is %d\n", sts, pState.State);
    		}
    	}

    	EssUnlockObject(hCtx, Object.ObjType, Object.AppName, Object.DbName, Object.FileName);
    	EssOtlCloseOutline(hOutline);
    	return sts;
    }

See Also

EssOtlDeleteDTSMemberAlias
EssOtlGetEnabledDTSMembers
EssOtlGetDTSMemberAlias
EssOtlSetDTSMemberAlias