DBA Data[Home] [Help]

PACKAGE BODY: APPS.GMIPVER

Source


1 package BODY GMIPVER as
2 /* $Header: GMIPVERB.pls 115.0 2002/08/01 21:49:11 jsrivast noship $     */
3 
4 /* ========================================================
5    This package would be used to ascertain the OPM 11i
6    patchset level.
7    ======================================================== */
8 /* ========================================================
9    This function would be return OPM 11i family pack on the
10    installation .
11    Returns:
12 	   0 -- Base 11i or undetermined
13 	   1 -- 11i.GMI.A
14 	   2--  11i.GMI.B
15 	   3--  11i.GMI.C
16 	   4--  11i.GMI.D
17 	   5--  11i.GMI.E
18 	   6--  11i.GMI.F
19 	   7--  11i.GMI.G
20 	   8--  11i.GMI.H
21 	   9--  11i.GMI.I
22 	  10--  11i.GMI.J
23 	  11--  11i.GMI.K
24 	  12--  11i.GMI.L
25 	  13--  11i.GMI.M
26 	  14--  11i.GMI.N
27 	  15--  11i.GMI.O
28    ======================================================== */
29 
30 FUNCTION get_opm_11i_family_pack RETURN NUMBER IS
31   l_retval NUMBER := 0;
32   l_count  NUMBER;
33   BEGIN
34     SELECT decode(substr(patch_level,-1,1),'A',1,'B',2,'C',3,'D',4,'E',5,'F',6,'G',7,'H',8,'I',9,'J',10,'K',11,'L',12,'M',13,'N',14,'O',15,0)
35     INTO   l_retval
36     FROM   fnd_product_installations
37     WHERE  application_id = 551;
38     IF (l_retval <> 0) THEN
39       RETURN l_retval;
40     END IF;
41     SELECT count(1)
42     INTO   l_count
43     FROM   fnd_views
44     WHERE  application_id   =     552
45     and    view_name      like   'GMD_QC_TESTS_VL';
46     IF (l_count = 1) THEN
47       /* it should be J or above. we will only return for J */
48        RETURN 10;
49     END IF;
50     SELECT count(1)
51     INTO   l_count
52     FROM   fnd_tables
53     WHERE  application_id   =     551
54     and    table_name      like   'GMI_ITEMS_XML_INTERFACE';
55     IF (l_count = 1) THEN
56       /* it should be I or above. we will only return for I */
57        RETURN 9;
58     END IF;
59     /* Below check is for common receiving which was
60        introduced in family pack H */
61     IF (GML_PO_FOR_PROCESS.check_po_for_proc) THEN
62       /* it should be H or above. we will only return for H */
63        RETURN 8;
64     END IF;
65     SELECT count(1)
66     INTO   l_count
67     FROM   fnd_tables
68     WHERE  application_id   =     551
69     and    table_name      like   'GMI_CATEGORY_SETS';
70     IF (l_count = 1) THEN
71       /* it should be G or above. we will only return for G */
72        RETURN 7;
73     END IF;
74     SELECT count(1)
75     INTO   l_count
76     FROM   fnd_views
77     WHERE  application_id   =     550
78     and    view_name      like   'SY_UOMS_MST_V';
79     IF (l_count = 1) THEN
80       /* it should be E/F or above. we will only return for F */
81        RETURN 6;
82     END IF;
83     RETURN 0;
84   EXCEPTION
85     WHEN Others THEN
86       Return 0;
87   END get_opm_11i_family_pack;
88 END GMIPVER;