EssGetFilter

Description

EssGetFilter() starts getting the contents of a filter.

Syntax
ESS_FUNC_M EssGetFilter (hCtx, AppName, DbName, FilterName, pActive, pAccess);
ESS_HCTX_ThCtx
ESS_STR_TAppName
ESS_STR_TDbName
ESS_STR_TFilterName
ESS_PBOOL_TpActive
ESS_PACCESS_TpAccess

Parameters

hCtxEssbase API context handle.
AppNameApplication name.
DbNameDatabase name.
FilterNameFilter name.
pActiveAddress of variable to receive filter active flag. If TRUE, the filter is currently in effect for the specified database.
pAccessAddress of variable to receive the default filter access level. For possible values, see Bitmask Data Types.

Return Value

If successful, returns the filter active flag in pActive, and the default filter access level in pAccess.

Notes

Access

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

Example

ESS_FUNC_M 
ESS_GetFilter (ESS_HCTX_T  hCtx, ESS_HINST_T hInst)
{
   ESS_FUNC_M       sts = ESS_STS_NOERR;
   ESS_STR_T       AppName;   
   ESS_STR_T       DbName;
   ESS_STR_T       FilterName;
   ESS_BOOL_T      Active;
   ESS_ACCESS_T    Access;
   ESS_STR_T       RowString = NULL;
   ESS_STR_T       Acc_Str;

   AppName    = "Sample";
   DbName     = "Basic";
   FilterName = "Test";
   
   /**************
    * Get Filter *
    **************/
   sts = EssGetFilter(hCtx, AppName, DbName,
         FilterName, &Active, &Access);
   /*******************
    * Get Filter Rows *
    *******************/
   if(!sts)
   {            
      sts = EssGetFilterRow(hCtx, &RowString,
            &Access);
      if(!sts && RowString)
      { 
         printf("%s Filter Rows\r\n",FilterName);
         while(RowString)
         {  
            switch (Access)
            {
               case ESS_ACCESS_NONE:
                  Acc_Str = "NONE";
                  break;
               case ESS_ACCESS_READ:
                  Acc_Str = "READ";
                  break;
               default:
                  Acc_Str = "WRITE";
                  break;
             }
                 
            printf("%s - %s\r\n",Acc_Str,RowString); 
            sts = EssGetFilterRow(hCtx, &RowString, 
                  &Access);
         } 
         EssFree(hInst, RowString);
      }  
   }     
   return (sts);        
}

See Also

EssGetFilterRow()
EssListFilters()
EssSetFilter()