# EssOtlDeleteMember

Description

EssOtlDeleteMember() deletes a member from the outline.

Syntax

    ESS_FUNC_M EssOtlDeleteMember (hOutline, hMember);

ESS_HOUTLINE_T | hOutline
ESS_HMEMBER_T | hMember

Parameters

hOutline | Outline context handle.
hMember | Handle of member to delete.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_ERR_LEAFLABEL
OTLAPI_ERR_NOTIMEDIM

Notes

- All descendants of the member are deleted.
- All shared members of this member and its descendants are deleted.
- If a shared member, only the specified member is deleted.
- To delete a dimension, you can use this call or EssOtlDeleteDimension(). EssOtlDeleteDimension() gives you the benefit of selecting a member of the deleted dimension whose data values will be used as the data values for the other dimensions when the database is restructured. If EssOtlDeleteMember() is used, the data values of the top member (dimension) of the deleted dimension are used.

Example

    #include <essapi.h>
    #include <essotl.h>

    ESS_STS_T          sts = 0;
    ESS_OBJDEF_T       Object;
    ESS_HOUTLINE_T     hOutline;
    ESS_HMEMBER_T      hCOGS;
    ESS_APPNAME_T      szAppName;
    ESS_DBNAME_T       szDbName;
    ESS_OBJNAME_T      szFileName;

    memset(&Object, '\0', sizeof(Object));
    Object.hCtx = hCtx;
    Object.ObjType = ESS_OBJTYPE_OUTLINE;
    strcpy(szAppName, "Sample");
    strcpy(szDbName, "Basic");
    strcpy(szFileName, "Basic");
    Object.AppName = szAppName;
    Object.DbName = szDbName;
    Object.FileName = szFileName;

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

    if (!sts)
    {
       sts = EssOtlFindMember(hOutline, "COGS", &hCOGS);
    }

    if (!sts && hCOGS)
    {
       sts = EssOtlDeleteMember(hOutline, hCOGS);
    }

See Also

EssOtlDeleteDimension()
EssOtlAddMember()
EssOtlAddDimension()
EssOtlFindMember()
EssOtlGetMemberInfo()