O'Reilly logo

Advanced Oracle PL/SQL Programming with Packages by Steven Feuerstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.3. Managing the Source Repository

To read information from a PLVio repository, you must do the following:

  1. Define the source using the setsrc program.

  2. Fine-tune your access to the source repository. You can modify the WHERE clause of your SELECT from a database table source with a number of procedures.

  3. Initialize the source using the initsrc program.

You are then ready to use the get_line procedure to retrieve lines of text from the source repository.

This section explains the setsrc and initsrc procedures. The next section explores how to modify the WHERE clause of the source SELECT for database tables.

12.3.1. Setting the Source

The setsrc procedure assigns the type of source repository and defines the structure of the source (if a database table). The header for setsrc is as follows:

PROCEDURE setsrc
   (srctype_in IN VARCHAR2,  
    name_in IN VARCHAR2 := 'user_source',
    name_col_in IN VARCHAR2 := 'name',
    srctype_col_in IN VARCHAR2 := 'type',
    line#_col_in IN VARCHAR2 := 'line',
    text_col_in IN VARCHAR2 := 'text',
    schema_col_in IN VARCHAR2 := NULL);

The first argument, srctype_in, is the type of repository. The second argument, name_in, is the name of the repository. Its content varies according to the type of repository and will be explained below. The third through seventh arguments provide the names of the columns required for a database table source. The default values match the structure of the default table (the USER_SOURCE data dictionary view). Notice, therefore, that the schema ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required