DBA Data[Home] [Help]

PACKAGE BODY: APPS.HZ_GEOGRAPHY_PUB_UIW

Source


1 PACKAGE BODY HZ_GEOGRAPHY_PUB_UIW AS
2 /*$Header: ARHGEOWB.pls 120.1 2005/10/26 14:06:46 idali noship $ */
3 
4 
5 /**
6  * PROCEDURE create_master_relation
7  *
8  * DESCRIPTION
9  *     Creates Geography Relationships.
10  *
11  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
12  *
13  * ARGUMENTS
14  *   IN:
15  *     p_init_msg_list                Initialize message stack if it is set to
16  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
17  *     p_master_relation_rec           Geography type record.
18  *   IN/OUT:
19  *   OUT:
20  *     x_relationship_id              Returns relationship_id for the relationship created.
21  *     x_return_status                Return status after the call. The status can
22  *                                    be FND_API.G_RET_STS_SUCCESS (success),
23  *                                    FND_API.G_RET_STS_ERROR (error),
24  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
25  *     x_msg_count                    Number of messages in message stack.
26  *     x_msg_data                     Message text if x_msg_count is 1.
27  *
28  * NOTES
29  *
30  * MODIFICATION HISTORY
31  *     06-20-2005    Kate Shan           o Created.
32  *
33  */
34 
35 PROCEDURE create_master_relation (
36     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
37     p_master_relation_rec       IN         MASTER_RELATION_REC_TYPE,
38     x_relationship_id           OUT   NOCOPY     NUMBER,
39     x_return_status             OUT   NOCOPY     VARCHAR2,
40     x_msg_count                 OUT   NOCOPY     NUMBER,
41     x_msg_data                  OUT   NOCOPY     VARCHAR2
42 ) IS
43   l_master_relation_rec HZ_GEOGRAPHY_PUB.MASTER_RELATION_REC_TYPE;
44 BEGIN
45 
46     l_master_relation_rec.geography_id := p_master_relation_rec.geography_id;
47     l_master_relation_rec.parent_geography_id := p_master_relation_rec.parent_geography_id;
48     l_master_relation_rec.start_date := p_master_relation_rec.start_date;
49     l_master_relation_rec.end_date := p_master_relation_rec.end_date;
50     l_master_relation_rec.created_by_module := p_master_relation_rec.created_by_module;
51     l_master_relation_rec.application_id := p_master_relation_rec.application_id;
52 
53     HZ_GEOGRAPHY_PUB.create_master_relation (
54         p_init_msg_list => p_init_msg_list,
55         p_master_relation_rec => l_master_relation_rec,
56         x_relationship_id  => x_relationship_id,
57         x_return_status    => x_return_status,
58         x_msg_count        => x_msg_count,
59         x_msg_data         => x_msg_data);
60 
61 END create_master_relation;
62 
63 
64 /**
65  * PROCEDURE update_relationship
66  *
67  * DESCRIPTION
68  *     Updates Geography Relationships.
69  *
70  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
71  *
72  * ARGUMENTS
73  *   IN:
74  *     p_init_msg_list                Initialize message stack if it is set to
75  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
76  *     p_master_relation_rec          Geography type record.
77  *     p_object_version_number        Object version number of the row
78  *   IN/OUT:
79  *   OUT:
80  *
81  *     x_return_status                Return status after the call. The status can
82  *                                    be FND_API.G_RET_STS_SUCCESS (success),
83  *                                    FND_API.G_RET_STS_ERROR (error),
84  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
85  *     x_msg_count                    Number of messages in message stack.
86  *     x_msg_data                     Message text if x_msg_count is 1.
87  *
88  * NOTES
89  *
90  * MODIFICATION HISTORY
91  *     06-20-2005    Kate Shan           o Created.
92  *
93  */
94 
95 PROCEDURE update_relationship (
96     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
97     p_relationship_id           IN         NUMBER,
98     p_status                    IN         VARCHAR2,
99     p_object_version_number     IN OUT  NOCOPY   NUMBER,
100     x_return_status             OUT     NOCOPY   VARCHAR2,
101     x_msg_count                 OUT     NOCOPY   NUMBER,
102     x_msg_data                  OUT     NOCOPY   VARCHAR2
103 ) IS
104 BEGIN
105 
106    HZ_GEOGRAPHY_PUB.update_relationship(
107     p_init_msg_list => p_init_msg_list,
108     p_relationship_id => p_relationship_id,
109     p_status => p_status,
110     p_object_version_number => p_object_version_number,
111     x_return_status => x_return_status,
112     x_msg_count => x_msg_count,
113     x_msg_data => x_msg_data );
114 
115 END update_relationship;
116 
117 /**
118  * PROCEDURE create_geo_identifier
119  *
120  * DESCRIPTION
121  *     Creates Geography Identifiers.
122  *
123  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
124  *
125  * ARGUMENTS
126  *   IN:
127  *     p_init_msg_list                Initialize message stack if it is set to
128  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
129  *     p_geo_identifier_rec           Geo_identifier type record.
130  *   IN/OUT:
131  *   OUT:
132  *
133  *     x_return_status                Return status after the call. The status can
134  *                                    be FND_API.G_RET_STS_SUCCESS (success),
135  *                                    FND_API.G_RET_STS_ERROR (error),
136  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
137  *     x_msg_count                    Number of messages in message stack.
138  *     x_msg_data                     Message text if x_msg_count is 1.
139  *
140  * NOTES
141  *
142  * MODIFICATION HISTORY
143  *     06-20-2005    Kate Shan           o Created.
144  *
145  */
146 
147 PROCEDURE create_geo_identifier(
148     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
149     p_geo_identifier_rec        IN         GEO_IDENTIFIER_REC_TYPE,
150     x_return_status             OUT  NOCOPY      VARCHAR2,
151     x_msg_count                 OUT  NOCOPY      NUMBER,
152     x_msg_data                  OUT  NOCOPY      VARCHAR2
153 ) IS
154   l_geo_identifier_rec HZ_GEOGRAPHY_PUB.GEO_IDENTIFIER_REC_TYPE;
155 BEGIN
156 
157   l_geo_identifier_rec.geography_id := p_geo_identifier_rec.geography_id;
158   l_geo_identifier_rec.identifier_subtype := p_geo_identifier_rec.identifier_subtype;
159   l_geo_identifier_rec.identifier_value := p_geo_identifier_rec.identifier_value;
160   l_geo_identifier_rec.identifier_type := p_geo_identifier_rec.identifier_type;
161   l_geo_identifier_rec.geo_data_provider := p_geo_identifier_rec.geo_data_provider;
162   l_geo_identifier_rec.primary_flag := p_geo_identifier_rec.primary_flag;
163   l_geo_identifier_rec.language_code := p_geo_identifier_rec.language_code;
164   l_geo_identifier_rec.created_by_module := p_geo_identifier_rec.created_by_module;
165   l_geo_identifier_rec.application_id := p_geo_identifier_rec.application_id;
166 
167 
168   HZ_GEOGRAPHY_PUB.create_geo_identifier(
169     p_init_msg_list => p_init_msg_list,
170     p_geo_identifier_rec => l_geo_identifier_rec,
171     x_return_status => x_return_status,
172     x_msg_count => x_msg_count,
173     x_msg_data  => x_msg_data );
174 
175 END create_geo_identifier;
176 
177 /**
178  * PROCEDURE update_geo_identifier
179  *
180  * DESCRIPTION
181  *     Creates Geography Identifiers.
182  *
183  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
184  *
185  * ARGUMENTS
186  *   IN:
187  *     p_init_msg_list                Initialize message stack if it is set to
188  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
189  *     p_geo_identifier_rec           Geo_identifier type record.
190  *
191  *   IN/OUT:
192  *     p_object_version_number
193  *   OUT:
194  *     x_cp_request_id                Concurrent Program Request Id,whenever CP
195  *                                    to update denormalized data gets kicked off.
196  *     x_return_status                Return status after the call. The status can
197  *                                    be FND_API.G_RET_STS_SUCCESS (success),
198  *                                    FND_API.G_RET_STS_ERROR (error),
199  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
200  *     x_msg_count                    Number of messages in message stack.
201  *     x_msg_data                     Message text if x_msg_count is 1.
202  *
203  * NOTES
204  *
205  * MODIFICATION HISTORY
206  *     06-20-2005    Kate Shan           o Created.
207  *     26-OCT-2005   Idris Ali           o Bug 4578867 Added parameter x_cp_request_id.
208  *
209  */
210 PROCEDURE update_geo_identifier (
211     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
212     p_geo_identifier_rec        IN         GEO_IDENTIFIER_REC_TYPE,
213     p_object_version_number     IN OUT  NOCOPY   NUMBER,
214     x_cp_request_id             OUT     NOCOPY   NUMBER,  --Bug 4578867
215     x_return_status             OUT     NOCOPY   VARCHAR2,
216     x_msg_count                 OUT     NOCOPY   NUMBER,
217     x_msg_data                  OUT     NOCOPY   VARCHAR2
218 ) IS
219   l_geo_identifier_rec HZ_GEOGRAPHY_PUB.GEO_IDENTIFIER_REC_TYPE;
220 BEGIN
221 
222   l_geo_identifier_rec.geography_id := p_geo_identifier_rec.geography_id;
223   l_geo_identifier_rec.identifier_subtype := p_geo_identifier_rec.identifier_subtype;
224   l_geo_identifier_rec.identifier_value := p_geo_identifier_rec.identifier_value;
225   l_geo_identifier_rec.identifier_type := p_geo_identifier_rec.identifier_type;
226   l_geo_identifier_rec.geo_data_provider := p_geo_identifier_rec.geo_data_provider;
227   l_geo_identifier_rec.primary_flag := p_geo_identifier_rec.primary_flag;
228   l_geo_identifier_rec.language_code := p_geo_identifier_rec.language_code;
229   l_geo_identifier_rec.created_by_module := p_geo_identifier_rec.created_by_module;
230   l_geo_identifier_rec.application_id := p_geo_identifier_rec.application_id;
231   l_geo_identifier_rec.new_identifier_subtype := p_geo_identifier_rec.new_identifier_subtype; -- Bug 4578867
232   l_geo_identifier_rec.new_identifier_value := p_geo_identifier_rec.new_identifier_value;
233 
234 
235   HZ_GEOGRAPHY_PUB.update_geo_identifier (
236     p_init_msg_list => p_init_msg_list,
237     p_geo_identifier_rec => l_geo_identifier_rec,
238     p_object_version_number => p_object_version_number,
239     x_cp_request_id => x_cp_request_id, --Bug 4578867
240     x_return_status => x_return_status,
241     x_msg_count => x_msg_count,
242     x_msg_data => x_msg_data
243    );
244 
245 END update_geo_identifier;
246 
247 /**
248  * PROCEDURE delete_geo_identifier
249  *
250  * DESCRIPTION
251  *     Deletes Geography Identifiers.
252  *
253  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
254  *
255  * ARGUMENTS
256  *   IN:
257  *     p_init_msg_list                Initialize message stack if it is set to
258  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
259  *     p_geography_id                 geography id
260  *     p_identifier_type
261  *     p_identifier_subtype
262  *     p_identifier_value
263  *
264  *   OUT:
265  *
266  *     x_return_status                Return status after the call. The status can
267  *                                    be FND_API.G_RET_STS_SUCCESS (success),
268  *                                    FND_API.G_RET_STS_ERROR (error),
269  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
270  *     x_msg_count                    Number of messages in message stack.
271  *     x_msg_data                     Message text if x_msg_count is 1.
272  *
273  * NOTES
274  *
275  * MODIFICATION HISTORY
276  *     06-20-2005    Kate Shan           o Created.
277  *
278  */
279 
280  PROCEDURE delete_geo_identifier(
281       p_init_msg_list           IN VARCHAR2 := FND_API.G_FALSE,
282       p_geography_id		IN NUMBER,
283       p_identifier_type	        IN VARCHAR2,
284       p_identifier_subtype	IN VARCHAR2,
285       p_identifier_value        IN VARCHAR2,
286       p_language_code           IN VARCHAR2,
287       x_return_status           OUT NOCOPY VARCHAR2,
288       x_msg_count               OUT  NOCOPY NUMBER,
289       x_msg_data                OUT NOCOPY VARCHAR2
290       ) IS
291 BEGIN
292   HZ_GEOGRAPHY_PUB.delete_geo_identifier(
293       p_init_msg_list => p_init_msg_list,
294       p_geography_id => p_geography_id,
295       p_identifier_type => p_identifier_type,
296       p_identifier_subtype => p_identifier_subtype,
297       p_identifier_value => p_identifier_value,
298       p_language_code => p_language_code,
299       x_return_status => x_return_status,
300       x_msg_count => x_msg_count,
301       x_msg_data => x_msg_data
302   );
303 
304 END delete_geo_identifier;
305 
306 
307 /**
311  *     Creates Master Geography.
308  * PROCEDURE create_master_geography
309  *
310  * DESCRIPTION
312  *
313  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
314  *
315  * ARGUMENTS
316  *   IN:
317  *     p_init_msg_list                Initialize message stack if it is set to
318  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
319  *     p_master_geography_rec         Master Geography type record.
320  *   IN/OUT:
321  *   OUT:
322  *
323  *     x_geography_id                 Return ID of the geography being created.
324  *     x_return_status                Return status after the call. The status can
325  *                                    be FND_API.G_RET_STS_SUCCESS (success),
326  *                                    FND_API.G_RET_STS_ERROR (error),
327  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
328  *     x_msg_count                    Number of messages in message stack.
329  *     x_msg_data                     Message text if x_msg_count is 1.
330  *
331  * NOTES
332  *
333  * MODIFICATION HISTORY
334  *     06-20-2005    Kate Shan           o Created.
335  *
336  */
337 
338 PROCEDURE create_master_geography(
339     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
340     p_master_geography_rec      IN         MASTER_GEOGRAPHY_REC_TYPE,
341     p_parent_geography_id       IN         PARENT_GEOGRAPHY_TBL_TYPE,
342     x_geography_id              OUT   NOCOPY     NUMBER,
343     x_return_status             OUT   NOCOPY     VARCHAR2,
344     x_msg_count                 OUT   NOCOPY     NUMBER,
345     x_msg_data                  OUT   NOCOPY     VARCHAR2
346 ) IS
347   l_master_geography_rec HZ_GEOGRAPHY_PUB.MASTER_GEOGRAPHY_REC_TYPE;
348   l_parent_geography_id  HZ_GEOGRAPHY_PUB.parent_geography_tbl_type;
349 BEGIN
350 
351   FOR i in 1 ..p_parent_geography_id.count LOOP
352     l_parent_geography_id(i) := p_parent_geography_id(i);
353   END LOOP;
354 
355   l_master_geography_rec.geography_type := p_master_geography_rec.geography_type;
356   l_master_geography_rec.geography_name := p_master_geography_rec.geography_name;
357   l_master_geography_rec.geography_code := p_master_geography_rec.geography_code;
358   l_master_geography_rec.geography_code_type := p_master_geography_rec.geography_code_type;
359   IF l_master_geography_rec.start_date = fnd_api.g_miss_date or l_master_geography_rec.start_date is null THEN
360     l_master_geography_rec.start_date :=sysdate;
361   END IF;
362   IF l_master_geography_rec.end_date = fnd_api.g_miss_date or l_master_geography_rec.end_date is null THEN
363     l_master_geography_rec.end_date := to_date('31-12-4712','DD-MM-YYYY');
364   END IF;
365   l_master_geography_rec.geo_data_provider := p_master_geography_rec.geo_data_provider;
366   l_master_geography_rec.language_code := p_master_geography_rec.language_code;
367   l_master_geography_rec.parent_geography_id := l_parent_geography_id;
368   l_master_geography_rec.timezone_code := p_master_geography_rec.timezone_code;
369   l_master_geography_rec.created_by_module := p_master_geography_rec.created_by_module;
370   l_master_geography_rec.application_id := p_master_geography_rec.application_id;
371 
372   HZ_GEOGRAPHY_PUB.create_master_geography(
373     p_init_msg_list => p_init_msg_list,
374     p_master_geography_rec => l_master_geography_rec,
375     x_geography_id => x_geography_id,
376     x_return_status => x_return_status,
377     x_msg_count => x_msg_count,
378     x_msg_data => x_msg_data
379   );
380 
381 END create_master_geography;
382 
383 /**
384  * PROCEDURE update_geography
385  *
386  * DESCRIPTION
387  *     Updates Geography
388  *
389  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
390  *
391  * ARGUMENTS
392  *   IN:
393  *     p_init_msg_list                Initialize message stack if it is set to
394  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
395  *     p_master_geography_rec         Master Geography type record.
396  *
397  *   IN/OUT:
398  *     p_object_version_number
399  *   OUT:
400  *
401  *     x_return_status                Return status after the call. The status can
402  *                                    be FND_API.G_RET_STS_SUCCESS (success),
403  *                                    FND_API.G_RET_STS_ERROR (error),
404  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
405  *     x_msg_count                    Number of messages in message stack.
406  *     x_msg_data                     Message text if x_msg_count is 1.
407  *
408  * NOTES
409  *
410  * MODIFICATION HISTORY
411  *     06-20-2005    Kate Shan           o Created.
412  *
413  */
414 PROCEDURE update_geography (
415     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
416     p_geography_id              IN        NUMBER,
417     p_end_date                  IN        DATE,
418     p_timezone_code             IN        VARCHAR2,
419     p_object_version_number     IN OUT  NOCOPY   NUMBER,
420     x_return_status             OUT     NOCOPY   VARCHAR2,
421     x_msg_count                 OUT     NOCOPY   NUMBER,
422     x_msg_data                  OUT     NOCOPY   VARCHAR2
423 ) IS
424 BEGIN
425 
426   HZ_GEOGRAPHY_PUB.update_geography (
427     p_init_msg_list => p_init_msg_list,
428     p_geography_id => p_geography_id,
429     p_end_date => p_end_date,
430     p_geometry => null,
431     p_timezone_code => p_timezone_code,
432     p_object_version_number => p_object_version_number,
433     x_return_status => x_return_status,
434     x_msg_count => x_msg_count,
435     x_msg_data => x_msg_data
436   );
437 
438 END update_geography;
439 
440 /**
441  * PROCEDURE create_geography_range
442  *
446  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
443  * DESCRIPTION
444  *     Creates Geography Range.
445  *
447  *
448  * ARGUMENTS
449  *   IN:
450  *     p_init_msg_list                Initialize message stack if it is set to
451  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
452  *     p_geography_range_rec          Geography range type record.
453  *   IN/OUT:
454  *   OUT:
455  *
456  *     x_return_status                Return status after the call. The status can
457  *                                    be FND_API.G_RET_STS_SUCCESS (success),
458  *                                    FND_API.G_RET_STS_ERROR (error),
459  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
460  *     x_msg_count                    Number of messages in message stack.
461  *     x_msg_data                     Message text if x_msg_count is 1.
462  *
463  * NOTES
464  *
465  * MODIFICATION HISTORY
466  *     06-20-2005    Kate Shan           o Created.
467  *
468  */
469 
470 PROCEDURE create_geography_range(
471     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
472     p_geography_range_rec       IN         GEOGRAPHY_RANGE_REC_TYPE,
473     x_return_status             OUT   NOCOPY     VARCHAR2,
474     x_msg_count                 OUT   NOCOPY     NUMBER,
475     x_msg_data                  OUT   NOCOPY     VARCHAR2
476 ) IS
477   l_geography_range_rec HZ_GEOGRAPHY_PUB.GEOGRAPHY_RANGE_REC_TYPE;
478 BEGIN
479 
480   l_geography_range_rec.zone_id := p_geography_range_rec.zone_id;
481   l_geography_range_rec.master_ref_geography_id := p_geography_range_rec.master_ref_geography_id;
482   l_geography_range_rec.identifier_type := p_geography_range_rec.identifier_type;
483   l_geography_range_rec.geography_from := p_geography_range_rec.geography_from;
484   l_geography_range_rec.geography_to := p_geography_range_rec.geography_to;
485   l_geography_range_rec.geography_type := p_geography_range_rec.geography_type;
486   l_geography_range_rec.start_date := p_geography_range_rec.start_date;
487   l_geography_range_rec.end_date := p_geography_range_rec.end_date;
488   l_geography_range_rec.created_by_module := p_geography_range_rec.created_by_module;
489   l_geography_range_rec.application_id := p_geography_range_rec.application_id;
490 
491 
492     HZ_GEOGRAPHY_PUB.create_geography_range (
493     p_init_msg_list => p_init_msg_list,
494     p_geography_range_rec => l_geography_range_rec,
495     x_return_status => x_return_status,
496     x_msg_count => x_msg_count,
497     x_msg_data => x_msg_data
498     );
499 
500 END create_geography_range;
501 
502 
503 /**
504  * PROCEDURE update_geography_range
505  *
506  * DESCRIPTION
507  *     Updates Geography range
508  *
509  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
510  *
511  * ARGUMENTS
512  *   IN:
513  *     p_init_msg_list                Initialize message stack if it is set to
514  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
515  *     geography_id
516  *     geography_from
517  *     start_date
518  *     end_date
519  *
520  *   IN/OUT:
521  *     p_object_version_number
522  *   OUT:
523  *
524  *     x_return_status                Return status after the call. The status can
525  *                                    be FND_API.G_RET_STS_SUCCESS (success),
526  *                                    FND_API.G_RET_STS_ERROR (error),
527  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
528  *     x_msg_count                    Number of messages in message stack.
529  *     x_msg_data                     Message text if x_msg_count is 1.
530  *
531  * NOTES
532  *
533  * MODIFICATION HISTORY
534  *     06-20-2005    Kate Shan           o Created.
535  *
536  */
537 PROCEDURE update_geography_range (
538     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
539     p_geography_id              IN        NUMBER,
540     p_geography_from            IN        VARCHAR2,
541     p_start_date                IN        DATE,
542     p_end_date                  IN        DATE,
543     p_object_version_number     IN OUT  NOCOPY   NUMBER,
544     x_return_status             OUT     NOCOPY   VARCHAR2,
545     x_msg_count                 OUT     NOCOPY   NUMBER,
546     x_msg_data                  OUT     NOCOPY   VARCHAR2
547 ) IS
548 BEGIN
549     HZ_GEOGRAPHY_PUB.update_geography_range(
550       p_init_msg_list => p_init_msg_list,
551       p_geography_id => p_geography_id,
552       p_geography_from => p_geography_from,
553       p_start_date => p_start_date,
554       p_end_date => p_end_date,
555       p_object_version_number => p_object_version_number,
556       x_return_status => x_return_status,
557       x_msg_count => x_msg_count,
558       x_msg_data => x_msg_data
559     );
560 END update_geography_range;
561 
562 
563 /**
564  * PROCEDURE create_zone_relation
565  *
566  * DESCRIPTION
567  *     Creates Zone Relation.
568  *
569  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
570  *
571  * ARGUMENTS
572  *   IN:
573  *     p_init_msg_list                Initialize message stack if it is set to
574  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
575  *     p_geography_id
576  *     p_zone_relation_tbl            Zone relation table of records.
577  *   IN/OUT:
578  *   OUT:
579  *
580  *     x_return_status                Return status after the call. The status can
581  *                                    be FND_API.G_RET_STS_SUCCESS (success),
582  *                                    FND_API.G_RET_STS_ERROR (error),
586  *
583  *                                    FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
584  *     x_msg_count                    Number of messages in message stack.
585  *     x_msg_data                     Message text if x_msg_count is 1.
587  * NOTES
588  *
589  * MODIFICATION HISTORY
590  *     06-20-2005    Kate Shan           o Created.
591  *     10-25-2005    Idris Ali           o Bug 4684003:Modified code to pass supplied value for
592  *                                          end_date and start_date to Hz_geogrpahy_pub.create_zone_relation procedure
593  *                                          instead of defaulting it.
594  *
595  */
596 
597 PROCEDURE create_zone_relation(
598     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
599     p_geography_id              IN         NUMBER,
600     p_zone_relation_tbl         IN         ZONE_RELATION_TBL_TYPE,
601     p_created_by_module           IN         VARCHAR2,
602     p_application_id	        IN         NUMBER,
603     x_return_status             OUT   NOCOPY     VARCHAR2,
604     x_msg_count                 OUT   NOCOPY     NUMBER,
605     x_msg_data                  OUT   NOCOPY     VARCHAR2
606  ) IS
607    l_zone_relation_tbl HZ_GEOGRAPHY_PUB.ZONE_RELATION_TBL_TYPE;
608  BEGIN
609 
610      FOR i in 1 .. p_zone_relation_tbl.count LOOP
611        l_zone_relation_tbl(i).included_geography_id := p_zone_relation_tbl(i).included_geography_id;
612        l_zone_relation_tbl(i).geography_from := p_zone_relation_tbl(i).geography_from;
613        l_zone_relation_tbl(i).geography_to := p_zone_relation_tbl(i).geography_to;
614        l_zone_relation_tbl(i).identifier_type := p_zone_relation_tbl(i).identifier_type;
615        l_zone_relation_tbl(i).geography_type := p_zone_relation_tbl(i).geography_type;
616 
617        IF p_zone_relation_tbl(i).start_date = fnd_api.g_miss_date or p_zone_relation_tbl(i).start_date is null or
618           p_zone_relation_tbl(i).start_date = to_date(null)
619        THEN
620           l_zone_relation_tbl(i).start_date :=sysdate;
621        ELSE
622           l_zone_relation_tbl(i).start_date := p_zone_relation_tbl(i).start_date;
623        END IF;
624        IF p_zone_relation_tbl(i).end_date = fnd_api.g_miss_date or p_zone_relation_tbl(i).end_date is null
625        THEN
626           l_zone_relation_tbl(i).end_date := to_date('31-12-4712','DD-MM-YYYY');
627        ELSE
628           l_zone_relation_tbl(i).end_date := p_zone_relation_tbl(i).end_date;
629        END IF;
630 
631      END LOOP;
632 
633      HZ_GEOGRAPHY_PUB.create_zone_relation(
634        p_init_msg_list => p_init_msg_list,
635        p_geography_id => p_geography_id,
636        p_zone_relation_tbl => l_zone_relation_tbl,
637        p_created_by_module => p_created_by_module,
638        p_application_id => p_application_id,
639        x_return_status => x_return_status,
640        x_msg_count => x_msg_count,
641        x_msg_data => x_msg_data
642      );
643  END create_zone_relation;
644 
645 
646 /**
647  * PROCEDURE create_zone
648  *
649  * DESCRIPTION
650  *     Creates Zone
651  *
652  * EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
653  *
654  * ARGUMENTS
655  *   IN:
656  *     p_init_msg_list                Initialize message stack if it is set to
657  *                                    FND_API.G_TRUE. Default is FND_API.G_FALSE.
658  *     p_zone_type
659  *     p_zone_name
660  *     p_zone_code
661  *     p_start_date
662  *     p_end_date
663  *     p_geo_data_provider
664  *     p_zone_relation_tbl           table of records to create relationships
665  *     p_timezone_code
666  *     p_created_by_module
667  *     p_application_id
668  *     p_program_login_id
669  *
670  *     OUT:
671  *      x_return_status
672  *                                              Return status after the call. The status can
673  *      					be FND_API.G_RET_STS_SUCCESS (success),
674  *                                              FND_API.G_RET_STS_ERROR (error),
675  *                                              FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
676  *      x_msg_count                             Number of messages in message stack.
677  *      x_msg_data                              Message text if x_msg_count is 1.
678  *
679  * NOTES
680  *
681  * MODIFICATION HISTORY
682  *     06-20-2005    Kate Shan           o Created.
683  *     10-25-2005    Idris Ali           o Bug 4684003:Modified code to pass supplied value for
684  *                                          end_date and start_date to Hz_geogrpahy_pub.create_zone procedure
685  *                                          instead of defaulting it.
686  *
687  */
688 
689 PROCEDURE create_zone(
690     p_init_msg_list             IN         VARCHAR2 := FND_API.G_FALSE,
691     p_zone_type                 IN         VARCHAR2,
692     p_zone_name                 IN         VARCHAR2,
693     p_zone_code                 IN         VARCHAR2,
694     p_zone_code_type            IN         VARCHAR2,
695     p_start_date                IN         DATE ,
696     p_end_date                  IN         DATE ,
697     p_geo_data_provider         IN         VARCHAR2 ,
698     p_language_code             IN         VARCHAR2,
699     p_zone_relation_tbl         IN         ZONE_RELATION_TBL_TYPE,
700 --    p_geometry                  IN         MDSYS.SDO_GEOMETRY,
701     p_timezone_code             IN         VARCHAR2,
702     x_geography_id              OUT  NOCOPY NUMBER,
703     p_created_by_module         IN         VARCHAR2,
704     p_application_id	        IN         NUMBER,
705     x_return_status             OUT   NOCOPY     VARCHAR2,
706     x_msg_count                 OUT   NOCOPY     NUMBER,
707     x_msg_data                  OUT   NOCOPY     VARCHAR2
708 ) IS
709    l_zone_relation_tbl HZ_GEOGRAPHY_PUB.ZONE_RELATION_TBL_TYPE;
710 BEGIN
711 
712   FOR i in 1 .. p_zone_relation_tbl.count LOOP
713        l_zone_relation_tbl(i).included_geography_id := p_zone_relation_tbl(i).included_geography_id;
714        l_zone_relation_tbl(i).geography_from := p_zone_relation_tbl(i).geography_from;
715        l_zone_relation_tbl(i).geography_to := p_zone_relation_tbl(i).geography_to;
716        l_zone_relation_tbl(i).identifier_type := p_zone_relation_tbl(i).identifier_type;
717        l_zone_relation_tbl(i).geography_type := p_zone_relation_tbl(i).geography_type;
718 
719       IF p_zone_relation_tbl(i).start_date = fnd_api.g_miss_date or p_zone_relation_tbl(i).start_date is null OR  --Bug 4684003
720           p_zone_relation_tbl(i).start_date = to_date(NULL) THEN
721          l_zone_relation_tbl(i).start_date :=sysdate;
722        ELSE
723          l_zone_relation_tbl(i).start_date := p_zone_relation_tbl(i).start_date;
724        END IF;
725        IF p_zone_relation_tbl(i).end_date = fnd_api.g_miss_date or p_zone_relation_tbl(i).end_date is null THEN
726          l_zone_relation_tbl(i).end_date := to_date('31-12-4712','DD-MM-YYYY');
727        ELSE
728          l_zone_relation_tbl(i).end_date := p_zone_relation_tbl(i).end_date;
729        END IF;
730   END LOOP;
731 
732   HZ_GEOGRAPHY_PUB.create_zone(
733     p_init_msg_list => p_init_msg_list,
734     p_zone_type => p_zone_type,
735     p_zone_name => p_zone_name,
736     p_zone_code => p_zone_code,
737     p_zone_code_type => p_zone_code_type,
738     p_start_date => p_start_date,
739     p_end_date => p_end_date,
740     p_geo_data_provider => p_geo_data_provider,
741     p_language_code => p_language_code,
742     p_zone_relation_tbl => l_zone_relation_tbl,
743     p_geometry => null,
744     p_timezone_code => p_timezone_code,
745     x_geography_id => x_geography_id,
746     p_created_by_module => p_created_by_module,
747     p_application_id => p_application_id,
748     x_return_status => x_return_status,
749     x_msg_count => x_msg_count,
750     x_msg_data => x_msg_data
751   );
752 END create_zone;
753 
754 
755 END HZ_GEOGRAPHY_PUB_UIW;