EssGetFilter

Starts getting the contents of a filter.

Syntax

ESS_FUNC_M EssGetFilter (hCtx, AppName, DbName, FilterName, pActive, pAccess);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

AppName

ESS_STR_T

Application name.

DbName

ESS_STR_T

Database name.

FilterName

ESS_STR_T

Filter name.

pActive

ESS_PBOOL_T

Address of variable to receive filter active flag. If TRUE, the filter is currently in effect for the specified database.

pAccess

ESS_PACCESS_T

Address of variable to receive the default filter access level. For possible values, see Bitmask Data Types (C).

Notes

This call must be followed by successive calls to EssGetFilterRow() to fetch the rows for the filter.

Return Value

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

Access

This function requires the caller to have database designer 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