12.8. Saving and Restoring Settings

The PLVio package is used by many PL/Vision packages and now you can use it as well. Code reusability is a wonderful thing, but it can get awfully dicey if one program's use of PLVio steps on another program's reliance on settings and data from PLVio. To help avoid such conflicts, PLVio can automatically save and restore its settings for the source and target repositories.

You get to decide when and if saves and restores should take place. To turn on saves/restores for the source repository, call the savesrc procedure (the default is to perform save/restores automatically). You can disable save/restore on source by calling the nosavesrc procedure. Finally, you can determine the current status of save/restore on source by displaying the value returned by the saving_src function. The headers for these programs are shown below:

PROCEDURE savesrc;
PROCEDURE nosavesrc;
FUNCTION saving_src RETURN BOOLEAN;

To turn on saves/restores for the target repository, call the savetrg procedure (the default is to perform save/restores automatically). You can disable save/restore on the target by calling the nosavetrg procedure. Finally, you can determine the current status of save/restore on target by displaying the value returned by the saving_trg function. The headers for these programs are shown below:

PROCEDURE savetrg;
PROCEDURE nosavetrg;
FUNCTION saving_trg RETURN BOOLEAN;

The save/restore facility does not maintain a stack of settings. If you save ...

Get Advanced Oracle PL/SQL Programming with Packages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.