ttCacheSqlGet

This procedure generates the Oracle SQL statements to install or uninstall Oracle database objects.

This procedure generates statements for:

  • Read-only cache groups

  • User managed cache groups with incremental autorefresh

  • Asynchronous writethrough (AWT) cache groups

This is useful when the user creating the cache group does not have adequate privilege to write on the Oracle database. The Oracle DBA can then use the script generated by this built-in procedure to create the Oracle database objects.

Required Privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in both TimesTen Classic and TimesTen Scaleout.

Related Views

This procedure has no related views.

Syntax

ttCacheSqlGet('feature_name', 'cache_group_name', install_flag)

Parameters

ttCacheSqlGet has these parameters:

Parameter Type Description

feature_name

TT_VARCHAR (100)

Can be specified as INCREMENTAL_AUTOREFRESH or ASYNCHRONOUS_WRITETHROUGH.

cache_group_name

TT_VARCHAR (100)

The name of the cache group. Specify NULL when installing objects for asynchronous writethrough cache groups or to uninstall all Oracle database objects in the autorefresh user's account.

install_flag

TT_INTEGER NOT NULL

If install_flag is 1, ttCacheSqlGet returns Oracle SQL to install the autorefresh or asynchronous writethrough Oracle database objects.

If install_flag is 0, ttCacheSqlGet returns SQL to uninstall the previously created objects.

Result Set

ttCacheSqlGet returns the result set:

Column Type Description

retval

TT_VARCHAR (4096) NOT NULL

The Oracle SQL statement to uninstall or install autorefresh or asynchronous writethrough Oracle database objects.

continueFlag

TT_SMALLINT NOT NULL

nonzero only if the Oracle SQL statement in the retval result column exceeds 4096 bytes and must be continued into the next result row.

Examples

CALL ttCacheSqlGet('INCREMENTAL_AUTOREFRESH', 'westernCustomers', 1);

To remove all Oracle database objects in the autorefresh user's account, use:

CALL ttCacheSqlGet('INCREMENTAL_AUTOREFRESH', NULL, 0);

Notes

  • This procedure is available only for cache operations.

  • Each returned retval field contains a separate Oracle SQL statement that may be directly executed on the Oracle database. A row may end in the middle of a statement, as indicated by the continueFlag field. In this case, the statement must be concatenated with the previous row to produce a usable SQL statement.

  • The script output of this procedure is not compatible with Oracle's SQL*Plus utility. However, you can use the ttIsql cachesqlget command to generate a script that is compatible with the SQL*Plus utility.

  • You can specify NULL for the cache_group_name option to generate Oracle SQL to clean up Oracle database objects after a database has been destroyed by the ttDestroy utility.