1 PACKAGE BODY IBW_TR_PVT AS
2 /*$Header: IBWTRB.pls 120.5 2005/09/12 03:38 schittar noship $*/
3
4
5 /* instance_id - get the unique instance identifier
6 **
7 ** Returns an unique instance id formed from database host id and the sid.
8 **
9 */
10 function instance_id return VARCHAR2 is
11 lhost varchar2(2000);
12 linstance varchar2(2000);
13 ldot number;
14 begin
15
16 -- Get default value of <host>_<sid>.
17 select lower(host_name), lower(instance_name)
18 into lhost, linstance
19 from v$instance;
20
21 -- If the host has a domain embedded in it - <host>.<domain>
22 -- then strip off the domain bit.
23 ldot := instr(lhost, '.');
24 if (ldot > 0) then
25 lhost := substr(lhost, 1, ldot-1);
26 end if;
27 return lhost||'_'||linstance;
28
29 end instance_id;
30
31 /*
32 ** change_tracking_sequence - get the unique instance identifier
33 */
34 procedure change_tracking_sequence(xerrbuf out NOCOPY varchar2, xerrcode out NOCOPY number, visitidwindow in number, visitoridwindow in number) as
35 ret boolean;
36 begin
37 if (visitidwindow <> 0) then
38 execute immediate 'alter sequence IBW.IBW_VISIT_COUNTER_S1 increment by ' || visitidwindow;
39 ret := fnd_profile.save('IBW_VISIT_WINDOW_SPAN',to_char(visitidwindow),'SITE');
40 end if;
41 if (visitoridwindow <> 0) then
42 execute immediate 'alter sequence IBW.IBW_VISITOR_COUNTER_S1 increment by ' || visitoridwindow;
43 ret := fnd_profile.save('IBW_VISITOR_WINDOW_SPAN',to_char(visitoridwindow),'SITE');
44 end if;
45 end change_tracking_sequence;
46
47 END IBW_TR_PVT;