SAVE_VIEWS procedure

Saves the authorizations and definitions of all views in the specified schema for later restoration with RESTORE_VIEWS procedure.

Prototypes

SAVE_VIEWS(ASCHEMA VARCHAR(128))
SAVE_VIEWS()

Description

SAVE_VIEWS is a utility procedure which saves the definition of all views in the specified schema to SAVED_VIEWS. These saved definitions can then be restored with the RESTORE_VIEWS procedure procedure. SAVE_VIEWS also implicitly calls SAVE_AUTH procedure to preserve the authorizations of the views. This is in contrast to inoperative views recreated with RECREATE_VIEW procedure which lose authorization information.

Note

This procedure is effectively redundant as of DB2 9.7 due to the new deferred revalidation functionality introduced in that version.

Parameters

ASCHEMA
If provided, the schema containing the views to save. If omitted, this parameter defaults to the value of the CURRENT SCHEMA special register.

Examples

Save the definition of all views in the FINANCE schema:

CALL SAVE_VIEWS('FINANCE');

Save the definition of all views in the current schema:

CALL SAVE_VIEWS;