158: raise no_data_found;
159: end if;
160: close c;
161:
162: insert into AK_REGIONS_TL (
163: REGION_APPLICATION_ID,
164: REGION_CODE,
165: LANGUAGE,
166: NAME,
188: from FND_LANGUAGES L
189: where L.INSTALLED_FLAG in ('I', 'B')
190: and not exists
191: (select NULL
192: from AK_REGIONS_TL T
193: where T.REGION_APPLICATION_ID = X_REGION_APPLICATION_ID
194: and T.REGION_CODE = X_REGION_CODE
195: and T.LANGUAGE = L.LANGUAGE_CODE);
196: end INSERT_ROW;
285:
286: cursor c1 is select
287: NAME,
288: DESCRIPTION
289: from AK_REGIONS_TL
290: where REGION_CODE = X_REGION_CODE
291: and REGION_APPLICATION_ID = X_REGION_APPLICATION_ID
292: and LANGUAGE = userenv('LANG')
293: for update of REGION_CODE nowait;
536: if (sql%notfound) then
537: raise no_data_found;
538: end if;
539:
540: update AK_REGIONS_TL set
541: NAME = X_NAME,
542: DESCRIPTION = X_DESCRIPTION,
543:
544: LAST_UPDATE_DATE = sysdate,
567: if (sql%notfound) then
568: raise no_data_found;
569: end if;
570:
571: delete from AK_REGIONS_TL
572: where REGION_APPLICATION_ID = X_REGION_APPLICATION_ID
573: and REGION_CODE = X_REGION_CODE;
574:
575: if (sql%notfound) then
579:
580: procedure ADD_LANGUAGE
581: is
582: begin
583: delete from AK_REGIONS_TL T
584: where not exists
585: (select NULL
586: from AK_REGIONS B
587: where B.REGION_CODE = T.REGION_CODE
587: where B.REGION_CODE = T.REGION_CODE
588: and B.REGION_APPLICATION_ID = T.REGION_APPLICATION_ID
589: );
590:
591: update AK_REGIONS_TL T set (
592: NAME,
593: DESCRIPTION
594: ) = (select
595: B.NAME,
593: DESCRIPTION
594: ) = (select
595: B.NAME,
596: B.DESCRIPTION
597: from AK_REGIONS_TL B
598: where B.REGION_CODE = T.REGION_CODE
599: and B.REGION_APPLICATION_ID = T.REGION_APPLICATION_ID
600: and B.LANGUAGE = T.SOURCE_LANG)
601: where (
605: ) in (select
606: SUBT.REGION_CODE,
607: SUBT.REGION_APPLICATION_ID,
608: SUBT.LANGUAGE
609: from AK_REGIONS_TL SUBB, AK_REGIONS_TL SUBT
610: where SUBB.REGION_CODE = SUBT.REGION_CODE
611: and SUBB.REGION_APPLICATION_ID = SUBT.REGION_APPLICATION_ID
612: and SUBB.LANGUAGE = SUBT.SOURCE_LANG
613: and (SUBB.NAME <> SUBT.NAME
615: or (SUBB.DESCRIPTION is null and SUBT.DESCRIPTION is not null)
616: or (SUBB.DESCRIPTION is not null and SUBT.DESCRIPTION is null)
617: ));
618:
619: insert into AK_REGIONS_TL (
620: REGION_APPLICATION_ID,
621: REGION_CODE,
622: NAME,
623: DESCRIPTION,
639: B.LAST_UPDATE_DATE,
640: B.LAST_UPDATE_LOGIN,
641: L.LANGUAGE_CODE,
642: B.SOURCE_LANG
643: from AK_REGIONS_TL B, FND_LANGUAGES L
644: where L.INSTALLED_FLAG in ('I', 'B')
645: and B.LANGUAGE = userenv('LANG')
646: and not exists
647: (select NULL
644: where L.INSTALLED_FLAG in ('I', 'B')
645: and B.LANGUAGE = userenv('LANG')
646: and not exists
647: (select NULL
648: from AK_REGIONS_TL T
649: where T.REGION_CODE = B.REGION_CODE
650: and T.REGION_APPLICATION_ID = B.REGION_APPLICATION_ID
651: and T.LANGUAGE = L.LANGUAGE_CODE);
652: end ADD_LANGUAGE;