DBA Data[Home] [Help]

PACKAGE: CTXSYS.DRITHSC

Source


1 PACKAGE drithsc AS
2 
3   -- last phrase id for TR
4   pv_last_id number;
5 
6 /*-------------------------- check_thesaurus_exists ------------------------*/
7 /*
8   NAME
9     check_thesaurus_exists
10 
11   DESCRIPTION
12     check if thesaurus already exists
13 
14   ARGUMENTS
15     tname    (IN) thesaurus name
16 
17   RETURN
18     0 for thesaurus does not exist
19     1 for thesaurus exists
20 
21   NOTES
22 
23 */
24 function check_thesaurus_exists (
25   tname    in varchar2)
26 return number;
27 
28 /*---------------------------- create_thesaurus -------------------------*/
29 /*
30   NAME
31     create_thesaurus
32 
33   DESCRIPTION
34     create a new, empty thesaurus
35 
36   ARGUMENTS
37     tname    (IN) thesaurus name
38     casesens (IN) case-sensitivity
39 
40   RETURN
41     new thesaurus ID
42 
43   NOTES
44     error if thesaurus already exists
45 */
46 function create_thesaurus(
47   tname    in varchar2,
48   casesens in boolean  default false)
49 return number;
50 
51 procedure create_thesaurus_lsb(
52   lv_id    in number,
53   tname    in varchar2,
54   casesens in boolean  default false
55 );
56 PRAGMA SUPPLEMENTAL_LOG_DATA(create_thesaurus_lsb, AUTO);
57 
58 /*---------------------------- drop_thesaurus -------------------------*/
59 /*
60    NAME
61      drop_thesaurus - drop a thesaurus
62 
63    DESCRIPTION
64      This procedure drops an existing thesaurus with the indicated name
65 
66    ARGUMENTS
67      tid  -- thesaurus id
68 
69    NOTES
70      no error if the thesaurus does not exist
71 */
72 procedure drop_thesaurus(tid in number);
73 
74 /*------------------------ drop_user_thesauri -------------------------*/
75 /*
76    NAME
77      drop_user_thesauri - drops thesauri owner by a user
78 
79    DESCRIPTION
80      This procedure drops all thesauri owned by the indicated user.  If
81      the username is null, then all thesauri owned by non-existent users
82      are dropped (called by ctx_adm.recover).
83 
84    ARGUMENTS
85      user_name
86 */
87 procedure drop_user_thesauri(user_name in varchar2 := null);
88 
89 /*------------------------- trunc_thesaurus -------------------------*/
90 /*
91    NAME
92      trunc_thesaurus - truncate a thesaurus
93 
94    DESCRIPTION
95      This procedure truncate a thesaurus
96 
97    ARGUMENTS
98      tid     -- thesaurus id
99 
100    NOTES
101 */
102 procedure trunc_thesaurus(tid in number);
103 
104 /*------------------------- rename_thesaurus -------------------------*/
105 /*
106    NAME
107      rename_thesaurus - rename a thesaurus
108 
109    DESCRIPTION
110      This procedure rename a thesaurus
111      show
112 
113    ARGUMENTS
114      tid     -- thesaurus id
115      tname   -- new thesaurus name
116 
117    NOTES
118 */
119 procedure rename_thesaurus(
120    tid     in number,
121    tname   in varchar2
122 );
123 
124 /*---------------------------- create_phrase -------------------------*/
125 /*
126    NAME
127      create_phrase -- add a phrase to a thesaurus
128 
129    DESCRIPTION
130      This procedure adds a phrase, or information about the phrase,
131      to the thesaurus.
132 
133    ARGUMENTS
134      tid      --  thesaurus id
135      tcs      --  TRUE if thesaurus is case-sensitive
136      phrase   --  phrase to add/modify
137      rel      --  relationship type
138      id       --  relationship id
139 
140    NOTES
141      no error if the phrase already exists.
142      note funny order of arguments.  PHRASE is the REL of RELID.
143      Thus, create_phrase(123, 'animal', 'BT', <id of dog>)
144 
145    RETURN
146      created phrase id
147 */
148 function create_phrase (
149   tid    in number,
150   tcs    in boolean,
151   phrase in varchar2,
152   rel    in varchar2 default null,
153   relid  in number   default null
154 ) return number;
155 
156 procedure create_phrase_lsb(
157   tid    in number,
158   tcs    in boolean,
159   phrase in varchar2,
160   rel    in varchar2 default null,
161   relid  in number   default null,
162   retval in out number
163 );
164 PRAGMA SUPPLEMENTAL_LOG_DATA(create_phrase_lsb, AUTO);
165 
166 /*---------------------------- drop_phrase -------------------------*/
167 /*
168    NAME
169      drop_phrase -- drop a phrase from a thesaurus
170 
171    DESCRIPTION
172      This procedure drops a phrase from the thesaurus
173 
174    ARGUMENTS
175      phrid       --  phrase id
176 
177    NOTES
178 
179    RETURN
180 */
181 procedure drop_phrase (
182   phrid  in number
183 );
184 
185 /*--------------------------- rename_phrase -------------------------*/
186 /*
187    NAME
188      create_phrase -- rename a phrase in  a thesaurus
189 
190    DESCRIPTION
191      This procedure renames a phrase
192 
193    ARGUMENTS
194      phrid    --  phrase id
195      phrase   --  phrase to add/modify
196 
197    NOTES
198 
199    RETURN
200 
201 */
202 procedure rename_phrase (
203   phrid  in   number,
204   phrase in   varchar2
205 );
206 
207 
208 /*------------------------------- make_pt -----------------------------*/
209 /*
210    NAME
211      make_pt -- name a phrase the preferred term
212 
213    DESCRIPTION
214      This procedure makes a phrase the preferred term
215 
216    ARGUMENTS
217      phrid    --  phrase id
218 
219    NOTES
220 
221    RETURN
222 
223 */
224 procedure make_pt (
225   phrid  in   number
226 );
227 
228 /*----------------------------- change_sn -----------------------------*/
229 /*
230    NAME
231      change_sn -- change the scope notes of a phrase
232 
233    DESCRIPTION
234      This procedure changes the scope notes of a phrase
235 
236    ARGUMENTS
237      phrid    --  phrase id
238      sn       --  new scope notes
239 
240    NOTES
241 
242    RETURN
243 
244 */
245 procedure change_sn (
246   phrid  in   number,
247   sn     in   varchar2
248 );
249 
250 /*------------------------------- create_tr -----------------------------*/
251 /*
252    NAME
253      create_tr -- add a translation to a thesaurus
254 
255    DESCRIPTION
256      This procedure adds a translation to the thesaurus
257 
258    ARGUMENTS
259      id1      --  phrase id 1
260      lang     --  language
261      trans    --  translation
262 
263    NOTES
264 
265    RETURN
266 */
267 procedure create_tr(
268   id1   in number,
269   lang  in varchar2,
270   trans in varchar2
271 );
272 
273 /*------------------------------- drop_tr -----------------------------*/
274 /*
275    NAME
276      drop_tr -- drop a translation/s from a thesaurus
277 
278    DESCRIPTION
279      This procedure drops a translation/s from the thesaurus
280 
281    ARGUMENTS
282      id1      --  phrase id 1
283      lang     --  language
284      trans    --  translation
285 
286    NOTES
287 
288    RETURN
289 */
290 procedure drop_tr(
291   id1   in number,
292   lang  in varchar2,
293   trans in varchar2
294 );
295 
296 /*------------------------------ update_tr -----------------------------*/
297 /*
298    NAME
299      update_tr -- update a translation
300 
301    DESCRIPTION
302      This procedure updates a translation
303 
304    ARGUMENTS
305      id1      --  phrase id 1
306      lang     --  language
307      trans    --  translation
308      ntrans   --  new translation
309 
310    NOTES
311 
312    RETURN
313 */
314 procedure update_tr(
315   id1    in number,
316   lang   in varchar2,
317   trans  in varchar2,
318   ntrans in varchar2
319 );
320 
321 /*---------------------------- create_relation ------------------------*/
322 /*
323    NAME
324      create_relation -- add a relation to a thesaurus
325 
326    DESCRIPTION
327      This procedure adds a relation to the thesaurus
328 
329    ARGUMENTS
330      id1      --  phrase id 1
331      rel      --  relationship type
332      id2      --  phrase id 2
333 
334    NOTES
335      opposite of create_phrase -- ID2 is the REL of ID1.
336 
337    RETURN
338 */
339 PROCEDURE create_relation (
340   id1    in number,
341   rel    in varchar2,
342   id2    in number
343 );
344 
345 /*---------------------------- drop_relation ------------------------*/
346 /*
347    NAME
348      drop_relation -- drop a relation from a thesaurus
349 
350    DESCRIPTION
351      This procedure drops a relation from the thesaurus
352 
353    ARGUMENTS
354      id1      --  phrase id 1
355      rel      --  relationship type
356      id2      --  phrase id 2
357 
358    NOTES
359 
360    RETURN
361 */
362 PROCEDURE drop_relation (
363   id1    in number,
364   rel    in varchar2,
365   id2    in number
366 );
367 
368 end drithsc;