1 package dt_fndate AUTHID CURRENT_USER as
2 /* $Header: dtfndate.pkh 120.1 2006/05/07 00:09:15 vkaduban noship $ */
3 /*
4 Copyright (c) Oracle Corporation 1991,1992,1993. All rights reserved
5
6 /*
7
8 Name : dt_fndate
9 Author : P.K.Attwood
10 Date Created : 01-OCT-1993
11 Synopsis : This package containes procedures for maintaining the
12 session date held in fnd_sessions.
13 Contents : change_ses_date
14 get_dates
15 Version : $Revision: 120.1 $
16
17 Change List
18 -----------
19 Date Name Vers Bug No Description
20 -----------+-------------+-------+----------+-------------------------------+
21 01-OCT-1993 P.K.Attwood 4.0 First Created.
22 07-MAR-1994 P.K.Attwood 4.1 Added delete_ses_rows procedure.
23 13-MAY-1994 P.K.Attwood 3.0 Transferred out of version 4 DT
24 into version 3, so all server
25 side code is in the same place.
26 05-OCT-1994 R.M.Fine 30.1 Renamed package to dt_fndate to
27 conform to naming convention that
28 all objects begin '<prod>_'.
29 13-SEP-2001 P.K.Attwood 115.1 Added set_effective_date
30 procedure.
31 13-DEC-2001 G.Perry 115.2 Added dbdrv
32 06-dec-2002 A.Holt 115.3 NOCOPY Performance Changes
33 for 11.5.9
34 09-jan-2005 K.Tangeeda 115.4 This version is same as 115.3
35 07-May-2006 V.Kaduban 120.1 Added the declaration for
36 procedures delete_old_ses_rows
37 and clean_fnd_sessions and
38 updated the description for
39 delete_ses_rows as part of long
40 term solution for Bug 4163689.
41 -----------+-------------+-------+----------+-------------------------------+
42 */
43 --
44 /*
45 Name : get_dates
46 Parameters : No input parameters
47 Values Returned : p_ses_date is set to the session date. The value
48 will be a trunc(date).
49 p_ses_yesterday_date is set to p_ses_date minus one
50 date.
51 p_start_of_time is set to 01-JAN-0001.
52 p_end_of time is set to 31-DEC-4712.
53 p_sys_date is set to sysdate.
54 p_commit will be set to 1 if the procedure
55 has inserted/updated/deleted rows.
56 The forms code should then do a
57 commit. If p_commit is 0 then
58 a commit is not required.
59 Description : This procedure obtains session date from fnd_sessions.
60 If there is no row in fnd_sessions for this sessions, one
61 will be inserted. p_ses_date will then set to
62 trunc(sysdate).
63 */
64 procedure get_dates
65 (
66 p_ses_date out nocopy date,
67 p_ses_yesterday_date out nocopy date,
68 p_start_of_time out nocopy date,
69 p_end_of_time out nocopy date,
70 p_sys_date out nocopy date,
71 p_commit out nocopy number
72 );
73 --
74 /*
75 Name : change_session_date
76 Parameters : p_ses_date
77 Values Returned : p_commit will be set to 1 if the procedure
78 has inserted/updated/deleted rows.
79 The forms code should then do a
80 commit. If p_commit is 0 then
81 a commit is not required.
82 Description : Updates the row in fnd_sessions with the new session
83 date.
84 */
85 procedure change_ses_date
86 (
87 p_ses_date in date,
88 p_commit out nocopy number
89 );
90 --
91 /*
92 Name : set_effective_date
93 Parameters : p_effective_date
94 p_do_commit
95 Values Returned : None
96 Description : Acts as a cover procedure to change_ses_date.
97 Inserts or updates a row into FND_SESSIONS for the
98 current session. If the p_effective_date parameter
99 is provided the row will be modified with
100 a truncated version of that date. If p_effective_date
101 is set to null then trunc(sysdate) will be used.
102 If p_do_commit is set to true this procedure will
103 issue a commit when required. If p_do_commit is set
104 to false this procedure will not issue a commit.
105 It is then the calling code's responsibility to issue
106 a commit as soon as possible. Otherwise there is
107 a risk of the internal package global variables
108 getting out of synchronisation with the
109 FND_SESSIONS column values.
110
111 */
112 procedure set_effective_date
113 (p_effective_date in date default null
114 ,p_do_commit in boolean default false
115 );
116 --
117 /*
118 Name : delete_ses_rows
119 Parameters : None
120 Values Returned : p_commit Will be set to 1 if the procedure
121 has deleted any row from fnd_sessions.
122 Description : Deletes the row in fnd_sessions table corresponding to the
123 current session. If a successful row deletion takes place
124 then the parameter p_commit is set to 1, otherwise it is
125 set to 0. The calling form issues a commit if the value
126 of p_commit is 1.
127 */
128 procedure delete_ses_rows
129 (
130 p_commit out nocopy number
131 ) ;
132 --
133 /*
134 Name : delete_old_ses_rows
135 Parameters : None
136 Values Returned : p_commit will be set to 1 if the procedure
137 has deleted rows from fnd_sessions.
138 The forms code should then do a
139 commit. If p_commit is 0 then
140 a commit is not required.
141 Description : Removes old rows from fnd_sessions. i.e. Rows where the
142 corresponding sql session no longer exists. The row for
143 this session is NOT deleted.
144 */
145 procedure delete_old_ses_rows
146 (
147 p_commit out nocopy number
148 );
149 --
150 /*
151 Name : clean_fnd_sessions
152 Parameters : None
153 Values Returned : errbuf,retcode The procedure is used as the
154 executable by a concurrent program
155 which removes old rows from
156 fnd_sessions. These are
157 the out parameters that are
158 mandatory for any executable.
159 Description : Does the same thing as delete_old_ses_rows
160 but used by a concurrent program for doing that
161 periodically.
162 */
163 procedure clean_fnd_sessions
164 (
165 errbuf out nocopy varchar2,
166 retcode out nocopy varchar2
167 );
168 end dt_fndate;