DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKS_ORDER_CONTACTS_PUB

Source


1 PACKAGE BODY OKS_Order_Contacts_PUB AS
2 /* $Header: OKSPCOCB.pls 120.0 2005/05/25 18:17:48 appldev noship $ */
3 
4   G_APP_NAME			CONSTANT VARCHAR2(3)   :=  OKC_API.G_APP_NAME;
5   G_PKG_NAME			CONSTANT VARCHAR2(200) := 'OKS_ORDER_CONTACTS_PUB';
6   G_COCV_REC         COCV_REC_TYPE;
7 procedure reset(p_cocv_rec IN cocv_rec_type) is
8 begin
9     g_cocv_rec.object_version_number := p_cocv_rec.object_version_number;
10     g_cocv_rec.created_by            := p_cocv_rec.created_by;
11     g_cocv_rec.creation_date         := p_cocv_rec.creation_date;
12     g_cocv_rec.last_updated_by       := p_cocv_rec.last_updated_by;
13     g_cocv_rec.last_update_date      := p_cocv_rec.last_update_date;
14 end reset;
15 
16 -- Start of comments
17 --
18 -- Procedure Name  : create_Order_Contact
19 -- Description     :
20 -- Business Rules  :
21 -- Parameters      :
22 -- Version         : 1.0
23 -- End of comments
24 
25 procedure Insert_Order_Contact(p_api_version	IN	NUMBER,
26                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
27                               x_return_status	OUT NOCOPY	VARCHAR2,
28                               x_msg_count	OUT NOCOPY	NUMBER,
29                               x_msg_data	OUT NOCOPY	VARCHAR2,
30                               p_cocv_rec	IN	cocv_rec_type,
31                               x_cocv_rec	OUT NOCOPY	cocv_rec_type) is
32 l_api_name                     CONSTANT VARCHAR2(30) := 'Insert_Order_Contact';
33 l_api_version                  CONSTANT NUMBER := 1;
34 l_return_status                VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
35 begin
36   l_return_status := OKC_API.START_ACTIVITY(l_api_name,
37                                               p_init_msg_list,
38                                               '_PUB',
39                                               x_return_status);
40   IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
41     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
42   ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
43     RAISE OKC_API.G_EXCEPTION_ERROR;
44   END IF;
45   --
46   -- Call Before Logic Hook
47   --
48   g_cocv_rec := p_cocv_rec;
49   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'B');
50   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
51     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
52   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
53     raise OKC_API.G_EXCEPTION_ERROR;
54   END IF;
55   reset(p_cocv_rec);
56   OKS_ORDER_CONTACTs_PVT.create_Order_Contact(p_api_version,
57                               p_init_msg_list,
58                               x_return_status,
59                               x_msg_count,
60                               x_msg_data,
61                               g_cocv_rec,
62                               x_cocv_rec);
63   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
64     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
65   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
66     RAISE OKC_API.G_EXCEPTION_ERROR;
67   END IF;
68   --
69   -- Call After Logic Hook
70   --
71   g_cocv_rec := x_cocv_rec;
72   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'A');
73   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
74     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
75   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
76     raise OKC_API.G_EXCEPTION_ERROR;
77   END IF;
78   OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
79   EXCEPTION
80      WHEN OKC_API.G_EXCEPTION_ERROR THEN
81        x_return_status := OKC_API.HANDLE_EXCEPTIONS
82        (substr(l_api_name,1,26),
83         G_PKG_NAME,
84         'OKC_API.G_RET_STS_ERROR',
85         x_msg_count,
86         x_msg_data,
87         '_PUB');
88      WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
89        x_return_status := OKC_API.HANDLE_EXCEPTIONS
90        (substr(l_api_name,1,26),
91         G_PKG_NAME,
92         'OKC_API.G_RET_STS_UNEXP_ERROR',
93         x_msg_count,
94         x_msg_data,
95         '_PUB');
96      WHEN OTHERS THEN
97        x_return_status := OKC_API.HANDLE_EXCEPTIONS
98        (substr(l_api_name,1,26),
99         G_PKG_NAME,
100         'OTHERS',
101         x_msg_count,
102         x_msg_data,
103         '_PUB');
104 end Insert_Order_Contact;
105 
106 -- Start of comments
107 --
108 -- Procedure Name  : create_Order_Contact
109 -- Description     :
110 -- Business Rules  :
111 -- Parameters      :
112 -- Version         : 1.0
113 -- End of comments
114 
115 procedure Insert_Order_Contact(p_api_version	IN	NUMBER,
116                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
117                               x_return_status	OUT NOCOPY	VARCHAR2,
118                               x_msg_count	OUT NOCOPY	NUMBER,
119                               x_msg_data	OUT NOCOPY	VARCHAR2,
120                               p_cocv_tbl	IN	cocv_tbl_type,
121                               x_cocv_tbl	OUT NOCOPY	cocv_tbl_type) is
122 i NUMBER;
123 l_return_status	VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
124 begin
125      OKC_API.init_msg_list(p_init_msg_list);
126       x_return_status:= OKC_API.G_RET_STS_SUCCESS;
127       if (p_cocv_tbl.COUNT>0) then
128         i := p_cocv_tbl.FIRST;
129         LOOP
130 	    Insert_Order_Contact(p_api_version=>p_api_version,
131                               p_init_msg_list=>OKC_API.G_FALSE,
132                               x_return_status=>l_return_status,
133                               x_msg_count=>x_msg_count,
134                               x_msg_data=>x_msg_data,
135                               p_cocv_rec=>p_cocv_tbl(i),
136                               x_cocv_rec=>x_cocv_tbl(i));
137           if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
138             x_return_status := l_return_status;
139             raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
140           elsif (l_return_status = OKC_API.G_RET_STS_ERROR) then
141             x_return_status := l_return_status;
142           end if;
143           EXIT WHEN (i=p_cocv_tbl.LAST);
144           i := p_cocv_tbl.NEXT(i);
145         END LOOP;
146       end if;
147 exception
148 when others then NULL;
149 end Insert_Order_Contact;
150 
151 procedure update_Order_Contact(p_api_version	IN	NUMBER,
152                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
153                               x_return_status	OUT NOCOPY	VARCHAR2,
154                               x_msg_count	OUT NOCOPY	NUMBER,
155                               x_msg_data	OUT NOCOPY	VARCHAR2,
156                               p_cocv_rec	IN	cocv_rec_type,
157                               x_cocv_rec	OUT NOCOPY	cocv_rec_type) is
158 l_api_name                     CONSTANT VARCHAR2(30) := 'update_Order_Contact';
159 l_api_version                  CONSTANT NUMBER := 1;
160 l_return_status                VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
161 begin
162   l_return_status := OKC_API.START_ACTIVITY(l_api_name,
163                                               p_init_msg_list,
164                                               '_PUB',
165                                               x_return_status);
166   IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
167     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
168   ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
169     RAISE OKC_API.G_EXCEPTION_ERROR;
170   END IF;
171   --
172   -- Call Before Logic Hook
173   --
174   g_cocv_rec := p_cocv_rec;
175   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'B');
176   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
177     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
178   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
179     raise OKC_API.G_EXCEPTION_ERROR;
180   END IF;
181   reset(p_cocv_rec);
182   OKS_ORDER_CONTACTs_PVT.update_Order_Contact(p_api_version,
183                               p_init_msg_list,
184                               x_return_status,
185                               x_msg_count,
186                               x_msg_data,
187                               g_cocv_rec,
188                               x_cocv_rec);
189   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
190     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
191   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
192     RAISE OKC_API.G_EXCEPTION_ERROR;
193   END IF;
194   --
195   -- Call After Logic Hook
196   --
197   g_cocv_rec := x_cocv_rec;
198   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'A');
199   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
200     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
201   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
202     raise OKC_API.G_EXCEPTION_ERROR;
203   END IF;
204   OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
205   EXCEPTION
206      WHEN OKC_API.G_EXCEPTION_ERROR THEN
207        x_return_status := OKC_API.HANDLE_EXCEPTIONS
208        (substr(l_api_name,1,26),
209         G_PKG_NAME,
210         'OKC_API.G_RET_STS_ERROR',
211         x_msg_count,
212         x_msg_data,
213         '_PUB');
214      WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
215        x_return_status := OKC_API.HANDLE_EXCEPTIONS
216        (substr(l_api_name,1,26),
217         G_PKG_NAME,
218         'OKC_API.G_RET_STS_UNEXP_ERROR',
219         x_msg_count,
220         x_msg_data,
221         '_PUB');
222      WHEN OTHERS THEN
223        x_return_status := OKC_API.HANDLE_EXCEPTIONS
224        (substr(l_api_name,1,26),
225         G_PKG_NAME,
226         'OTHERS',
227         x_msg_count,
228         x_msg_data,
229         '_PUB');
230 end update_Order_Contact;
231 
232 -- Start of comments
233 --
234 -- Procedure Name  : update_Order_Contact
235 -- Description     :
236 -- Business Rules  :
237 -- Parameters      :
238 -- Version         : 1.0
239 -- End of comments
240 
241 procedure update_Order_Contact(p_api_version	IN	NUMBER,
242                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
243                               x_return_status	OUT NOCOPY	VARCHAR2,
244                               x_msg_count	OUT NOCOPY	NUMBER,
245                               x_msg_data	OUT NOCOPY	VARCHAR2,
246                               p_cocv_tbl	IN	cocv_tbl_type,
247                               x_cocv_tbl	OUT NOCOPY	cocv_tbl_type) is
248 i NUMBER;
249 l_return_status	VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
250 begin
251      OKC_API.init_msg_list(p_init_msg_list);
252       x_return_status:= OKC_API.G_RET_STS_SUCCESS;
253       if (p_cocv_tbl.COUNT>0) then
254         i := p_cocv_tbl.FIRST;
255         LOOP
256 	    update_Order_Contact(p_api_version=>p_api_version,
257                               p_init_msg_list=>OKC_API.G_FALSE,
258                               x_return_status=>l_return_status,
259                               x_msg_count=>x_msg_count,
260                               x_msg_data=>x_msg_data,
261                               p_cocv_rec=>p_cocv_tbl(i),
262                               x_cocv_rec=>x_cocv_tbl(i));
263           if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
264             x_return_status := l_return_status;
265             raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
266           elsif (l_return_status = OKC_API.G_RET_STS_ERROR) then
267             x_return_status := l_return_status;
268           end if;
269           EXIT WHEN (i=p_cocv_tbl.LAST);
270           i := p_cocv_tbl.NEXT(i);
271         END LOOP;
272       end if;
273 exception
274 when others then NULL;
275 end update_Order_Contact;
276 
277 -- Start of comments
278 --
279 -- Procedure Name  : delete_Order_Contact
280 -- Description     :
281 -- Business Rules  :
282 -- Parameters      :
283 -- Version         : 1.0
284 -- End of comments
285 
286 procedure delete_Order_Contact(p_api_version	IN	NUMBER,
287                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
288                               x_return_status	OUT NOCOPY	VARCHAR2,
289                               x_msg_count	OUT NOCOPY	NUMBER,
290                               x_msg_data	OUT NOCOPY	VARCHAR2,
291                               p_cocv_rec	IN	cocv_rec_type) is
292 l_api_name                     CONSTANT VARCHAR2(30) := 'delete_Order_Contact';
293 l_api_version                  CONSTANT NUMBER := 1;
294 l_return_status                VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
295 begin
296   l_return_status := OKC_API.START_ACTIVITY(l_api_name,
297                                               p_init_msg_list,
298                                               '_PUB',
299                                               x_return_status);
300   IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
301     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
302   ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
303     RAISE OKC_API.G_EXCEPTION_ERROR;
304   END IF;
305   --
306   -- Call Before Logic Hook
307   --
308   g_cocv_rec := p_cocv_rec;
309   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'B');
310   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
311     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
312   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
313     raise OKC_API.G_EXCEPTION_ERROR;
314   END IF;
315   reset(p_cocv_rec);
316   OKS_ORDER_CONTACTs_PVT.delete_Order_Contact(p_api_version,
317                               p_init_msg_list,
318                               x_return_status,
319                               x_msg_count,
320                               x_msg_data,
321                               g_cocv_rec);
322   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
323     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
324   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
325     RAISE OKC_API.G_EXCEPTION_ERROR;
326   END IF;
327   --
328   -- Call After Logic Hook
329   --
330   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'A');
331   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
332     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
333   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
334     raise OKC_API.G_EXCEPTION_ERROR;
335   END IF;
336   OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
337   EXCEPTION
338      WHEN OKC_API.G_EXCEPTION_ERROR THEN
339        x_return_status := OKC_API.HANDLE_EXCEPTIONS
340        (substr(l_api_name,1,26),
341         G_PKG_NAME,
342         'OKC_API.G_RET_STS_ERROR',
343         x_msg_count,
344         x_msg_data,
345         '_PUB');
346      WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
347        x_return_status := OKC_API.HANDLE_EXCEPTIONS
348        (substr(l_api_name,1,26),
349         G_PKG_NAME,
350         'OKC_API.G_RET_STS_UNEXP_ERROR',
351         x_msg_count,
352         x_msg_data,
353         '_PUB');
354      WHEN OTHERS THEN
355        x_return_status := OKC_API.HANDLE_EXCEPTIONS
356        (substr(l_api_name,1,26),
357         G_PKG_NAME,
358         'OTHERS',
359         x_msg_count,
360         x_msg_data,
361         '_PUB');
362 end delete_Order_Contact;
363 
364 -- Start of comments
365 --
366 -- Procedure Name  : delete_Order_Contact
367 -- Description     :
368 -- Business Rules  :
369 -- Parameters      :
370 -- Version         : 1.0
371 -- End of comments
372 
373 procedure delete_Order_Contact(p_api_version	IN	NUMBER,
374                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
375                               x_return_status	OUT NOCOPY	VARCHAR2,
376                               x_msg_count	OUT NOCOPY	NUMBER,
377                               x_msg_data	OUT NOCOPY	VARCHAR2,
378                               p_cocv_tbl	IN	cocv_tbl_type) is
379 i NUMBER;
380 l_return_status	VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
381 begin
382      OKC_API.init_msg_list(p_init_msg_list);
383       x_return_status:= OKC_API.G_RET_STS_SUCCESS;
384       if (p_cocv_tbl.COUNT>0) then
385         i := p_cocv_tbl.FIRST;
386         LOOP
387 	    delete_Order_Contact(p_api_version=>p_api_version,
388                               p_init_msg_list=>OKC_API.G_FALSE,
389                               x_return_status=>l_return_status,
390                               x_msg_count=>x_msg_count,
391                               x_msg_data=>x_msg_data,
392                               p_cocv_rec=>p_cocv_tbl(i));
393           if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
394             x_return_status := l_return_status;
395             raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
396           elsif (l_return_status = OKC_API.G_RET_STS_ERROR) then
397             x_return_status := l_return_status;
398           end if;
399           EXIT WHEN (i=p_cocv_tbl.LAST);
400           i := p_cocv_tbl.NEXT(i);
401         END LOOP;
402       end if;
403 exception
404 when others then NULL;
405 end delete_Order_Contact;
406 
407 -- Start of comments
408 --
409 -- Procedure Name  : lock_Order_Contact
410 -- Description     :
411 -- Business Rules  :
412 -- Parameters      :
413 -- Version         : 1.0
414 -- End of comments
415 
416 procedure lock_Order_Contact(p_api_version	IN	NUMBER,
417                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
418                               x_return_status	OUT NOCOPY	VARCHAR2,
419                               x_msg_count	OUT NOCOPY	NUMBER,
420                               x_msg_data	OUT NOCOPY	VARCHAR2,
421                               p_cocv_rec	IN	cocv_rec_type) is
422 l_api_name                     CONSTANT VARCHAR2(30) := 'lock_Order_Contact';
423 l_api_version                  CONSTANT NUMBER := 1;
424 l_return_status                VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
425 begin
426   l_return_status := OKC_API.START_ACTIVITY(l_api_name,
427                                               p_init_msg_list,
428                                               '_PUB',
429                                               x_return_status);
430   IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
431     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
432   ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
433     RAISE OKC_API.G_EXCEPTION_ERROR;
434   END IF;
435   --
436   -- Call Before Logic Hook
437   --
438   g_cocv_rec := p_cocv_rec;
439   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'B');
440   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
441     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
442   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
443     raise OKC_API.G_EXCEPTION_ERROR;
444   END IF;
445   reset(p_cocv_rec);
446   OKS_ORDER_CONTACTs_PVT.lock_Order_Contact(p_api_version,
447                               p_init_msg_list,
448                               x_return_status,
449                               x_msg_count,
450                               x_msg_data,
451                               g_cocv_rec);
452   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
453     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
454   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
455     RAISE OKC_API.G_EXCEPTION_ERROR;
456   END IF;
457   --
458   -- Call After Logic Hook
459   --
460   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'A');
461   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
462     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
463   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
464     raise OKC_API.G_EXCEPTION_ERROR;
465   END IF;
466   OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
467   EXCEPTION
468      WHEN OKC_API.G_EXCEPTION_ERROR THEN
469        x_return_status := OKC_API.HANDLE_EXCEPTIONS
470        (substr(l_api_name,1,26),
471         G_PKG_NAME,
472         'OKC_API.G_RET_STS_ERROR',
473         x_msg_count,
474         x_msg_data,
475         '_PUB');
476      WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
477        x_return_status := OKC_API.HANDLE_EXCEPTIONS
478        (substr(l_api_name,1,26),
479         G_PKG_NAME,
480         'OKC_API.G_RET_STS_UNEXP_ERROR',
481         x_msg_count,
482         x_msg_data,
483         '_PUB');
484      WHEN OTHERS THEN
485        x_return_status := OKC_API.HANDLE_EXCEPTIONS
486        (substr(l_api_name,1,26),
487         G_PKG_NAME,
488         'OTHERS',
489         x_msg_count,
490         x_msg_data,
491         '_PUB');
492 end lock_Order_Contact;
493 
494 -- Start of comments
495 --
496 -- Procedure Name  : lock_Order_Contact
497 -- Description     :
498 -- Business Rules  :
499 -- Parameters      :
500 -- Version         : 1.0
501 -- End of comments
502 
503 procedure lock_Order_Contact(p_api_version	IN	NUMBER,
504                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
505                               x_return_status	OUT NOCOPY	VARCHAR2,
506                               x_msg_count	OUT NOCOPY	NUMBER,
507                               x_msg_data	OUT NOCOPY	VARCHAR2,
508                               p_cocv_tbl	IN	cocv_tbl_type) is
509 i NUMBER;
510 l_return_status	VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
511 begin
512      OKC_API.init_msg_list(p_init_msg_list);
513       x_return_status:= OKC_API.G_RET_STS_SUCCESS;
514       if (p_cocv_tbl.COUNT>0) then
515         i := p_cocv_tbl.FIRST;
516         LOOP
517 	    lock_Order_Contact(p_api_version=>p_api_version,
518                               p_init_msg_list=>OKC_API.G_FALSE,
519                               x_return_status=>l_return_status,
520                               x_msg_count=>x_msg_count,
521                               x_msg_data=>x_msg_data,
522                               p_cocv_rec=>p_cocv_tbl(i));
523           if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
524             x_return_status := l_return_status;
525             raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
526           elsif (l_return_status = OKC_API.G_RET_STS_ERROR) then
527             x_return_status := l_return_status;
528           end if;
529           EXIT WHEN (i=p_cocv_tbl.LAST);
530           i := p_cocv_tbl.NEXT(i);
531         END LOOP;
532       end if;
533 exception
534 when others then NULL;
535 end lock_Order_Contact;
536 
537 -- Start of comments
538 --
539 -- Procedure Name  : validate_Order_Contact
540 -- Description     :
541 -- Business Rules  :
542 -- Parameters      :
543 -- Version         : 1.0
544 -- End of comments
545 
546 procedure validate_Order_Contact(p_api_version	IN	NUMBER,
547                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
548                               x_return_status	OUT NOCOPY	VARCHAR2,
549                               x_msg_count	OUT NOCOPY	NUMBER,
550                               x_msg_data	OUT NOCOPY	VARCHAR2,
551                               p_cocv_rec	IN	cocv_rec_type) is
552 l_api_name                     CONSTANT VARCHAR2(30) := 'validate_Order_Contact';
553 l_api_version                  CONSTANT NUMBER := 1;
554 l_return_status                VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
555 begin
556   l_return_status := OKC_API.START_ACTIVITY(l_api_name,
557                                               p_init_msg_list,
558                                               '_PUB',
559                                               x_return_status);
560   IF (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
561     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
562   ELSIF (l_return_status = OKC_API.G_RET_STS_ERROR) THEN
563     RAISE OKC_API.G_EXCEPTION_ERROR;
564   END IF;
565   --
566   -- Call Before Logic Hook
567   --
568   g_cocv_rec := p_cocv_rec;
569   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'B');
570   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
571     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
572   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
573     raise OKC_API.G_EXCEPTION_ERROR;
574   END IF;
575   reset(p_cocv_rec);
576   OKS_ORDER_CONTACTs_PVT.validate_Order_Contact(p_api_version,
577                               p_init_msg_list,
578                               x_return_status,
579                               x_msg_count,
580                               x_msg_data,
581                               g_cocv_rec);
582   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
583     RAISE OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
584   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
585     RAISE OKC_API.G_EXCEPTION_ERROR;
586   END IF;
587   --
588   -- Call After Logic Hook
589   --
590   okc_util.call_user_hook(x_return_status, g_pkg_name, l_api_name, 'A');
591   IF (x_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) THEN
592     raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
593   ELSIF (x_return_status = OKC_API.G_RET_STS_ERROR) THEN
594     raise OKC_API.G_EXCEPTION_ERROR;
595   END IF;
596   OKC_API.END_ACTIVITY(x_msg_count, x_msg_data);
597   EXCEPTION
598      WHEN OKC_API.G_EXCEPTION_ERROR THEN
599        x_return_status := OKC_API.HANDLE_EXCEPTIONS
600        (substr(l_api_name,1,26),
601         G_PKG_NAME,
602         'OKC_API.G_RET_STS_ERROR',
603         x_msg_count,
604         x_msg_data,
605         '_PUB');
606      WHEN OKC_API.G_EXCEPTION_UNEXPECTED_ERROR THEN
607        x_return_status := OKC_API.HANDLE_EXCEPTIONS
608        (substr(l_api_name,1,26),
609         G_PKG_NAME,
610         'OKC_API.G_RET_STS_UNEXP_ERROR',
611         x_msg_count,
612         x_msg_data,
613         '_PUB');
614      WHEN OTHERS THEN
615        x_return_status := OKC_API.HANDLE_EXCEPTIONS
616        (substr(l_api_name,1,26),
617         G_PKG_NAME,
618         'OTHERS',
619         x_msg_count,
620         x_msg_data,
621         '_PUB');
622 end validate_Order_Contact;
623 
624 -- Start of comments
625 --
626 -- Procedure Name  : validate_Order_Contact
627 -- Description     :
628 -- Business Rules  :
629 -- Parameters      :
630 -- Version         : 1.0
631 -- End of comments
632 
633 procedure validate_Order_Contact(p_api_version	IN	NUMBER,
634                               p_init_msg_list	IN	VARCHAR2 default OKC_API.G_FALSE,
635                               x_return_status	OUT NOCOPY	VARCHAR2,
636                               x_msg_count	OUT NOCOPY	NUMBER,
637                               x_msg_data	OUT NOCOPY	VARCHAR2,
638                               p_cocv_tbl	IN	cocv_tbl_type) is
639 i NUMBER;
640 l_return_status	VARCHAR2(1) := OKC_API.G_RET_STS_SUCCESS;
641 begin
642      OKC_API.init_msg_list(p_init_msg_list);
643       x_return_status:= OKC_API.G_RET_STS_SUCCESS;
644       if (p_cocv_tbl.COUNT>0) then
645         i := p_cocv_tbl.FIRST;
646         LOOP
647 	    validate_Order_Contact(p_api_version=>p_api_version,
648                               p_init_msg_list=>OKC_API.G_FALSE,
649                               x_return_status=>l_return_status,
650                               x_msg_count=>x_msg_count,
651                               x_msg_data=>x_msg_data,
652                               p_cocv_rec=>p_cocv_tbl(i));
653           if (l_return_status = OKC_API.G_RET_STS_UNEXP_ERROR) then
654             x_return_status := l_return_status;
655             raise OKC_API.G_EXCEPTION_UNEXPECTED_ERROR;
656           elsif (l_return_status = OKC_API.G_RET_STS_ERROR) then
657             x_return_status := l_return_status;
658           end if;
659           EXIT WHEN (i=p_cocv_tbl.LAST);
660           i := p_cocv_tbl.NEXT(i);
661         END LOOP;
662       end if;
663 exception
664 when others then NULL;
665 end validate_Order_Contact;
666 end OKS_ORDER_CONTACTS_PUB;