DBA Data[Home] [Help]

PACKAGE: SYS.DBMS_EDITIONS_UTILITIES

Source


1 PACKAGE dbms_editions_utilities AUTHID CURRENT_USER AS
2 ---------------------------------------------------------------------
3 -- Overview
4 -- This pkg implements the Edition API, which provides helper function
5 -- for edition related operations
6 ---------------------------------------------------------------------
7 -- SECURITY
8 -- This package is owned by SYS with execute access granted to PUBLIC.
9 -- It runs with invokers rights, i.e., with the security profile of
10 -- the caller.
11 --------------------
12 
13 -- EXCEPTION
14   insuf_priv exception;
15   pragma exception_init(insuf_priv, -38817);
16 
17   missing_tab exception;
18   pragma exception_init(missing_tab, -942);
19 
20   invalid_edition exception;
21   pragma exception_init(invalid_edition, -38802);
22 
23   -- The relationship between any two editions can be determined by the
24   -- following return values
25   IDENTICAL  constant integer := 0;
26   ANCESTOR   constant integer := 1;
27   DESCENDENT constant integer := 2;
28   UNRELATED  constant integer := 3;
29 -- PUBLIC FUNCTION
30 
31   /* Given the table name, set the all the Editioning views in all editions
32      to read-only or read write.
33 
34      NOTE:
35        User must have the following privileges:
36          1. owner of the table or has ALTER ANY TABLE system privileges
37          2. "USE" object privilege on all the editions which the views are
38             definied.
39 
40      PARAMETERS:
41        table_name - the base table of the editioning views
42        owner      - the base table schema. The default (or null) is the current
43                     schema.
44        read_only  - true if set the views to read-only; false (or null) will
45                     set the views to read/write. Default is true.
46 
47      EXCEPTIONS:
48        INSUF_PRIV exception will be raised if the user doesn't have the above
49        privileges.
50   */
51   PROCEDURE set_editioning_views_read_only(
52                  table_name IN VARCHAR2,
53                  owner      IN VARCHAR2 DEFAULT NULL,
54                  read_only  IN BOOLEAN  DEFAULT TRUE);
55 
56   /*
57     Procedure: Set_Null_Column_Values_To_Expr
58 
59     Replaces null values in a replacement column with the value of an
60     expression. The expression evaluation cost is deferred to future updates
61     and queries.
62 
63     Parameters:
64 
65       table_name - A potentially schema-qualified table name.
66       column_name - The name of the column to be updated.
67       expression - An expression composed of columns in the same table,
68                    constants, and SQL functions.
69    */
70   PROCEDURE Set_Null_Column_Values_To_Expr(table_name IN VARCHAR2,
71                                            column_name IN VARCHAR2,
72                                            expression IN VARCHAR2);
73 
74   /*
75     Function: compare_edition
76 
77     Compare the two given editions to determine their parent/child relation.
78 
79     Parameters:
80 
81       ed1objn - The object number of the first edition to be compared.
82       ed2objn - The object number of the second edition to be compared.
83 
84     Returns:
85 
86       The relationship between the editions.
87         IDENTICAL  if the editions are the same.
88         ANCESTOR   if the first edition is an ancestor of the second edition.
89         DESCENDENT if the first edition is a descendant of the second edition.
90         UNRELATED  if the editions are not related.
91 
92      EXCEPTIONS:
93        INVALID_EDITION exception will be raised if either ed1objn or ed2objn
94        is an invalid edition object number.
95    */
96   FUNCTION compare_edition(ed1objn IN INTEGER, ed2objn IN INTEGER)
97     RETURN INTEGER;
98 END dbms_editions_utilities;