Skip to Content
Advanced Oracle PL/SQL Programming with Packages
book

Advanced Oracle PL/SQL Programming with Packages

by Steven Feuerstein
October 1996
Intermediate to advanced
687 pages
16h 41m
English
O'Reilly Media, Inc.
Content preview from Advanced Oracle PL/SQL Programming with Packages

12.5. Managing the Target Repository

After reading about how to manage the source repository, you will probably be relieved to find that there is much less complexity involved in working with the target repository. Since the target is on the receiving end, there is no need to fiddle with the WHERE clause. You simply set and initialize the target, and then you are ready to write into that repository.

The settrg procedure defines the type of repository and its structure. The header for settrg is:

PROCEDURE settrg
   (trgtype_in IN VARCHAR2,
    name_in IN VARCHAR2 := 'PLV_source',
    target_name_col_in IN VARCHAR2 := 'name',
    trgtype_col_in IN VARCHAR2 := 'type',
    target_line#_col_in IN VARCHAR2 := 'line',
    target_text_col_in IN VARCHAR2 := 'text');

The first argument, trgtype_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 is explained below. The third through sixth arguments provide the names of the columns required for a database table target. The default values match the structure of the default table (PLV_source).

The settrg procedure transfers the arguments to the trgrep record, which is defined using the repos_rectype shown earlier. If you are using a database target, then the INSERT statement that will be used to write lines to that table is constructed as follows:

trgrep.insert_sql := 'INSERT INTO ' || trgrep.name || '( ' || target_name_col_in || ', ' || trgtype_col_in || ', ' || ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 12c PL/SQL Programming

Oracle Database 12c PL/SQL Programming

Michael McLaughlin
Oracle PL/SQL for DBAs

Oracle PL/SQL for DBAs

Arup Nanda, Steven Feuerstein
Expert PL/SQL Practices for Oracle Developers and DBAs

Expert PL/SQL Practices for Oracle Developers and DBAs

John Beresniewicz, Adrian Billington, Martin Büchi, Melanie Caffrey, Ron Crisco, Lewis Cunningham, Dominic Delmolino, Sue Harper, Torben Holm, Connor McDonald, Arup Nanda, Stephan Petit, Michael Rosenblum, Robyn Sands, Riyaj Shamsudeen

Publisher Resources

ISBN: 1565922387Supplemental ContentCatalog PageErrata