1 PACKAGE JMF_GTA_BATCH_NUMBER_UTIL AUTHID CURRENT_USER AS
2 ----$Header: JMFGBNUS.pls 120.1 2005/07/22 12:02:21 yawang noship $
3 --+===========================================================================+
4 --| Copyright (c) 2005 Oracle Corporation |
5 --| Redwood Shores, California, USA |
6 --| All rights reserved. |
7 --+===========================================================================+
8 --| |
9 --| FILENAME : |
10 --| JMFGBNUS.pls |
11 --| |
12 --| DESCRIPTION: |
13 --| This package is a collection of the util procedure |
14 --| or function for auto batch numbering. |
15 --| |
16 --| |
17 --| HISTORY: |
18 --| 20-APR-2005: Qiang Li Created |
19 --| |
20 --+===========================================================================+
21
22 --Declare global variable for package name
23 g_module_prefix VARCHAR2(40) := 'jmf.plsql.JMF_GTA_BATCH_NUMBER_UTIL';
24
25 --==========================================================================
26 -- PROCEDURE NAME:
27 --
28 -- create_seq Public
29 --
30 -- DESCRIPTION:
31 --
32 -- This procedure create a new sequence for a given operating unit
33 --
34 -- PARAMETERS:
35 -- In: p_org_id the operating unit id for the new sequence
36 -- p_next_value the start value of the sequence
37 -- Out: x_return_status the return value to indicate the status
38 --
39 -- DESIGN REFERENCES:
40 --
41 --
42 -- CHANGE HISTORY:
43 --
44 -- 30-APR-2005: qiang.li Created.
45 --
46 --===========================================================================
47
48 PROCEDURE Create_Seq
49 ( p_org_id IN NUMBER
50 , p_next_value IN NUMBER
51 , x_return_status OUT NOCOPY VARCHAR2
52 );
53
54 --==========================================================================
55 -- PROCEDURE NAME:
56 --
57 -- set_nextval Public
58 --
59 -- DESCRIPTION:
60 --
61 -- This procedure set the sequence's next value for a given operating unit
62 --
63 -- PARAMETERS:
64 -- In: p_org_id the operating unit id for the new sequence
65 -- p_next_value the start value of the sequence
66 -- Out: x_return_status the return value to indicate the status
67 --
68 -- DESIGN REFERENCES:
69 --
70 --
71 -- CHANGE HISTORY:
72 --
73 -- 30-APR-2005: qiang.li Created.
74 --
75 --===========================================================================
76 PROCEDURE Set_Nextval
77 ( p_org_id IN NUMBER
78 , p_next_value IN NUMBER
79 , x_return_status OUT NOCOPY VARCHAR2
80 );
81
82 --==========================================================================
83 -- FUNCTION NAME:
84 --
85 -- next_value Public
86 --
87 -- DESCRIPTION:
88 --
89 -- This function get the sequence's current value and then increase it
90 --
91 -- PARAMETERS:
92 -- In: p_org_id Identifier of operating unit
93 --
94 --
95 -- Return: NUMBER
96 --
97 -- DESIGN REFERENCES:
98 -- GTA-System-Options-Form-TD.doc
99 --
100 -- CHANGE HISTORY:
101 --
102 -- 30-APR-2005: qiang.li Created.
103 --
104 --===========================================================================
105 FUNCTION Next_Value
106 (p_org_id IN NUMBER
107 )
108 RETURN NUMBER;
109 --==========================================================================
110 -- PROCEDURE NAME:
111 --
112 -- drop_seq Public
113 --
114 -- DESCRIPTION:
115 --
116 -- This procedure drop the sequence of a given operating unit
117 --
118 -- PARAMETERS:
119 -- In: p_org_id the operating unit id for the new sequence
120 --
121 -- Out: x_return_status the return value to indicate the status
122 --
123 -- DESIGN REFERENCES:
124 -- GTA-System-Options-Form-TD.doc
125 --
126 -- CHANGE HISTORY:
127 --
128 -- 30-APR-2005: qiang.li Created.
129 --
130 --===========================================================================
131 PROCEDURE Drop_Seq
132 ( p_org_id IN NUMBER
133 , x_return_status OUT NOCOPY VARCHAR2
134 );
135 --==========================================================================
136 -- FUNCTION NAME:
137 --
138 -- is_number Public
139 --
140 -- DESCRIPTION:
141 --
142 -- This function check the input value to see whether it is a number
143 --
144 -- PARAMETERS:
145 -- In: p_value input value to check
146 --
147 --
148 -- Return: NUMBER
149 --
150 -- DESIGN REFERENCES:
151 -- GTA-System-Options-Form-TD.doc
152 --
153 -- CHANGE HISTORY:
154 --
155 -- 30-APR-2005: qiang.li Created.
156 --
157 --===========================================================================
158 FUNCTION Is_Number
159 (p_value IN VARCHAR2
160 )
161 RETURN NUMBER;
162 --==========================================================================
163 -- FUNCTION NAME:
164 --
165 -- verify_next_batch_number Public
166 --
167 -- DESCRIPTION:
168 --
169 -- This function verify the given next value for a operating unit to
170 -- see whether the next value is bigger than the exist batch number
171 -- PARAMETERS:
172 -- In: p_org_id the operating unit id
173 -- p_next_value the next value to verify
174 -- Return: VARCHAR2
175 --
176 -- DESIGN REFERENCES:
177 -- GTA-System-Options-Form-TD.doc
178 --
179 -- CHANGE HISTORY:
180 --
181 -- 30-APR-2005: qiang.li Created.
182 --
183 --===========================================================================
184 FUNCTION Verify_Next_Batch_Number
185 ( p_org_id IN NUMBER
186 , p_next_value IN NUMBER
187 )
188 RETURN VARCHAR2;
189 --==========================================================================
190 -- FUNCTION NAME:
191 --
192 -- is_exist Public
193 --
194 -- DESCRIPTION:
195 --
196 -- This function is used to check whether the given org_id has a sequence
197 -- in the database
198 -- PARAMETERS:
199 -- In: p_org_id the operating unit id
200 --
201 -- Return: VARCHAR2
202 --
203 -- DESIGN REFERENCES:
204 -- GTA-System-Options-Form-TD.doc
205 --
206 -- CHANGE HISTORY:
207 --
208 -- 30-APR-2005: qiang.li Created.
209 --
210 --===========================================================================
211 FUNCTION Is_Exist
212 (p_org_id IN NUMBER
213 )
214 RETURN VARCHAR2;
215 --==========================================================================
216 -- FUNCTION NAME:
217 --
218 -- current_value Public
219 --
220 -- DESCRIPTION:
221 --
222 -- This function is used to get the current value of a sequence
223 -- PARAMETERS:
224 -- In: p_org_id the operating unit id
225 --
226 -- Return: VARCHAR2
227 --
228 -- DESIGN REFERENCES:
229 -- GTA-System-Options-Form-TD.doc
230 --
231 -- CHANGE HISTORY:
232 --
233 -- 30-APR-2005: qiang.li Created.
234 --
235 --===========================================================================
236 FUNCTION Current_Value
237 (p_org_id IN NUMBER
238 )
239 RETURN NUMBER;
240 END JMF_GTA_BATCH_NUMBER_UTIL;