# EssCopyFilter

Description

EssCopyFilter() copies an existing filter.

Syntax

    ESS_FUNC_M EssCopyFilter (hCtx, hSrcCtx, SrcApp, DestApp, SrcDb, DestDb, SrcName, DestName);

ESS_HCTX_T | hCtx
ESS_HCTX_T | hSrcCtx
ESS_STR_T | SrcApp
ESS_STR_T | DestApp
ESS_STR_T | SrcDb
ESS_STR_T | DestDb
ESS_STR_T | SrcName
ESS_STR_T | DestName

Parameters

hCtx | Essbase API context handle.
hSrcCtx | Not used - should be same as hCtx.
SrcApp | Source application name.
DestApp | Destination application name.
SrcDb | Source databasename.
DestDb | Destination databasename.
SrcName | Source name of existing filter to be copied.
DestName | Destination name of copied filter.

Return Value

None.

Notes

- The source filter must already exist.
- To prevent overwriting an existing filter by mistake, the caller should check whether the destination filter already exists.

Access

This function requires the caller to have database Design privilege (ESS_PRIV_DBDESIGN) for the specified database.

Example

    ESS_FUNC_M
    ESS_CopyFilter (ESS_HCTX_T  hCtx)
    {
       ESS_FUNC_M        sts = ESS_STS_NOERR;
       ESS_HCTX_T        hSrcCtx;
       ESS_STR_T         SrcApp;
       ESS_STR_T         DestApp;
       ESS_STR_T         SrcDb;
       ESS_STR_T         DestDb;
       ESS_STR_T         SrcName;
       ESS_STR_T         DestName;

       hSrcCtx   = hCtx;
       SrcApp    = "Sample";
       SrcDb     = "Basic";
       SrcName   = "OldFilter";
       DestApp   = "Sample";
       DestDb    = "Basic";
       DestName  = "NewFilter";

       sts = EssCopyFilter(hCtx, hSrcCtx, SrcApp,
             DestApp, SrcDb, DestDb, SrcName, DestName);
       if(!sts)
          printf("The Filter is copied.\r\n");

       return (sts);
    }

See Also

EssDeleteFilter()
EssListFilters()
EssRenameFilter()