Siebel Analytics Server Administration Guide > Query Caching in Siebel Analytics Server >

Purging Cache Programmatically


The Analytics Server provides ODBC-extension functions for purging cache entries programmatically. Scripts that call these ODBC-extension functions must run under an administrator logon ID. Only administrators have the right to purge cache. The following ODBC functions affect cache entries associated with the repository specified by the ODBC connection:

  • SAPurgeCacheByQuery. Purges a cache entry that exactly matches a specified query. For example, using the following query, you would have a query cache entry that retrieves the names of all employees earning more than $100,000:

    select lastname, firstname from employee where salary > 100000;

    The following call programmatically purges the cache entry associated with this query:

    Call SAPurgeCacheByQuery('select lastname, firstname from employee where salary > 100000' );

  • SAPurgeCacheByTable. Purges all cache entries associated with a specified physical table name (fully qualified) for the repository to which the client has connected. This function takes up to four parameters representing the four components (database, catalog, schema and table name proper) of a fully qualified physical table name. For example, you might have a table with the fully qualified name of DBName.CatName.SchName.TabName. To purge the cache entries associated with this table in the physical layer of the Siebel Analytics repository, execute the following call in a script:

    Call SAPurgeCacheByTable( 'DBName', 'CatName', 'SchName', 'TabName' );

    • Nulls passed as input parameters to SAPurgeCacheByTable serve as wild cards. For example, specifying a database name but leaving the catalog, schema and table names null will direct the function to purge all entries associated with the specified database.
    • Similarly, specifying a table name but leaving database, catalog and schema names null directs the function to purge all cache entries associated with the specified table name. If multiple databases, catalogs or schemas have tables with the specified name, the function will purge all cache entries associated with any of those tables.

      CAUTION:  Leaving all input parameters null directs the function to purge all cache entries associated with the repository.

  • SAPurgeAllCache. Purges all cache entries. The following is an example of this call:

    Call SAPurgeAllCache();

Siebel Analytics Server Administration Guide