16:
17:
18: BEGIN
19:
20: INSERT INTO HZ_GEOGRAPHY_TYPES_B (
21: geography_type,
22: object_version_number,
23: geography_use,
24: postal_code_range_flag,
140: BEGIN
141:
142: --dbms_output.put_line.PUT_LINE('in tblhandler geography_type_name is '||x_geography_type_name);
143:
144: UPDATE HZ_GEOGRAPHY_TYPES_B
145: SET
146: geography_type =
147: DECODE(x_geography_type,
148: NULL, geography_type,
242: x_request_id IN NUMBER
243: ) IS
244:
245: CURSOR c IS
246: SELECT * FROM hz_geography_types_b
247: WHERE rowid = x_rowid
248: FOR UPDATE NOWAIT;
249: Recinfo c%ROWTYPE;
250:
364: x_limited_by_geography_id,
365: x_created_by_module,
366: x_application_id,
367: x_program_login_id
368: FROM HZ_GEOGRAPHY_TYPES_B
369: WHERE geography_type = x_geography_type;
370:
371: EXCEPTION
372: WHEN NO_DATA_FOUND THEN
389: if (sql%notfound) then
390: raise no_data_found;
391: end if;
392:
393: delete from HZ_GEOGRAPHY_TYPES_B
394: where GEOGRAPHY_TYPE = X_GEOGRAPHY_TYPE;
395:
396: if (sql%notfound) then
397: raise no_data_found;
403: begin
404: delete from HZ_GEOGRAPHY_TYPES_TL T
405: where not exists
406: (select NULL
407: from HZ_GEOGRAPHY_TYPES_B B
408: where B.GEOGRAPHY_TYPE = T.GEOGRAPHY_TYPE
409: );
410:
411: update HZ_GEOGRAPHY_TYPES_TL T set (
502:
503: -- check for existance of data
504: SELECT rowid
505: INTO l_row_id
506: FROM hz_geography_types_b
507: WHERE geography_type = x_geography_type;
508:
509: -- data exists in hz_geography_types_b table. Now Update it.
510: -- cannot use update_row package directly because it has last_updated_by as
505: INTO l_row_id
506: FROM hz_geography_types_b
507: WHERE geography_type = x_geography_type;
508:
509: -- data exists in hz_geography_types_b table. Now Update it.
510: -- cannot use update_row package directly because it has last_updated_by as
511: -- hz_utility_v2pub.last_updated_by which cannot be used for seed data loading
512: UPDATE HZ_GEOGRAPHY_TYPES_B
513: SET
508:
509: -- data exists in hz_geography_types_b table. Now Update it.
510: -- cannot use update_row package directly because it has last_updated_by as
511: -- hz_utility_v2pub.last_updated_by which cannot be used for seed data loading
512: UPDATE HZ_GEOGRAPHY_TYPES_B
513: SET
514: object_version_number =
515: DECODE(x_object_version_number,
516: NULL, object_version_number,
542: FND_API.G_MISS_NUM, NULL,
543: x_program_login_id)
544: WHERE rowid = l_row_id;
545:
546: -- so far hz_geography_types_b table has data. Now update tl table
547:
548: UPDATE HZ_GEOGRAPHY_TYPES_TL SET
549: GEOGRAPHY_TYPE_NAME = decode(X_GEOGRAPHY_TYPE_NAME,
550: NULL, GEOGRAPHY_TYPE_NAME,
561: WHERE GEOGRAPHY_TYPE = X_GEOGRAPHY_TYPE
562: AND USERENV('LANG') in (LANGUAGE, SOURCE_LANG);
563:
564: IF (SQL%NOTFOUND) THEN
565: -- data exist in hz_geography_types_b table but not in hz_geography_types_tl
566: RAISE no_data_found;
567: END IF;
568:
569: EXCEPTION WHEN NO_DATA_FOUND THEN -- insert data
567: END IF;
568:
569: EXCEPTION WHEN NO_DATA_FOUND THEN -- insert data
570: BEGIN
571: -- check if we need to insert data in hz_geography_types_b
572: -- if l_row_id is NULL and no_data_found is raised, it means we have
573: -- to insert in hz_geography_types_b table.
574: IF (l_row_id IS NULL) THEN
575: -- We cannot use insert_row procedure because it puts user_ids of logged in user
569: EXCEPTION WHEN NO_DATA_FOUND THEN -- insert data
570: BEGIN
571: -- check if we need to insert data in hz_geography_types_b
572: -- if l_row_id is NULL and no_data_found is raised, it means we have
573: -- to insert in hz_geography_types_b table.
574: IF (l_row_id IS NULL) THEN
575: -- We cannot use insert_row procedure because it puts user_ids of logged in user
576: INSERT INTO HZ_GEOGRAPHY_TYPES_B (
577: geography_type,
572: -- if l_row_id is NULL and no_data_found is raised, it means we have
573: -- to insert in hz_geography_types_b table.
574: IF (l_row_id IS NULL) THEN
575: -- We cannot use insert_row procedure because it puts user_ids of logged in user
576: INSERT INTO HZ_GEOGRAPHY_TYPES_B (
577: geography_type,
578: object_version_number,
579: geography_use,
580: postal_code_range_flag,