SAVE_VIEW procedure

Saves the authorizations and definition of the specified view for later restoration with RESTORE_VIEW procedure.

Prototypes

SAVE_VIEW(ASCHEMA VARCHAR(128), AVIEW VARCHAR(128))
SAVE_VIEW(AVIEW VARCHAR(128))

Description

SAVE_VIEW is a utility procedure which saves the definition of the specified view to SAVED_VIEWS. This saved definition can then be restored with the RESTORE_VIEW procedure procedure. SAVE_VIEW and RESTORE_VIEW also implicitly call SAVE_AUTH procedure and RESTORE_AUTH procedure to preserve the authorizations of the view. 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 view to save. If omitted, this parameter defaults to the value of the CURRENT SCHEMA special register.
AVIEW
The name of the view to save.

Examples

Save the definition of the FINANCE.LEDGER_CHANGES view:

CALL SAVE_VIEW('FINANCE', 'LEDGER_CHANGES');

Save the definition of the EMPLOYEE_CHANGES view in the current schema:

CALL SAVE_VIEW('EMPLOYEE_CHANGES');