[Home] [Help]
PACKAGE BODY: APPS.GMD_QC_MIGV12
Source
1 PACKAGE BODY GMD_QC_MIGV12 AS
2 /* $Header: gmdmv12b.pls 120.0 2005/06/30 11:33:28 jdiiorio noship $
3 +==========================================================================+
4 | Copyright (c) 1998 Oracle Corporation |
5 | Redwood Shores, CA, USA |
6 | All rights reserved. |
7 +==========================================================================+
8 | FILE NAME |
9 | gmdmg12b.pls |
10 | |
11 | PACKAGE NAME |
12 | GMD_QC_MIGV12 |
13 | |
14 | DESCRIPTION |
15 | This package contains migration validation procedures/functions |
16 | for Quality for 12 migration. |
17 | |
18 | |
19 | HISTORY |
20 +==========================================================================+
21 */
22
23 /*===========================================================================
24 -- FUNCTION:
25 -- get_profile_value
26 --
27 -- DESCRIPTION:
28 -- This function returns the System level profile value for a given profile.
29 -- Null is returned if the profile value is not found.
30 --
31 -- PARAMETERS:
32 -- p_profile_name IN VARCHAR2 - Profile Name
33 --
34 -- return OUT VARCHAR2 - Profile Value
35 --
36 --=========================================================================== */
37
38
39 FUNCTION GET_PROFILE_VALUE
40 ( p_profile_name IN VARCHAR2) RETURN VARCHAR2 IS
41
42
43 CURSOR get_profile IS
44 SELECT profile_option_value
45 FROM fnd_profile_options A, fnd_profile_option_values B
46 WHERE a.profile_option_id = b.profile_option_id
47 AND a.profile_option_name = p_profile_name
48 AND level_id = 10001;
49
50
51 l_profile_value fnd_profile_option_values.profile_option_value%TYPE;
52
53 BEGIN
54
55 OPEN get_profile;
56 FETCH get_profile INTO l_profile_value;
57 IF (get_profile%NOTFOUND) THEN
58 l_profile_value := NULL;
59 END IF;
60 CLOSE get_profile;
61
62 RETURN l_profile_value;
63
64 END GET_PROFILE_VALUE;
65
66
67 /*===========================================================================
68 -- PROCEDURE
69 -- gmd_qc_migrate_validation
70 --
71 -- DESCRIPTION:
72 -- This does a pre_migration validation on the Quality Tables.
73 --
74 -- PARAMETERS:
75 --
76 -- p_migration_run_id IN NUMBER - Migration Id.
77 --
78 -- x_exception_count OUT NUMBER - Exception Count
79 --
80 --=========================================================================== */
81
82 PROCEDURE GMD_QC_MIGRATE_VALIDATION
83 ( p_migration_run_id IN NUMBER
84 , x_exception_count OUT NOCOPY NUMBER)
85
86 IS
87
88 l_lab_profile fnd_profile_option_values.profile_option_value%TYPE;
89
90 /*=====================================
91 Cursor to get default Stability
92 Study Org from setup tables.
93 =====================================*/
94
95 CURSOR get_ss_org IS
96 SELECT default_stability_study_org
97 FROM gmd_migrate_parms;
98
99 l_def_ss_org gmd_migrate_parms.default_stability_study_org%TYPE;
100
101 BEGIN
102
103 x_exception_count := 0;
104
105 /*==============================================
106 Get Default Lab Type Profile Value
107 ==============================================*/
108
109 l_lab_profile := GMD_QC_MIGV12.GET_PROFILE_VALUE('GEMMS_DEFAULT_LAB_TYPE');
110
111
112 IF (l_lab_profile IS NULL) THEN
113 GMA_COMMON_LOGGING.gma_migration_central_log (
114 p_run_id => p_migration_run_id,
115 p_log_level => FND_LOG.LEVEL_ERROR,
116 p_message_token => 'GMD_MIG_DEFAULT_LAB_NULL',
117 p_context => 'Quality Validation',
118 p_app_short_name => 'GMD');
119 x_exception_count := x_exception_count + 1;
120 END IF;
121
122 EXCEPTION
123
124 WHEN OTHERS THEN
125
126 GMA_COMMON_LOGGING.gma_migration_central_log (
127 p_run_id => p_migration_run_id,
128 p_log_level => FND_LOG.LEVEL_UNEXPECTED,
129 p_message_token => 'GMA_MIGRATION_DB_ERROR',
130 p_context => 'Quality Validation',
131 p_db_error => SQLERRM,
132 p_app_short_name => 'GMA');
133
134 x_exception_count := x_exception_count + 1;
135
136 END GMD_QC_MIGRATE_VALIDATION;
137
138 END;