153: END split_long_sql;
154:
155:
156:
157: -- Get the object_id in cn_objects for formula, if not exist, create it.
158: PROCEDURE check_create_object(x_name cn_objects.name%TYPE,
159: x_object_type cn_objects.object_type%TYPE,
160: x_object_id IN OUT NOCOPY cn_objects.object_id%TYPE,
161: x_repository_id cn_repositories.repository_id%TYPE)
154:
155:
156:
157: -- Get the object_id in cn_objects for formula, if not exist, create it.
158: PROCEDURE check_create_object(x_name cn_objects.name%TYPE,
159: x_object_type cn_objects.object_type%TYPE,
160: x_object_id IN OUT NOCOPY cn_objects.object_id%TYPE,
161: x_repository_id cn_repositories.repository_id%TYPE)
162: IS
155:
156:
157: -- Get the object_id in cn_objects for formula, if not exist, create it.
158: PROCEDURE check_create_object(x_name cn_objects.name%TYPE,
159: x_object_type cn_objects.object_type%TYPE,
160: x_object_id IN OUT NOCOPY cn_objects.object_id%TYPE,
161: x_repository_id cn_repositories.repository_id%TYPE)
162: IS
163: dummy NUMBER;
156:
157: -- Get the object_id in cn_objects for formula, if not exist, create it.
158: PROCEDURE check_create_object(x_name cn_objects.name%TYPE,
159: x_object_type cn_objects.object_type%TYPE,
160: x_object_id IN OUT NOCOPY cn_objects.object_id%TYPE,
161: x_repository_id cn_repositories.repository_id%TYPE)
162: IS
163: dummy NUMBER;
164: x_rowid ROWID;
162: IS
163: dummy NUMBER;
164: x_rowid ROWID;
165: BEGIN
166: -- check whether formula package exist in cn_objects
167: SELECT COUNT(*)
168: INTO dummy
169: FROM cn_objects
170: WHERE name = x_name
165: BEGIN
166: -- check whether formula package exist in cn_objects
167: SELECT COUNT(*)
168: INTO dummy
169: FROM cn_objects
170: WHERE name = x_name
171: AND object_type = x_object_type
172: AND org_id = g_org_id;
173:
173:
174: IF dummy = 0 THEN
175: x_object_id := cn_utils.get_object_id;
176:
177: cn_objects_pkg.insert_row( x_rowid => x_rowid,
178: x_object_id => x_object_id,
179: x_org_id => g_org_id,
180: x_dependency_map_complete => 'N',
181: x_name => x_name,
188: x_object_value => NULL );
189:
190: ELSIF dummy = 1 THEN
191: SELECT object_id INTO x_object_id
192: FROM cn_objects
193: WHERE name = x_name
194: AND object_type = x_object_type
195: AND org_id = g_org_id;
196: END IF;
609:
610: IF l_status THEN /* created successfully. Continue to install it. */
611: SELECT co.object_id
612: INTO l_pkg_object_id
613: FROM cn_objects co
614: WHERE co.name = l_pkg_name
615: AND co.object_type = 'PKS'
616: AND co.org_id = g_org_id;
617:
634: sqlstring := empty_sqlstring;
635:
636: SELECT co.object_id
637: INTO l_pkg_object_id
638: FROM cn_objects co
639: WHERE co.name = l_pkg_name --'cn_formula_'|| p_formula_id || '_pkg'
640: AND co.object_type = 'PKB'
641: AND co.org_id = g_org_id;
642: