1 package drvutl authid current_user as
2
3 /*------------------- Common Varchar2 Length Definitions ---------*/
4 /* pre-12.2 supported id len = 30 for 12.2 supported id len = 128 */
5 /* id = identifier qid = quoted id lid = long id qlid = quoted lid */
6
7 subtype dr_id is dbms_id_30; /* use: id */
8 subtype dr_id2 is varchar2(61); /* use: id.id */
9 subtype dr_id3 is varchar2(92); /* use: id.id.id */
10
11 subtype dr_qid is dbms_quoted_id_30; /* use: quoted id */
12 subtype dr_qid2 is varchar2(65); /* use: qid.qid */
13 subtype dr_qid3 is varchar2(98); /* use: qid.qid.qid */
14
15 subtype dr_lid is dbms_id_128; /* use: long id lid */
16 subtype dr_lid2 is varchar2(257); /* use: lid.lid */
17 subtype dr_lid3 is varchar2(386); /* use: lid.lid.lid */
18
19 subtype dr_qlid is dbms_quoted_id_128; /* use: quoted long id qlid */
20 subtype dr_qlid2 is varchar2(261); /* use: qlid.qlid */
21 subtype dr_qlid3 is varchar2(392); /* use: qlid.qlid.qlid */
22
23 subtype dr_shortbuf is varchar2(32); /* use: small scratch buff */
24 subtype dr_medbuf is varchar2(128); /* use: medium scratch buff */
25 subtype dr_longbuf is varchar2(512); /* use: long scratch buff */
26 subtype dr_extrabuf is varchar2(4192); /* use: 4000 bytes */
27 subtype dr_maxbuf is varchar2(32767); /* use: max len allowed */
28
29 DR_ID_LEN constant number := 30;
30 DR_ID2_LEN constant number := 61;
31 DR_ID3_LEN constant number := 92;
32 DR_QID_LEN constant number := 32;
33 DR_QID2_LEN constant number := 65;
34 DR_QID3_LEN constant number := 98;
35 DR_LID_LEN constant number := 128;
36 DR_LID_LEN2 constant number := 257;
37 DR_LID_LEN3 constant number := 386;
38
39 /* This is the size of a row id (in bytes) */
40 DR_ROWID_LEN constant number := 18;
41 subtype dr_rowid is varchar2(18);
42
43 /* The is the size of a token (in bytes) */
44 MAX_TOKEN_SIZE constant number := 64;
45 subtype dr_token is varchar2(64);
46
47 /*--------------------------- CurrentUserid ------------------------------*/
48 /* this basically does a select userenv('SCHEMAID') from dual and returns */
49 /* the result. This is needed because SQL and PL/SQL don't always agree */
50 /* on what userenv('SCHEMAID') should be */
51 function CurrentUserid return binary_integer;
52
53 /*------------------------------ SetInvoker ------------------------------*/
54 /* set invoking user -- used by invoker's rights packages calling */
55 /* definer's rights packages which need to know the invoker */
56
57 /* note: pass 0 to use current user -- this has to be done by select */
58 /* from dual, NOT calling userenv directly */
59
60 procedure SetInvoker(p_userid in binary_integer default 0);
61
62 /*------------------------------ ClearInvoker ----------------------------*/
63 /* clear invoking user -- if you call SetInvoker, make sure to call this */
64
65 procedure ClearInvoker;
66
67 /*------------------------------ GetInvoker ------------------------------*/
68 /* get the last invoking username */
69
70 function GetInvoker return varchar2;
71
72 /*------------------------------ GetInvokerId ----------------------------*/
73 /* get the last invoking userid */
74
75 function GetInvokerId return number;
76
77 /*-------------------------- get_ora_event_level ----------------------------*/
78 /* Set an Oracle Event's level */
79
80 function set_ora_event_level (
81 event in number,
82 level in number
83 ) return number;
84
85 /*-------------------------- get_ora_event_level ----------------------------*/
86 /* Get an Oracle Event's Level */
87
88 function get_ora_event_level (
89 event in number
90 ) return number;
91
92 /*------------------------------ write_to_log -------------------------------*/
93 /* Write a message to the ctx log file.
94 * msg - the message to dump
95 * newline - should the message be terminated with a new line ?
96 *
97 * The reason this function is here instead of in dr0out (where the
98 * rest of the log-file functionality changes are, is because we don't
99 * want to expose this yet to end users
100 */
101 procedure write_to_log(msg in varchar2,
102 newline in binary_integer default 1);
103
104 /*--------------------------- check_base_table ------------------------*/
105 /* Returns the no. of base table rows which have lang OR abbr OR alt
106 * as their language column value.
107 */
108 function check_base_table(idx in dr_def.idx_rec,
109 language in varchar2,
110 abbr in varchar2 default NULL,
111 alt in varchar2 default NULL)
112 return number;
113
114
115 /*--------------------------- validate_ixs_columns -------------------------*/
116 /* validate ixs columns returned by driixs.GetIndexIXSColumns */
117 procedure validate_ixs_columns
118 (
119 l_idx in dr_def.idx_rec,
120 collist in dr_def.ixc_tab
121 );
122
123 /*--------------------------- validate_ixs_collist -------------------------*/
124 /* validate ixs_collist returned by driixs.GetIndexIndexSet */
125 procedure validate_ixs_collist
126 (
127 l_idx in dr_def.idx_rec,
128 collist in varchar2,
129 out_collist out varchar2
130 );
131
132 /*--------------------------- ProceduralLogLevel -------------------------*/
133 /* returns TRUE if procedural replication is on */
134 function ProceduralLogLevel return boolean;
135
136 /*--------------------------- ISDGRollingUpgrade -------------------------*/
137 /* returns TRUE if database is logical standby */
138 function ISDGRollingUpgrade return boolean;
139
140 end drvutl;