DBA Data[Home] [Help]

PACKAGE BODY: APPS.IBE_DSP_MSITE_SCT_SECT_PVT

Source


1 PACKAGE BODY IBE_DSP_MSITE_SCT_SECT_PVT AS
2 /* $Header: IBEVCMSB.pls 120.3 2006/06/30 22:33:06 abhandar noship $ */
3 
4 
5   --
6   --
7   -- Start of Comments
8   --
9   -- NAME
10   --   IBE_DSP_MSITE_SCT_SECT_PVT
11   --
12   -- PURPOSE
13   --   Private API for saving, retrieving and updating mini site
14   --   section sections.
15   --
16   -- NOTES
17   --   This is a pulicly accessible package.  It should be used by all
18   --   sources for saving, retrieving and updating mini site section
19   --   sections
20 
21   -- HISTORY
22   --   11/28/99           VPALAIYA         Created
23   --   12/12/02           SCHAK         Modified for NOCOPY (Bug # 2691704) Changes.
24   -- **************************************************************************
25 
26 G_PKG_NAME  CONSTANT VARCHAR2(30):= 'IBE_DSP_MSITE_SCT_SECT_PVT';
27 G_FILE_NAME CONSTANT VARCHAR2(12):= 'IBEVCMSB.pls';
28 
29 
30 -- ****************************************************************************
31 -- ****************************************************************************
32 --    TABLE HANDLERS
33 --      1. insert_row
34 --      2. update_row
35 --      3. delete_row
36 -- ****************************************************************************
37 -- ****************************************************************************
38 
39 
40 -- ****************************************************************************
41 -- insert row into mini site section-section
42 -- ****************************************************************************
43 
44 PROCEDURE insert_row
45   (
46    p_mini_site_section_section_id       IN NUMBER,
47    p_object_version_number              IN NUMBER,
48    p_mini_site_id                       IN NUMBER,
49    p_parent_section_id                  IN NUMBER,
50    p_child_section_id                   IN NUMBER,
51    p_start_date_active                  IN DATE,
52    p_end_date_active                    IN DATE,
53    p_level_number                       IN NUMBER,
54    p_sort_order                         IN NUMBER,
55    p_concat_ids                         IN VARCHAR2,
56    p_creation_date                      IN DATE,
57    p_created_by                         IN NUMBER,
58    p_last_update_date                   IN DATE,
59    p_last_updated_by                    IN NUMBER,
60    p_last_update_login                  IN NUMBER,
61    x_rowid                              OUT NOCOPY VARCHAR2,
62    x_mini_site_section_section_id       OUT NOCOPY NUMBER
63   )
64 IS
65   CURSOR c IS SELECT rowid FROM ibe_dsp_msite_sct_sects
66     WHERE mini_site_section_section_id = x_mini_site_section_section_id;
67   CURSOR c2 IS SELECT ibe_dsp_msite_sct_sects_s1.nextval FROM dual;
68 
69 BEGIN
70 
71   -- Primary key validation check
72   x_mini_site_section_section_id := p_mini_site_section_section_id;
73   IF ((x_mini_site_section_section_id IS NULL) OR
74       (x_mini_site_section_section_id = FND_API.G_MISS_NUM))
75   THEN
76     OPEN c2;
77     FETCH c2 INTO x_mini_site_section_section_id;
78     CLOSE c2;
79   END IF;
80 
81   -- insert base
82   INSERT INTO ibe_dsp_msite_sct_sects
83     (
84     mini_site_section_section_id,
85     object_version_number,
86     mini_site_id,
87     parent_section_id,
88     child_section_id,
89     start_date_active,
90     end_date_active,
91     level_number,
92     sort_order,
93     concat_ids,
94     creation_date,
95     created_by,
96     last_update_date,
97     last_updated_by,
98     last_update_login
99     )
100     VALUES
101     (
102     x_mini_site_section_section_id,
103     p_object_version_number,
104     p_mini_site_id,
105     decode(p_parent_section_id, FND_API.G_MISS_NUM, NULL, p_parent_section_id),
106     p_child_section_id,
107     p_start_date_active,
108     decode(p_end_date_active, FND_API.G_MISS_DATE, NULL, p_end_date_active),
109     decode(p_level_number, FND_API.G_MISS_NUM, NULL, p_level_number),
110     decode(p_sort_order, FND_API.G_MISS_NUM, NULL, p_sort_order),
111     decode(p_concat_ids, FND_API.G_MISS_CHAR, NULL, p_concat_ids),
112     decode(p_creation_date, FND_API.G_MISS_DATE, sysdate, NULL, sysdate,
113            p_creation_date),
114     decode(p_created_by, FND_API.G_MISS_NUM, FND_GLOBAL.user_id,
115            NULL, FND_GLOBAL.user_id, p_created_by),
116     decode(p_last_update_date, FND_API.G_MISS_DATE, sysdate, NULL, sysdate,
117            p_last_update_date),
118     decode(p_last_updated_by, FND_API.G_MISS_NUM, FND_GLOBAL.user_id,
119            NULL, FND_GLOBAL.user_id, p_last_updated_by),
120     decode(p_last_update_login, FND_API.G_MISS_NUM, FND_GLOBAL.login_id,
121            NULL, FND_GLOBAL.login_id, p_last_update_login)
122     );
123 
124   OPEN c;
125   FETCH c INTO x_rowid;
126   IF (c%NOTFOUND)
127   THEN
128     CLOSE c;
129     RAISE NO_DATA_FOUND;
130   END IF;
131   CLOSE c;
132 
133 END insert_row;
134 
135 -- ****************************************************************************
136 -- update row
137 -- ****************************************************************************
138 
139 PROCEDURE update_row
140   (
141   p_mini_site_section_section_id        IN NUMBER,
142   p_object_version_number               IN NUMBER   := FND_API.G_MISS_NUM,
143   p_start_date_active                   IN DATE,
144   p_end_date_active                     IN DATE,
145   p_level_number                        IN NUMBER,
146   p_sort_order                          IN NUMBER,
147   p_concat_ids                          IN VARCHAR2,
148   p_last_update_date                    IN DATE,
149   p_last_updated_by                     IN NUMBER,
150   p_last_update_login                   IN NUMBER
151   )
152 IS
153 BEGIN
154 
155   -- update base
156   UPDATE ibe_dsp_msite_sct_sects SET
157     object_version_number = object_version_number + 1,
158     level_number = decode(p_level_number, FND_API.G_MISS_NUM,
159                           level_number, p_level_number),
160     sort_order = decode(p_sort_order, FND_API.G_MISS_NUM,
161                         sort_order, p_sort_order),
162     concat_ids = decode(p_concat_ids, FND_API.G_MISS_CHAR,
163                         concat_ids, p_concat_ids),
164     start_date_active = decode(p_start_date_active, FND_API.G_MISS_DATE,
165                                start_date_active, p_start_date_active),
166     end_date_active = decode(p_end_date_active, FND_API.G_MISS_DATE,
167                              end_date_active, p_end_date_active),
168     last_update_date = decode(p_last_update_date, FND_API.G_MISS_DATE,
169                               sysdate, NULL, sysdate, p_last_update_date),
170     last_updated_by = decode(p_last_updated_by, FND_API.G_MISS_NUM,
171                              FND_GLOBAL.user_id, NULL, FND_GLOBAL.user_id,
172                              p_last_updated_by),
173     last_update_login = decode(p_last_update_login, FND_API.G_MISS_NUM,
174                                FND_GLOBAL.login_id, NULL,
175                                FND_GLOBAL.login_id, p_last_update_login)
176     WHERE mini_site_section_section_id = p_mini_site_section_section_id
177       AND object_version_number = decode(p_object_version_number,
178                                          FND_API.G_MISS_NUM,
179                                          object_version_number,
180                                          p_object_version_number);
181 
182   IF (sql%NOTFOUND) THEN
183     RAISE NO_DATA_FOUND;
184   END IF;
185 
186 END update_row;
187 
188 
189 -- ****************************************************************************
190 -- delete row
191 -- ****************************************************************************
192 
193 PROCEDURE delete_row
194   (
195    p_mini_site_section_section_id IN NUMBER
196   )
197 IS
198 BEGIN
199 
200   DELETE FROM ibe_dsp_msite_sct_sects
201     WHERE mini_site_section_section_id = p_mini_site_section_section_id;
202 
203   IF (sql%NOTFOUND) THEN
204     RAISE NO_DATA_FOUND;
205   END IF;
206 
207 END delete_row;
208 
209 --
210 -- To be called from ibemste.lct only
211 --
212 PROCEDURE load_row
213   (
214    p_owner                              IN VARCHAR2,
215    p_mini_site_section_section_id       IN NUMBER,
216    p_object_version_number              IN NUMBER   := FND_API.G_MISS_NUM,
217    p_mini_site_id                       IN NUMBER,
218    p_parent_section_id                  IN NUMBER,
219    p_child_section_id                   IN NUMBER,
220    p_start_date_active                  IN DATE,
221    p_end_date_active                    IN DATE,
222    p_level_number                       IN NUMBER,
223    p_sort_order                         IN NUMBER,
224    p_concat_ids                         IN VARCHAR2,
225    P_LAST_UPDATE_DATE                   IN VARCHAR2,
226    P_CUSTOM_MODE                        IN VARCHAR2
227   )
228 IS
229   l_user_id                        NUMBER := 0;
230   l_rowid                          VARCHAR2(256);
231   l_mini_site_section_section_id   NUMBER;
232   l_object_version_number          NUMBER := 1;
233   f_luby    number;  -- entity owner in file
234   f_ludate  date;    -- entity update date in file
235   db_luby   number;  -- entity owner in db
236   db_ludate date;    -- entity update date in db
237 
238 BEGIN
239   f_luby := fnd_load_util.owner_id(P_OWNER);
240   f_ludate := nvl(to_date(P_LAST_UPDATE_DATE, 'YYYY/MM/DD'), sysdate);
241   select LAST_UPDATED_BY, LAST_UPDATE_DATE
242    	into db_luby, db_ludate
243   	from ibe_dsp_msite_sct_sects
244    	where mini_site_id = p_mini_site_id and child_section_id=p_child_section_id;
245 
246 
247   IF ((p_object_version_number IS NOT NULL) AND
248       (p_object_version_number <> FND_API.G_MISS_NUM))
249   THEN
250     l_object_version_number := p_object_version_number;
251   END IF;
252 
253 
254    IF (fnd_load_util.upload_test(f_luby, f_ludate, db_luby, db_ludate, P_CUSTOM_MODE)) then
255     update_row
256       (
257       p_mini_site_section_section_id        => p_mini_site_section_section_id,
258       p_object_version_number               => p_object_version_number,
259       p_start_date_active                   => p_start_date_active,
260       p_end_date_active                     => p_end_date_active,
261       p_level_number                        => p_level_number,
262       p_sort_order                          => p_sort_order,
263       p_concat_ids                          => p_concat_ids,
264       p_last_update_date                    => f_ludate,--sysdate,
265       p_last_updated_by                     => f_luby,--l_user_id,
266       p_last_update_login                   => 0
267       );
268    END IF;
269   EXCEPTION
270 
271      WHEN NO_DATA_FOUND THEN
272 
273        insert_row
274        (
275        p_mini_site_section_section_id       => p_mini_site_section_section_id,
276        p_object_version_number              => l_object_version_number,
277        p_mini_site_id                       => p_mini_site_id,
278        p_parent_section_id                  => p_parent_section_id,
279        p_child_section_id                   => p_child_section_id,
280        p_start_date_active                  => p_start_date_active,
281        p_end_date_active                    => p_end_date_active,
282        p_level_number                       => p_level_number,
283        p_sort_order                         => p_sort_order,
284        p_concat_ids                         => p_concat_ids,
285        p_creation_date                      => f_ludate,--sysdate,
286        p_created_by                         => f_luby,--l_user_id,
287        p_last_update_date                   => f_ludate,--sysdate,
288        p_last_updated_by                    => f_luby,--l_user_id,
289        p_last_update_login                  => 0,
290        x_rowid                              => l_rowid,
291        x_mini_site_section_section_id       => l_mini_site_section_section_id
292        );
293 
294 END load_row;
295 
296 
297 -- ****************************************************************************
298 --*****************************************************************************
299 --
300 --APIs
301 --
302 -- 1. Create_MSite_Section_Section
303 -- 2. Update_MSite_Section_Section
304 -- 3. Delete_MSite_Section_Section
305 -- 4. Check_Duplicate_Entry
306 --
307 --*****************************************************************************
308 --*****************************************************************************
309 
310 
311 --*****************************************************************************
312 -- PROCEDURE Check_Duplicate_Entry()
313 --*****************************************************************************
314 
315 --
316 -- x_return_status = FND_API.G_RET_STS_SUCCESS, if the section is duplicate
317 -- x_return_status = FND_API.G_RET_STS_ERROR, if the section is not duplicate
318 --
319 --
320 PROCEDURE Check_Duplicate_Entry
321   (
322    p_init_msg_list                IN VARCHAR2 := FND_API.G_FALSE,
323    p_mini_site_id                 IN NUMBER,
324    p_parent_section_id            IN NUMBER,
325    p_child_section_id             IN NUMBER,
326    x_return_status                OUT NOCOPY VARCHAR2,
327    x_msg_count                    OUT NOCOPY NUMBER,
328    x_msg_data                     OUT NOCOPY VARCHAR2
329   )
330 IS
331   l_api_name              CONSTANT VARCHAR2(30) := 'Check_Duplicate_Entry';
332   l_api_version           CONSTANT NUMBER       := 1.0;
333 
334   l_tmp_msite_sct_sect_id NUMBER;
335 BEGIN
336 
337   -- Initialize message list if p_init_msg_list is set to TRUE.
338   IF FND_API.to_Boolean(p_init_msg_list) THEN
339     FND_MSG_PUB.initialize;
340   END IF;
341 
342   -- Initialize API return status to error, i.e, its not duplicate
343   x_return_status := FND_API.G_RET_STS_ERROR;
344 
345   -- Check duplicate entry
346   BEGIN
347 
348     IF (p_parent_section_id IS NOT NULL) THEN
349 
350       SELECT mini_site_section_section_id INTO l_tmp_msite_sct_sect_id
351         FROM  ibe_dsp_msite_sct_sects
352         WHERE mini_site_id = p_mini_site_id
353           AND parent_section_id = p_parent_section_id
354           AND child_section_id = p_child_section_id;
355 
356     ELSE
357 
358       SELECT mini_site_section_section_id INTO l_tmp_msite_sct_sect_id
359         FROM  ibe_dsp_msite_sct_sects
360         WHERE mini_site_id = p_mini_site_id
361           AND parent_section_id IS NULL
362           AND child_section_id = p_child_section_id;
363 
364     END IF;
365 
366   EXCEPTION
367 
368      WHEN NO_DATA_FOUND THEN
369        -- not duplicate
370        -- do nothing
371        NULL;
372 
373      WHEN OTHERS THEN
374        FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
375        FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
376        FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
377        FND_MESSAGE.Set_Token('REASON', SQLERRM);
378        FND_MSG_PUB.Add;
379 
380        RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
381 
382   END;
383 
384   IF (l_tmp_msite_sct_sect_id IS NOT NULL) THEN
385     -- found duplicate
386     RAISE FND_API.G_EXC_ERROR;
387   END IF;
388 
389 EXCEPTION
390 
391    WHEN FND_API.G_EXC_ERROR THEN
392      x_return_status := FND_API.G_RET_STS_SUCCESS; -- found duplicate
393      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
394                                p_data       =>      x_msg_data,
395                                p_encoded    =>      'F');
396 
397    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
398      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
399      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
403    WHEN OTHERS THEN
400                                p_data       =>      x_msg_data,
401                                p_encoded    =>      'F');
402 
404      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
405      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
406      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
407      FND_MESSAGE.Set_Token('REASON', SQLERRM);
408      FND_MSG_PUB.Add;
409 
410      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
411 
412      IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
413      THEN
414        FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
415      END IF;
416 
417      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
418                                p_data       =>      x_msg_data,
419                                p_encoded    =>      'F');
420 
421 END Check_Duplicate_Entry;
422 
423 
424 --*****************************************************************************
425 -- PROCEDURE Validate_Create()
426 --*****************************************************************************
427 -- IF  x_return_status := FND_API.G_RET_STS_ERROR, then invalid
428 -- IF  x_return_status := FND_API.G_RET_STS_SUCCESS, then valid
429 
430 PROCEDURE Validate_Create
431   (
432    p_init_msg_list                  IN VARCHAR2 := FND_API.G_FALSE,
433    p_validation_level               IN NUMBER   := FND_API.G_VALID_LEVEL_FULL,
434    p_mini_site_id                   IN NUMBER,
435    p_parent_section_id              IN NUMBER,
436    p_child_section_id               IN NUMBER,
437    p_start_date_active              IN DATE,
438    p_end_date_active                IN DATE,
439    p_level_number                   IN NUMBER,
440    p_sort_order                     IN NUMBER,
441    p_concat_ids                     IN VARCHAR2,
442    x_return_status                  OUT NOCOPY VARCHAR2,
443    x_msg_count                      OUT NOCOPY NUMBER,
444    x_msg_data                       OUT NOCOPY VARCHAR2
445   )
446 IS
447   l_api_name                CONSTANT VARCHAR2(30) := 'Validate_Create';
448   l_api_version             CONSTANT NUMBER       := 1.0;
449   l_msg_count               NUMBER;
450   l_msg_data                VARCHAR2(2000);
451 
452   l_mini_site_id            NUMBER;
453   l_parent_section_id       NUMBER;
454   l_child_section_id        NUMBER;
455   l_return_status           VARCHAR2(1);
456 BEGIN
457 
458   -- Initialize message list if p_init_msg_list is set to TRUE.
459   IF FND_API.to_Boolean(p_init_msg_list) THEN
460     FND_MSG_PUB.initialize;
461   END IF;
462 
463   -- Initialize API return status to success
464   x_return_status := FND_API.G_RET_STS_SUCCESS;
465 
466   --
467   -- Check null values for required fields
468   --
469 
470   -- mini site id
471   IF ((p_mini_site_id IS NULL) OR
472       (p_mini_site_id = FND_API.G_MISS_NUM))
473   THEN
474     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_MSITE_ID');
475     FND_MSG_PUB.Add;
476     RAISE FND_API.G_EXC_ERROR;
477   END IF;
478 
479   -- child section id
480   IF ((p_child_section_id IS NULL) OR
481       (p_child_section_id = FND_API.G_MISS_NUM))
482   THEN
483     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_CHILD_SCT_ID');
484     FND_MSG_PUB.Add;
485     RAISE FND_API.G_EXC_ERROR;
486   END IF;
487 
488   -- start_date_active
489   IF ((p_start_date_active IS NULL) OR
490       (p_start_date_active = FND_API.G_MISS_DATE))
491   THEN
492     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_START_DATE');
493     FND_MSG_PUB.Add;
494     RAISE FND_API.G_EXC_ERROR;
495   END IF;
496 
497   --
498   -- non-null field validation
499   --
500 
501   -- level number
502   IF ((p_level_number IS NOT NULL) AND
503       (p_level_number <> FND_API.G_MISS_NUM))
504   THEN
505     IF(p_level_number < 0) THEN
506       FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_SCT_LVL_NUM');
507       FND_MSG_PUB.Add;
508       RAISE FND_API.G_EXC_ERROR;
509     END IF;
510   END IF;
511 
512   -- sort order
513   IF ((p_sort_order IS NOT NULL) AND
514       (p_sort_order <> FND_API.G_MISS_NUM))
515   THEN
516     IF(p_sort_order < 0) THEN
517       FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_SCT_SORT_ORDER');
518       FND_MSG_PUB.Add;
519       RAISE FND_API.G_EXC_ERROR;
520     END IF;
521   END IF;
522 
523   --
524   -- Foreign key integrity constraint check
525   --
526 
527   -- mini site id
528   -- note that mini site id cannot be null due to previous checks
529   BEGIN
530     SELECT msite_id INTO l_mini_site_id FROM ibe_msites_b
531       WHERE msite_id = p_mini_site_id and site_type = 'I';
532   EXCEPTION
533      WHEN NO_DATA_FOUND THEN
534        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_SCT_NO_MSITE_ID');
535        FND_MESSAGE.Set_Token('MINI_SITE_ID', p_mini_site_id);
536        FND_MSG_PUB.Add;
537        RAISE FND_API.G_EXC_ERROR;
538      WHEN OTHERS THEN
539        FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
540        FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
541        FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
542        FND_MESSAGE.Set_Token('REASON', SQLERRM);
543        FND_MSG_PUB.Add;
547        FND_MSG_PUB.Add;
544 
545        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_SCT_GET_MSITE_ID');
546        FND_MESSAGE.Set_Token('MINI_SITE_ID', p_mini_site_id);
548        RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
549   END;
550 
551   -- parent section id
552   IF ((p_parent_section_id IS NOT NULL) AND
553       (p_parent_section_id <> FND_API.G_MISS_NUM))
554   THEN
555     BEGIN
556       SELECT section_id INTO l_parent_section_id FROM ibe_dsp_sections_b
557         WHERE section_id = p_parent_section_id;
558     EXCEPTION
559        WHEN NO_DATA_FOUND THEN
560          FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_SCT_NO_SCT_ID');
561          FND_MESSAGE.Set_Token('SECTION_ID', p_parent_section_id);
562          FND_MSG_PUB.Add;
563          RAISE FND_API.G_EXC_ERROR;
564        WHEN OTHERS THEN
565          FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
566          FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
567          FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
568          FND_MESSAGE.Set_Token('REASON', SQLERRM);
569          FND_MSG_PUB.Add;
570 
571          FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_SCT_GET_SCT_ID');
572          FND_MESSAGE.Set_Token('SECTION_ID', p_parent_section_id);
573          FND_MSG_PUB.Add;
574          RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
575     END;
576   END IF;
577 
578   -- child section id
579   -- note that child section id cannot be null due to previous checks
580   BEGIN
581     SELECT section_id INTO l_child_section_id FROM ibe_dsp_sections_b
582       WHERE section_id = p_child_section_id;
583   EXCEPTION
584      WHEN NO_DATA_FOUND THEN
585        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_SCT_NO_SCT_ID');
586        FND_MESSAGE.Set_Token('SECTION_ID', p_child_section_id);
587        FND_MSG_PUB.Add;
588        RAISE FND_API.G_EXC_ERROR;
589      WHEN OTHERS THEN
590        FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
591        FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
592        FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
593        FND_MESSAGE.Set_Token('REASON', SQLERRM);
594        FND_MSG_PUB.Add;
595 
596        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_SCT_GET_SCT_ID');
597        FND_MESSAGE.Set_Token('SECTION_ID', p_child_section_id);
598        FND_MSG_PUB.Add;
599        RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
600   END;
601 
602   -- Validate if the entry is duplicate
603   Check_Duplicate_Entry(p_init_msg_list                 => FND_API.G_FALSE,
604                         p_mini_site_id                  => p_mini_site_id,
605                         p_parent_section_id             => p_parent_section_id,
606                         p_child_section_id              => p_child_section_id,
607                         x_return_status                 => l_return_status,
608                         x_msg_count                     => l_msg_count,
609                         x_msg_data                      => l_msg_data);
610 
611   IF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
612     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
613   ELSIF (l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
614     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_DUPLICATE_ENTRY');
615     FND_MSG_PUB.Add;
616     RAISE FND_API.G_EXC_ERROR;            -- duplicate entry
617   END IF;
618 
619 EXCEPTION
620 
621    WHEN FND_API.G_EXC_ERROR THEN
622      x_return_status := FND_API.G_RET_STS_ERROR;
623      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
624                                p_data       =>      x_msg_data,
625                                p_encoded    =>      'F');
626 
627    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
628      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
629      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
630                                p_data       =>      x_msg_data,
631                                p_encoded    =>      'F');
632 
633    WHEN OTHERS THEN
634      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
635      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
636      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
637      FND_MESSAGE.Set_Token('REASON', SQLERRM);
638      FND_MSG_PUB.Add;
639 
640      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
641 
642      IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
643      THEN
644        FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
645      END IF;
646 
647      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
648                                p_data       =>      x_msg_data,
649                                p_encoded    =>      'F');
650 
651 END Validate_Create;
652 
653 
654 --*****************************************************************************
655 -- PROCEDURE Validate_Update()
656 --*****************************************************************************
657 -- IF  x_return_status := FND_API.G_RET_STS_ERROR, then invalid
658 -- IF  x_return_status := FND_API.G_RET_STS_SUCCESS, then valid
659 
660 PROCEDURE Validate_Update
661   (
662    p_init_msg_list                  IN VARCHAR2 := FND_API.G_FALSE,
663    p_validation_level               IN NUMBER   := FND_API.G_VALID_LEVEL_FULL,
664    p_mini_site_section_section_id   IN NUMBER,
665    p_object_version_number          IN NUMBER,
666    p_start_date_active              IN DATE,
667    p_end_date_active                IN DATE,
671    x_return_status                  OUT NOCOPY VARCHAR2,
668    p_level_number                   IN NUMBER,
669    p_sort_order                     IN NUMBER,
670    p_concat_ids                     IN VARCHAR2,
672    x_msg_count                      OUT NOCOPY NUMBER,
673    x_msg_data                       OUT NOCOPY VARCHAR2
674   )
675 IS
676   l_api_name              CONSTANT VARCHAR2(30) := 'Validate_Update';
677   l_api_version           CONSTANT NUMBER       := 1.0;
678   l_msg_count             NUMBER;
679   l_msg_data              VARCHAR2(2000);
680 
681   l_msite_sct_sect_id     NUMBER;
682   l_mini_site_id          NUMBER;
683   l_parent_section_id     NUMBER;
684   l_child_section_id      NUMBER;
685   l_return_status         VARCHAR2(1);
686 
687 BEGIN
688 
689   -- Initialize message list if p_init_msg_list is set to TRUE.
690   IF FND_API.to_Boolean(p_init_msg_list) THEN
691     FND_MSG_PUB.initialize;
692   END IF;
693 
694   -- Initialize API return status to success
695   x_return_status := FND_API.G_RET_STS_SUCCESS;
696 
697   --
698   -- Check null values for required fields
699   --
700 
701   -- mini_site_section_section_id
702   IF (p_mini_site_section_section_id IS NULL) THEN
703     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_NULL_PRIMARY_KEY');
704     FND_MSG_PUB.Add;
705     RAISE FND_API.G_EXC_ERROR;
706   END IF;
707 
708   -- start_date_active
709   IF (p_start_date_active IS NULL) THEN
710     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_START_DATE');
711     FND_MSG_PUB.Add;
712     RAISE FND_API.G_EXC_ERROR;
713   END IF;
714 
715   --
716   -- non-null field validation
717   --
718 
719   -- level number
720   IF ((p_level_number IS NOT NULL) AND
721       (p_level_number <> FND_API.G_MISS_NUM))
722   THEN
723     IF(p_level_number < 0) THEN
724       FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_SCT_LVL_NUM');
725       FND_MSG_PUB.Add;
726       RAISE FND_API.G_EXC_ERROR;
727     END IF;
728   END IF;
729 
730   -- sort order
731   IF ((p_sort_order IS NOT NULL) AND
732       (p_sort_order <> FND_API.G_MISS_NUM))
733   THEN
734     IF(p_sort_order < 0) THEN
735       FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_INVALID_SCT_SORT_ORDER');
736       FND_MSG_PUB.Add;
737       RAISE FND_API.G_EXC_ERROR;
738     END IF;
739   END IF;
740 
741 EXCEPTION
742 
743    WHEN FND_API.G_EXC_ERROR THEN
744      x_return_status := FND_API.G_RET_STS_ERROR;
745      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
746                                p_data       =>      x_msg_data,
747                                p_encoded    =>      'F');
748 
749    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
750      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
751      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
752                                p_data       =>      x_msg_data,
753                                p_encoded    =>      'F');
754 
755    WHEN OTHERS THEN
756      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
757      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
758      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
759      FND_MESSAGE.Set_Token('REASON', SQLERRM);
760      FND_MSG_PUB.Add;
761 
762      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
763 
764      IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
765      THEN
766        FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
767      END IF;
768 
769      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
770                                p_data       =>      x_msg_data,
771                                p_encoded    =>      'F');
772 
773 END Validate_Update;
774 
775 
776 -- ****************************************************************************
777 --*****************************************************************************
778 
779 PROCEDURE Create_MSite_Section_Section
780   (
781    p_api_version                    IN NUMBER,
782    p_init_msg_list                  IN VARCHAR2 := FND_API.G_FALSE,
783    p_commit                         IN VARCHAR2 := FND_API.G_FALSE,
784    p_validation_level               IN NUMBER   := FND_API.G_VALID_LEVEL_FULL,
785    p_mini_site_id                   IN NUMBER,
786    p_parent_section_id              IN NUMBER   := FND_API.G_MISS_NUM,
787    p_child_section_id               IN NUMBER,
788    p_start_date_active              IN DATE,
789    p_end_date_active                IN DATE     := FND_API.G_MISS_DATE,
790    p_level_number                   IN NUMBER   := FND_API.G_MISS_NUM,
791    p_sort_order                     IN NUMBER   := FND_API.G_MISS_NUM,
792    p_concat_ids                     IN VARCHAR2 := FND_API.G_MISS_CHAR,
793    x_mini_site_section_section_id   OUT NOCOPY NUMBER,
794    x_return_status                  OUT NOCOPY VARCHAR2,
795    x_msg_count                      OUT NOCOPY NUMBER,
796    x_msg_data                       OUT NOCOPY VARCHAR2
797   )
798 IS
799   l_api_name               CONSTANT VARCHAR2(30)
800     := 'Create_MSite_Section_Section';
801   l_api_version            CONSTANT NUMBER       := 1.0;
802   l_msg_count              NUMBER;
803   l_msg_data               VARCHAR2(2000);
807   l_rowid                  VARCHAR2(30);
804   l_return_status          VARCHAR2(1);
805 
806   l_object_version_number  CONSTANT NUMBER       := 1;
808 
809 BEGIN
810 
811   -- Standard Start of API savepoint
812   SAVEPOINT  CREATE_MSITE_SCT_SECT_PVT;
813 
814   -- Standard call to check for call compatibility.
815   IF NOT FND_API.Compatible_API_Call(l_api_version,
816                                      p_api_version,
817                                      l_api_name,
818                                      G_PKG_NAME)
819   THEN
820     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
821   END IF;
822 
823   -- Initialize message list if p_init_msg_list is set to TRUE.
824   IF FND_API.to_Boolean(p_init_msg_list) THEN
825     FND_MSG_PUB.initialize;
826   END IF;
827 
828   -- Initialize API return status to success
829   x_return_status := FND_API.G_RET_STS_SUCCESS;
830 
831   -- API body
832   --  CALL FLOW :
833   -- 1. Validate
834   -- 2. Insert row
835   --
836 
837   --
838   -- 1. Validate
839   --
840   Validate_Create
841     (
842     p_init_msg_list                  => FND_API.G_FALSE,
843     p_validation_level               => p_validation_level,
844     p_mini_site_id                   => p_mini_site_id,
845     p_parent_section_id              => p_parent_section_id,
846     p_child_section_id               => p_child_section_id,
847     p_start_date_active              => p_start_date_active,
848     p_end_date_active                => p_end_date_active,
849     p_level_number                   => p_level_number,
850     p_sort_order                     => p_sort_order,
851     p_concat_ids                     => p_concat_ids,
852     x_return_status                  => l_return_status,
853     x_msg_count                      => l_msg_count,
854     x_msg_data                       => l_msg_data
855     );
856 
857   IF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
858     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
859   ELSIF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
860     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_MSS_INVALID_CREATE');
861     FND_MSG_PUB.Add;
862     RAISE FND_API.G_EXC_ERROR;            -- invalid
863   END IF;
864 
865   --
866   -- 2. Insert row
867   --
868   BEGIN
869     insert_row
870       (
871       FND_API.G_MISS_NUM,
872       l_object_version_number,
873       p_mini_site_id,
874       p_parent_section_id,
875       p_child_section_id,
876       p_start_date_active,
877       p_end_date_active,
878       p_level_number,
879       p_sort_order,
880       p_concat_ids,
881       SYSDATE,
882       FND_GLOBAL.user_id,
883       SYSDATE,
884       FND_GLOBAL.user_id,
885       FND_GLOBAL.login_id,
886       l_rowid,
887       x_mini_site_section_section_id
888       );
889   EXCEPTION
890      WHEN NO_DATA_FOUND THEN
891        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_MSS_INSERT_FAIL');
892        FND_MSG_PUB.Add;
893        RAISE FND_API.G_EXC_ERROR;
894      WHEN OTHERS THEN
895        FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
896        FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
897        FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
898        FND_MESSAGE.Set_Token('REASON', SQLERRM);
899        FND_MSG_PUB.Add;
900 
901        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_MSS_INSERT_FAIL');
902        FND_MSG_PUB.Add;
903        RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
904   END;
905 
906   --
907   -- End of main API body.
908 
909   -- Standard check of p_commit.
910   IF (FND_API.To_Boolean(p_commit)) THEN
911     COMMIT WORK;
912   END IF;
913 
914   -- Standard call to get message count and if count is 1, get message info.
915   FND_MSG_PUB.Count_And_Get(p_count   =>      x_msg_count,
916                             p_data    =>      x_msg_data,
917                             p_encoded =>      'F');
918 
919 EXCEPTION
920 
921    WHEN FND_API.G_EXC_ERROR THEN
922      ROLLBACK TO CREATE_MSITE_SCT_SECT_PVT;
923      x_return_status := FND_API.G_RET_STS_ERROR;
924      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
925                                p_data       =>      x_msg_data,
926                                p_encoded    =>      'F');
927 
928    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
929      ROLLBACK TO CREATE_MSITE_SCT_SECT_PVT;
930      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
931      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
932                                p_data       =>      x_msg_data,
933                                p_encoded    =>      'F');
934 
935    WHEN OTHERS THEN
936      ROLLBACK TO CREATE_MSITE_SCT_SECT_PVT;
937 
938      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
939      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
940      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
941      FND_MESSAGE.Set_Token('REASON', SQLERRM);
942      FND_MSG_PUB.Add;
943 
944      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
945 
946      IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
947      THEN
948        FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
949      END IF;
950 
954 
951      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
952                                p_data       =>      x_msg_data,
953                                p_encoded    =>      'F');
955 END Create_MSite_Section_Section;
956 
957 PROCEDURE Update_MSite_Section_Section
958   (
959    p_api_version                    IN NUMBER,
960    p_init_msg_list                  IN VARCHAR2 := FND_API.G_FALSE,
961    p_commit                         IN VARCHAR2 := FND_API.G_FALSE,
962    p_validation_level               IN NUMBER   := FND_API.G_VALID_LEVEL_FULL,
963    p_mini_site_section_section_id   IN NUMBER   := FND_API.G_MISS_NUM,
964    p_object_version_number          IN NUMBER,
965    p_mini_site_id                   IN NUMBER   := FND_API.G_MISS_NUM,
966    p_parent_section_id              IN NUMBER   := FND_API.G_MISS_NUM,
967    p_child_section_id               IN NUMBER   := FND_API.G_MISS_NUM,
968    p_start_date_active              IN DATE     := FND_API.G_MISS_DATE,
969    p_end_date_active                IN DATE     := FND_API.G_MISS_DATE,
970    p_level_number                   IN NUMBER   := FND_API.G_MISS_NUM,
971    p_sort_order                     IN NUMBER   := FND_API.G_MISS_NUM,
972    p_concat_ids                     IN VARCHAR2 := FND_API.G_MISS_CHAR,
973    x_return_status                  OUT NOCOPY VARCHAR2,
974    x_msg_count                      OUT NOCOPY NUMBER,
975    x_msg_data                       OUT NOCOPY VARCHAR2
976   )
977 IS
978   l_api_name          CONSTANT VARCHAR2(30) := 'Update_MSite_Section_Section';
979   l_api_version       CONSTANT NUMBER       := 1.0;
980   l_msg_count         NUMBER;
981   l_msg_data          VARCHAR2(2000);
982 
983   l_msite_sct_sect_id NUMBER;
984   l_return_status     VARCHAR2(1);
985 
986 BEGIN
987 
988   -- Standard Start of API savepoint
989   SAVEPOINT  UPDATE_MSITE_SCT_SECT_PVT;
990 
991   -- Standard call to check for call compatibility.
992   IF NOT FND_API.Compatible_API_Call(l_api_version,
993                                      p_api_version,
994                                      l_api_name,
995                                      G_PKG_NAME)
996   THEN
997     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
998   END IF;
999 
1000   -- Initialize message list if p_init_msg_list is set to TRUE.
1001   IF FND_API.to_Boolean(p_init_msg_list) THEN
1002     FND_MSG_PUB.initialize;
1003   END IF;
1004 
1005   -- Initialize API return status to success
1006   x_return_status := FND_API.G_RET_STS_SUCCESS;
1007 
1008   -- API body
1009   --  CALL FLOW :
1010   -- 1. Check if either mini_site_section_section_id or combination of
1011   --    mini_site_id, parent_section_id and child_section_id is specified
1012   -- 2. Update row
1013   --
1014 
1015   -- 1. Check if either mini_site_section_section_id or combination of
1016   --    mini_site_id, parent_section_id and child_section_id is specified
1017   IF ((p_mini_site_section_section_id IS NOT NULL) AND
1018       (p_mini_site_section_section_id <> FND_API.G_MISS_NUM))
1019   THEN
1020     -- mini_site_section_section_id specified, continue
1021     l_msite_sct_sect_id := p_mini_site_section_section_id;
1022   ELSIF ((p_mini_site_id IS NOT NULL)                AND
1023          (p_mini_site_id <> FND_API.G_MISS_NUM)      AND
1024          (p_parent_section_id <> FND_API.G_MISS_NUM) AND -- parent can be NULL
1025          (p_child_section_id IS NOT NULL)            AND
1026          (p_child_section_id <> FND_API.G_MISS_NUM))
1027   THEN
1028     -- If combination of mini_site_id, parent_section_id and child_section_id
1029     -- is specified, then query for mini_site_section_section_id
1030     BEGIN
1031       IF (p_parent_section_id IS NOT NULL) THEN
1032 
1033         SELECT mini_site_section_section_id INTO l_msite_sct_sect_id
1034           FROM ibe_dsp_msite_sct_sects
1035           WHERE mini_site_id = p_mini_site_id
1036             AND parent_section_id = p_parent_section_id
1037             AND child_section_id = p_child_section_id;
1038       ELSE
1039 
1040         SELECT mini_site_section_section_id INTO l_msite_sct_sect_id
1041           FROM ibe_dsp_msite_sct_sects
1042           WHERE mini_site_id = p_mini_site_id
1043             AND parent_section_id IS NULL
1044             AND child_section_id = p_child_section_id;
1045 
1046       END IF;
1047 
1048       EXCEPTION
1049          WHEN NO_DATA_FOUND THEN
1050            FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_NO_MSS_ID');
1051            FND_MESSAGE.Set_Token('MINI_SITE_ID', p_mini_site_id);
1052            IF (p_parent_section_id IS NOT NULL) THEN
1053              FND_MESSAGE.Set_Token('PARENT_SECTION_ID', p_parent_section_id);
1054            ELSE
1055              FND_MESSAGE.Set_Token('PARENT_SECTION_ID', 'NULL');
1056            END IF;
1057            FND_MESSAGE.Set_Token('CHILD_SECTION_ID', p_child_section_id);
1058            FND_MSG_PUB.Add;
1059            RAISE FND_API.G_EXC_ERROR;
1060          WHEN OTHERS THEN
1061            FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1062            FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
1063            FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1064            FND_MESSAGE.Set_Token('REASON', SQLERRM);
1065            FND_MSG_PUB.Add;
1066 
1067            FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_NO_MSS_ID');
1068            FND_MESSAGE.Set_Token('MINI_SITE_ID', p_mini_site_id);
1069            IF (p_parent_section_id IS NOT NULL) THEN
1073            END IF;
1070              FND_MESSAGE.Set_Token('PARENT_SECTION_ID', p_parent_section_id);
1071            ELSE
1072              FND_MESSAGE.Set_Token('PARENT_SECTION_ID', 'NULL');
1074            FND_MESSAGE.Set_Token('CHILD_SECTION_ID', p_child_section_id);
1075            FND_MSG_PUB.Add;
1076            RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1077       END;
1078   ELSE
1079     -- neither mini_site_section_section_id nor combination of
1080     -- mini_site_id, parent_section_id and child_section_id is specified
1081     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_NO_MSS_IDS_SPEC');
1082     FND_MSG_PUB.Add;
1083     RAISE FND_API.G_EXC_ERROR;
1084   END IF;
1085 
1086 
1087   --
1088   -- 1. Validate the input data
1089   --
1090   Validate_Update
1091     (
1092     p_init_msg_list                  => FND_API.G_FALSE,
1093     p_validation_level               => p_validation_level,
1094     p_mini_site_section_section_id   => l_msite_sct_sect_id,
1095     p_object_version_number          => p_object_version_number,
1096     p_start_date_active              => p_start_date_active,
1097     p_end_date_active                => p_end_date_active,
1098     p_level_number                   => p_level_number,
1099     p_sort_order                     => p_sort_order,
1100     p_concat_ids                     => p_concat_ids,
1101     x_return_status                  => l_return_status,
1102     x_msg_count                      => l_msg_count,
1103     x_msg_data                       => l_msg_data
1104     );
1105 
1106   IF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1107     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1108   ELSIF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1109     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_MSS_INVALID_UPDATE');
1110     FND_MSG_PUB.Add;
1111     RAISE FND_API.G_EXC_ERROR;            -- invalid
1112   END IF;
1113 
1114   -- 2. update row
1115   BEGIN
1116     update_row
1117       (
1118       l_msite_sct_sect_id,
1119       p_object_version_number,
1120       p_start_date_active,
1121       p_end_date_active,
1122       p_level_number,
1123       p_sort_order,
1124       p_concat_ids,
1125       SYSDATE,
1126       FND_GLOBAL.user_id,
1127       FND_GLOBAL.login_id
1128       );
1129   EXCEPTION
1130      WHEN NO_DATA_FOUND THEN
1131        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_MSS_UPDATE_FAIL');
1132        FND_MSG_PUB.Add;
1133        RAISE FND_API.G_EXC_ERROR;
1134      WHEN OTHERS THEN
1135        FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1136        FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
1137        FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1138        FND_MESSAGE.Set_Token('REASON', SQLERRM);
1139        FND_MSG_PUB.Add;
1140 
1141        FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_MSS_UPDATE_FAIL');
1142        FND_MSG_PUB.Add;
1143        RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1144   END;
1145 
1146   --
1147   -- End of main API body.
1148 
1149   -- Standard check of p_commit.
1150   IF (FND_API.To_Boolean(p_commit)) THEN
1151     COMMIT WORK;
1152   END IF;
1153 
1154   -- Standard call to get message count and if count is 1, get message info.
1155   FND_MSG_PUB.Count_And_Get(p_count   =>      x_msg_count,
1156                             p_data    =>      x_msg_data,
1157                             p_encoded =>      'F');
1158 
1159 EXCEPTION
1160 
1161    WHEN FND_API.G_EXC_ERROR THEN
1162      ROLLBACK TO UPDATE_MSITE_SCT_SECT_PVT;
1163      x_return_status := FND_API.G_RET_STS_ERROR;
1164      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1165                                p_data       =>      x_msg_data,
1166                                p_encoded    =>      'F');
1167 
1168    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1169      ROLLBACK TO UPDATE_MSITE_SCT_SECT_PVT;
1170      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1171      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1172                                p_data       =>      x_msg_data,
1173                                p_encoded    =>      'F');
1174 
1175    WHEN OTHERS THEN
1176      ROLLBACK TO UPDATE_MSITE_SCT_SECT_PVT;
1177 
1178      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1179      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
1180      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1181      FND_MESSAGE.Set_Token('REASON', SQLERRM);
1182      FND_MSG_PUB.Add;
1183 
1184      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1185 
1186      IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1187      THEN
1188        FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1189      END IF;
1190 
1191      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1192                                p_data       =>      x_msg_data,
1193                                p_encoded    =>      'F');
1194 
1195 END Update_MSite_Section_Section;
1196 
1197 
1198 PROCEDURE Delete_MSite_Section_Section
1199   (
1200    p_api_version                  IN NUMBER,
1201    p_init_msg_list                IN VARCHAR2    := FND_API.G_FALSE,
1202    p_commit                       IN VARCHAR2    := FND_API.G_FALSE,
1203    p_validation_level             IN NUMBER      := FND_API.G_VALID_LEVEL_FULL,
1204    p_mini_site_section_section_id IN NUMBER      := FND_API.G_MISS_NUM,
1208    x_return_status                OUT NOCOPY VARCHAR2,
1205    p_mini_site_id                 IN NUMBER      := FND_API.G_MISS_NUM,
1206    p_parent_section_id            IN NUMBER      := FND_API.G_MISS_NUM,
1207    p_child_section_id             IN NUMBER      := FND_API.G_MISS_NUM,
1209    x_msg_count                    OUT NOCOPY NUMBER,
1210    x_msg_data                     OUT NOCOPY VARCHAR2
1211   )
1212 IS
1213   l_api_name          CONSTANT VARCHAR2(30)  := 'Delete_MSite_Section_Section';
1214   l_api_version       CONSTANT NUMBER        := 1.0;
1215 
1216   l_msite_sct_sect_id        NUMBER;
1217 BEGIN
1218   -- Standard Start of API savepoint
1219   SAVEPOINT  DELETE_MSITE_SCT_SECT_PVT;
1220 
1221   -- Standard call to check for call compatibility.
1222   IF NOT FND_API.Compatible_API_Call(l_api_version,
1223                                      p_api_version,
1224                                      l_api_name,
1225                                      G_PKG_NAME)
1226   THEN
1227     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1228   END IF;
1229 
1230   -- Initialize message list if p_init_msg_list is set to TRUE.
1231   IF FND_API.to_Boolean(p_init_msg_list) THEN
1232     FND_MSG_PUB.initialize;
1233   END IF;
1234 
1235   -- Initialize API return status to success
1236   x_return_status := FND_API.G_RET_STS_SUCCESS;
1237 
1238   -- CALL FLOW
1239   -- 1. If mini_site_section_section_id specified, delete all references for it
1240   -- 2. If combination of mini_site_id, parent_section_id and child_section_id
1241   --    is specified, then query for mini_site_section_section_id and delete
1242   --    all references
1243 
1244   -- 1. If mini_site_section_section_id specified, delete all references for it
1245   IF ((p_mini_site_section_section_id IS NOT NULL) AND
1246       (p_mini_site_section_section_id <> FND_API.G_MISS_NUM))
1247   THEN
1248     -- mini_site_section_section_id specified, continue
1249     l_msite_sct_sect_id := p_mini_site_section_section_id;
1250   ELSIF ((p_mini_site_id IS NOT NULL)                AND
1251          (p_mini_site_id <> FND_API.G_MISS_NUM)      AND
1252          (p_parent_section_id <> FND_API.G_MISS_NUM) AND -- parent can be NULL
1253          (p_child_section_id IS NOT NULL)            AND
1254          (p_child_section_id <> FND_API.G_MISS_NUM))
1255   THEN
1256     -- If combination of mini_site_id, parent_section_id and child_section_id
1257     -- is specified, then query for mini_site_section_section_id
1258     BEGIN
1259       IF (p_parent_section_id IS NOT NULL) THEN
1260 
1261         SELECT mini_site_section_section_id INTO l_msite_sct_sect_id
1262           FROM ibe_dsp_msite_sct_sects
1263           WHERE mini_site_id = p_mini_site_id
1264             AND parent_section_id = p_parent_section_id
1265             AND child_section_id = child_section_id;
1266       ELSE
1267 
1268         SELECT mini_site_section_section_id INTO l_msite_sct_sect_id
1269           FROM ibe_dsp_msite_sct_sects
1270           WHERE mini_site_id = p_mini_site_id
1271             AND parent_section_id IS NULL
1272             AND child_section_id = child_section_id;
1273 
1274       END IF;
1275 
1276     EXCEPTION
1277        WHEN NO_DATA_FOUND THEN
1278          FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_NO_MSS_ID');
1279          FND_MESSAGE.Set_Token('MINI_SITE_ID', p_mini_site_id);
1280          IF (p_parent_section_id IS NOT NULL) THEN
1281            FND_MESSAGE.Set_Token('PARENT_SECTION_ID', p_parent_section_id);
1282          ELSE
1283            FND_MESSAGE.Set_Token('PARENT_SECTION_ID', 'NULL');
1284          END IF;
1285          FND_MESSAGE.Set_Token('CHILD_SECTION_ID', p_child_section_id);
1286          FND_MSG_PUB.Add;
1287          RAISE FND_API.G_EXC_ERROR;
1288        WHEN OTHERS THEN
1289          FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1290          FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
1291          FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1292          FND_MESSAGE.Set_Token('REASON', SQLERRM);
1293          FND_MSG_PUB.Add;
1294 
1295          FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_NO_MSS_ID');
1296          FND_MESSAGE.Set_Token('MINI_SITE_ID', p_mini_site_id);
1297          IF (p_parent_section_id IS NOT NULL) THEN
1298            FND_MESSAGE.Set_Token('PARENT_SECTION_ID', p_parent_section_id);
1299          ELSE
1300            FND_MESSAGE.Set_Token('PARENT_SECTION_ID', 'NULL');
1301          END IF;
1302          FND_MESSAGE.Set_Token('CHILD_SECTION_ID', p_child_section_id);
1303          FND_MSG_PUB.Add;
1304          RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1305     END;
1306 
1307   ELSE
1308     -- neither mini_site_section_section_id nor combination of
1309     -- mini_site_id, parent_section_id and child_section_id is specified
1310     FND_MESSAGE.Set_Name('IBE', 'IBE_DSP_NO_MSS_IDS_SPEC');
1311     FND_MSG_PUB.Add;
1312     RAISE FND_API.G_EXC_ERROR;
1313   END IF;
1314 
1315   -- delete row
1316   delete_row(l_msite_sct_sect_id);
1317 
1318 EXCEPTION
1319 
1320    WHEN FND_API.G_EXC_ERROR THEN
1321      ROLLBACK TO DELETE_MSITE_SCT_SECT_PVT;
1322      x_return_status := FND_API.G_RET_STS_ERROR;
1323      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1324                                p_data       =>      x_msg_data,
1325                                p_encoded    =>      'F');
1326 
1327    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1331                                p_data       =>      x_msg_data,
1328      ROLLBACK TO DELETE_MSITE_SCT_SECT_PVT;
1329      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1330      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1332                                p_encoded    =>      'F');
1333 
1334    WHEN OTHERS THEN
1335      ROLLBACK TO DELETE_MSITE_SCT_SECT_PVT;
1336 
1337      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1338      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
1339      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1340      FND_MESSAGE.Set_Token('REASON', SQLERRM);
1341      FND_MSG_PUB.Add;
1342 
1343      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1344 
1345      IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
1346      THEN
1347        FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, l_api_name );
1348      END IF;
1349 
1350      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1351                                p_data       =>      x_msg_data,
1352                                p_encoded    =>      'F');
1353 
1354 END Delete_MSite_Section_Section;
1355 
1356 PROCEDURE Update_MSite_Section_Sections
1357   (
1358    p_api_version                    IN NUMBER,
1359    p_init_msg_list                  IN VARCHAR2 := FND_API.G_FALSE,
1360    p_commit                         IN VARCHAR2 := FND_API.G_FALSE,
1361    p_validation_level               IN NUMBER   := FND_API.G_VALID_LEVEL_FULL,
1362    p_msite_section_section_ids      IN JTF_NUMBER_TABLE,
1363    p_object_version_numbers         IN JTF_NUMBER_TABLE,
1364    p_start_date_actives             IN JTF_DATE_TABLE,
1365    p_end_date_actives               IN JTF_DATE_TABLE,
1366    p_sort_orders                    IN JTF_NUMBER_TABLE,
1367    x_return_status                  OUT NOCOPY VARCHAR2,
1368    x_msg_count                      OUT NOCOPY NUMBER,
1369    x_msg_data                       OUT NOCOPY VARCHAR2
1370   )
1371 IS
1372   l_api_name          CONSTANT VARCHAR2(30) := 'Update_MSite_Section_Sections';
1373   l_api_version       CONSTANT NUMBER       := 1.0;
1374   l_msg_count         NUMBER;
1375   l_msg_data          VARCHAR2(2000);
1376 
1377   l_msite_sct_sect_id NUMBER;
1378   l_return_status     VARCHAR2(1);
1379 
1380 BEGIN
1381 
1382   -- Standard Start of API savepoint
1383   SAVEPOINT  UPDATE_MSITE_SCT_SECTS_PVT;
1384 
1385   -- Standard call to check for call compatibility.
1386   IF NOT FND_API.Compatible_API_Call(l_api_version,
1387                                      p_api_version,
1388                                      l_api_name,
1389                                      G_PKG_NAME)
1390   THEN
1391     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1392   END IF;
1393 
1394   -- Initialize message list if p_init_msg_list is set to TRUE.
1395   IF FND_API.to_Boolean(p_init_msg_list) THEN
1396     FND_MSG_PUB.initialize;
1397   END IF;
1398 
1399   -- Initialize API return status to success
1400   x_return_status := FND_API.G_RET_STS_SUCCESS;
1401 
1402   -- API body
1403   --  CALL FLOW :
1404   -- 1.
1405   FOR i IN 1..p_msite_section_section_ids.COUNT LOOP
1406 
1407     Update_MSite_Section_Section
1408       (
1409       p_api_version                    => p_api_version,
1410       p_init_msg_list                  => FND_API.G_FALSE,
1411       p_commit                         => FND_API.G_FALSE,
1412       p_validation_level               => p_validation_level,
1413       p_mini_site_section_section_id   => p_msite_section_section_ids(i),
1414       p_object_version_number          => p_object_version_numbers(i),
1415       p_mini_site_id                   => FND_API.G_MISS_NUM,
1416       p_parent_section_id              => FND_API.G_MISS_NUM,
1417       p_child_section_id               => FND_API.G_MISS_NUM,
1418       p_start_date_active              => p_start_date_actives(i),
1419       p_end_date_active                => p_end_date_actives(i),
1420       p_level_number                   => FND_API.G_MISS_NUM,
1421       p_sort_order                     => p_sort_orders(i),
1422       p_concat_ids                     => FND_API.G_MISS_CHAR,
1423       x_return_status                  => l_return_status,
1424       x_msg_count                      => x_msg_count,
1425       x_msg_data                       => x_msg_data
1426       );
1427 
1428     IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1429       RAISE FND_API.G_EXC_ERROR;
1430     ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1431       RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1432     END IF;
1433 
1434   END LOOP;
1435 
1436   --
1437   -- End of main API body.
1438 
1439   -- Standard check of p_commit.
1440   IF (FND_API.To_Boolean(p_commit)) THEN
1441     COMMIT WORK;
1442   END IF;
1443 
1444   -- Standard call to get message count and if count is 1, get message info.
1445   FND_MSG_PUB.Count_And_Get(p_count   =>      x_msg_count,
1446                             p_data    =>      x_msg_data,
1447                             p_encoded =>      'F');
1448 
1449 EXCEPTION
1450 
1451    WHEN FND_API.G_EXC_ERROR THEN
1452      ROLLBACK TO UPDATE_MSITE_SCT_SECTS_PVT;
1453      x_return_status := FND_API.G_RET_STS_ERROR;
1454      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1455                                p_data       =>      x_msg_data,
1456                                p_encoded    =>      'F');
1457 
1461      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1458    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1459      ROLLBACK TO UPDATE_MSITE_SCT_SECTS_PVT;
1460      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1462                                p_data       =>      x_msg_data,
1463                                p_encoded    =>      'F');
1464 
1465    WHEN OTHERS THEN
1466      ROLLBACK TO UPDATE_MSITE_SCT_SECTS_PVT;
1467 
1468      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1469      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
1470      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1471      FND_MESSAGE.Set_Token('REASON', SQLERRM);
1472      FND_MSG_PUB.Add;
1473 
1474      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1475 
1476      IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1477      THEN
1478        FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1479      END IF;
1480 
1481      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1482                                p_data       =>      x_msg_data,
1483                                p_encoded    =>      'F');
1484 
1485 END Update_MSite_Section_Sections;
1486 
1487 PROCEDURE Update_Delete_Sct_Scts
1488   (
1489    p_api_version                    IN NUMBER,
1490    p_init_msg_list                  IN VARCHAR2 := FND_API.G_FALSE,
1491    p_commit                         IN VARCHAR2 := FND_API.G_FALSE,
1492    p_validation_level               IN NUMBER   := FND_API.G_VALID_LEVEL_FULL,
1493    p_msite_section_section_ids      IN JTF_NUMBER_TABLE,
1494    p_object_version_numbers         IN JTF_NUMBER_TABLE,
1495    p_start_date_actives             IN JTF_DATE_TABLE,
1496    p_end_date_actives               IN JTF_DATE_TABLE,
1497    p_sort_orders                    IN JTF_NUMBER_TABLE,
1498    p_delete_flags                   IN JTF_VARCHAR2_TABLE_300,
1499    x_return_status                  OUT NOCOPY VARCHAR2,
1500    x_msg_count                      OUT NOCOPY NUMBER,
1501    x_msg_data                       OUT NOCOPY VARCHAR2
1502   )
1503 IS
1504   l_api_name          CONSTANT VARCHAR2(30) := 'Update_Delete_Sct_Scts';
1505   l_api_version       CONSTANT NUMBER       := 1.0;
1506   l_msg_count         NUMBER;
1507   l_msg_data          VARCHAR2(2000);
1508 
1509   l_section_item_id   NUMBER;
1510   l_return_status     VARCHAR2(1);
1511 
1512 BEGIN
1513 
1514   -- Standard Start of API savepoint
1515   SAVEPOINT  UPDATE_DELETE_SCT_SCTS_PVT;
1516 
1517   -- Standard call to check for call compatibility.
1518   IF NOT FND_API.Compatible_API_Call(l_api_version,
1519                                      p_api_version,
1520                                      l_api_name,
1521                                      G_PKG_NAME)
1522   THEN
1523     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1524   END IF;
1525 
1526   -- Initialize message list if p_init_msg_list is set to TRUE.
1527   IF FND_API.to_Boolean(p_init_msg_list) THEN
1528     FND_MSG_PUB.initialize;
1529   END IF;
1530 
1531   -- Initialize API return status to success
1532   x_return_status := FND_API.G_RET_STS_SUCCESS;
1533 
1534   -- API body
1535   --  CALL FLOW :
1536   -- 1.
1537 
1538   FOR i IN 1..p_msite_section_section_ids.COUNT LOOP
1539 
1540     IF (p_delete_flags(i) = 'Y') THEN
1541 
1542       Delete_MSite_Section_Section
1543         (
1544         p_api_version                  => p_api_version,
1545         p_init_msg_list                => FND_API.G_FALSE,
1546         p_commit                       => FND_API.G_FALSE,
1547         p_validation_level             => FND_API.G_VALID_LEVEL_FULL,
1548         p_mini_site_section_section_id => p_msite_section_section_ids(i),
1549         p_mini_site_id                 => FND_API.G_MISS_NUM,
1550         p_parent_section_id            => FND_API.G_MISS_NUM,
1551         p_child_section_id             => FND_API.G_MISS_NUM,
1552         x_return_status                => x_return_status,
1553         x_msg_count                    => x_msg_count,
1554         x_msg_data                     => x_msg_data
1555         );
1556 
1557       IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1558         RAISE FND_API.G_EXC_ERROR;
1559       ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1560         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1561       END IF;
1562 
1563     ELSE
1564 
1565       Update_Msite_Section_Section
1566         (
1567         p_api_version                    => p_api_version,
1568         p_init_msg_list                  => FND_API.G_FALSE,
1569         p_commit                         => FND_API.G_FALSE,
1570         p_validation_level               => p_validation_level,
1571         p_mini_site_section_section_id   => p_msite_section_section_ids(i),
1572         p_object_version_number          => p_object_version_numbers(i),
1573         p_mini_site_id                   => FND_API.G_MISS_NUM,
1574         p_parent_section_id              => FND_API.G_MISS_NUM,
1575         p_child_section_id               => FND_API.G_MISS_NUM,
1576         p_start_date_active              => p_start_date_actives(i),
1577         p_end_date_active                => p_end_date_actives(i),
1578         p_level_number                   => FND_API.G_MISS_NUM,
1579         p_sort_order                     => p_sort_orders(i),
1580         p_concat_ids                     => FND_API.G_MISS_CHAR,
1581         x_return_status                  => l_return_status,
1582         x_msg_count                      => x_msg_count,
1583         x_msg_data                       => x_msg_data
1584         );
1585 
1586       IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1587         RAISE FND_API.G_EXC_ERROR;
1588       ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1589         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1590       END IF;
1591 
1592     END IF;
1593 
1594   END LOOP;
1595 
1596   --
1597   -- End of main API body.
1598 
1599   -- Standard check of p_commit.
1600   IF (FND_API.To_Boolean(p_commit)) THEN
1601     COMMIT WORK;
1602   END IF;
1603 
1604   -- Standard call to get message count and if count is 1, get message info.
1605   FND_MSG_PUB.Count_And_Get(p_count   =>      x_msg_count,
1606                             p_data    =>      x_msg_data,
1607                             p_encoded =>      'F');
1608 
1609 EXCEPTION
1610 
1611    WHEN FND_API.G_EXC_ERROR THEN
1612      ROLLBACK TO UPDATE_DELETE_SCT_SCTS_PVT;
1613      x_return_status := FND_API.G_RET_STS_ERROR;
1614      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1615                                p_data       =>      x_msg_data,
1616                                p_encoded    =>      'F');
1617 
1618    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1619      ROLLBACK TO UPDATE_DELETE_SCT_SCTS_PVT;
1620      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1621      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1622                                p_data       =>      x_msg_data,
1623                                p_encoded    =>      'F');
1624 
1625    WHEN OTHERS THEN
1626      ROLLBACK TO UPDATE_DELETE_SCT_SCTS_PVT;
1627 
1628      FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1629      FND_MESSAGE.Set_Token('ROUTINE', l_api_name);
1630      FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1631      FND_MESSAGE.Set_Token('REASON', SQLERRM);
1632      FND_MSG_PUB.Add;
1633 
1634      x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1635 
1636      IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1637      THEN
1638        FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
1639      END IF;
1640 
1641      FND_MSG_PUB.Count_And_Get(p_count      =>      x_msg_count,
1642                                p_data       =>      x_msg_data,
1643                                p_encoded    =>      'F');
1644 
1645 END Update_Delete_Sct_Scts;
1646 
1647 PROCEDURE LOAD_SEED_ROW
1648   (
1649 			P_MINI_SITE_SECTION_SECTION_ID    	IN NUMBER,
1650 			P_OWNER  	                        IN VARCHAR2,
1651 			P_OBJECT_VERSION_NUMBER   	        IN NUMBER   := FND_API.G_MISS_NUM,
1652 			P_MINI_SITE_ID 	                    IN NUMBER,
1653 			P_PARENT_SECTION_ID   		        IN NUMBER,
1654 			P_CHILD_SECTION_ID      		    IN NUMBER,
1655 			P_START_DATE_ACTIVE 	            IN VARCHAR2, --IN DATE,
1656 			P_END_DATE_ACTIVE 		    IN VARCHAR2, -- IN DATE,
1657 			P_LEVEL_NUMBER 	                    IN NUMBER,
1658 			P_SORT_ORDER 		                IN NUMBER,
1659 			P_CONCAT_IDS 	                    IN VARCHAR2,
1660 			P_LAST_UPDATE_DATE	            	IN VARCHAR2,
1661             P_CUSTOM_MODE                       IN VARCHAR2,
1662    			P_UPLOAD_MODE                       IN VARCHAR2
1663   )
1664 IS
1665 BEGIN
1666  	If (P_UPLOAD_MODE='NLS') Then
1667 
1668 		Null;
1669 	 Else
1670 
1671 	  	LOAD_ROW(
1672 			P_OWNER,
1673             P_MINI_SITE_SECTION_SECTION_ID,
1674 			P_OBJECT_VERSION_NUMBER,
1675 			P_MINI_SITE_ID,
1676 			P_PARENT_SECTION_ID,
1677 			P_CHILD_SECTION_ID,
1678 			to_date(P_START_DATE_ACTIVE,'YYYY/MM/DD'),
1679                         to_date(P_END_DATE_ACTIVE,'YYYY/MM/DD'),
1680 			P_LEVEL_NUMBER,
1681 			P_SORT_ORDER,
1682 			P_CONCAT_IDS,
1683             P_LAST_UPDATE_DATE,
1684             P_CUSTOM_MODE);
1685 
1686 	End If;
1687 
1688 END LOAD_SEED_ROW;
1689 
1690 
1691 
1692 END IBE_DSP_MSITE_SCT_SECT_PVT;