35: X_LAST_UPDATE_DATE,
36: X_LAST_UPDATED_BY,
37: X_LAST_UPDATE_LOGIN );
38:
39: insert into CS_SR_SAVED_SEARCHES_TL (
40: CREATION_DATE,
41: CREATED_BY,
42: LAST_UPDATE_LOGIN,
43: NAME,
55: X_LAST_UPDATED_BY,
56: L.LANGUAGE_CODE,
57: userenv('LANG')
58: from FND_LANGUAGES L where L.INSTALLED_FLAG in ('I', 'B')
59: and not exists ( select NULL from CS_SR_SAVED_SEARCHES_TL T
60: where T.SEARCH_ID = X_SEARCH_ID
61: and T.LANGUAGE = L.LANGUAGE_CODE);
62:
63: open c;
74:
75: procedure DELETE_ROW ( X_SEARCH_ID in NUMBER) is
76: begin
77:
78: delete from CS_SR_SAVED_SEARCHES_TL where SEARCH_ID = X_SEARCH_ID;
79:
80: if (sql%notfound) then
81: raise no_data_found;
82: end if;
93:
94: PROCEDURE ADD_LANGUAGE is
95: BEGIN
96:
97: delete from CS_SR_SAVED_SEARCHES_TL T
98: where not exists
99: (select NULL from CS_SR_SAVED_SEARCHES_B B
100: where B.SEARCH_ID = T.SEARCH_ID );
101:
98: where not exists
99: (select NULL from CS_SR_SAVED_SEARCHES_B B
100: where B.SEARCH_ID = T.SEARCH_ID );
101:
102: update CS_SR_SAVED_SEARCHES_TL T set (
103: NAME ) = ( select B.NAME from CS_SR_SAVED_SEARCHES_TL B
104: where B.SEARCH_ID = T.SEARCH_ID
105: and B.LANGUAGE = T.SOURCE_LANG)
106: where ( T.SEARCH_ID,T.LANGUAGE ) in
99: (select NULL from CS_SR_SAVED_SEARCHES_B B
100: where B.SEARCH_ID = T.SEARCH_ID );
101:
102: update CS_SR_SAVED_SEARCHES_TL T set (
103: NAME ) = ( select B.NAME from CS_SR_SAVED_SEARCHES_TL B
104: where B.SEARCH_ID = T.SEARCH_ID
105: and B.LANGUAGE = T.SOURCE_LANG)
106: where ( T.SEARCH_ID,T.LANGUAGE ) in
107: (select SUBT.SEARCH_ID, SUBT.LANGUAGE
104: where B.SEARCH_ID = T.SEARCH_ID
105: and B.LANGUAGE = T.SOURCE_LANG)
106: where ( T.SEARCH_ID,T.LANGUAGE ) in
107: (select SUBT.SEARCH_ID, SUBT.LANGUAGE
108: from CS_SR_SAVED_SEARCHES_TL SUBB,
109: CS_SR_SAVED_SEARCHES_TL SUBT
110: where SUBB.SEARCH_ID = SUBT.SEARCH_ID
111: and SUBB.LANGUAGE = SUBT.SOURCE_LANG
112: and (SUBB.NAME <> SUBT.NAME or
105: and B.LANGUAGE = T.SOURCE_LANG)
106: where ( T.SEARCH_ID,T.LANGUAGE ) in
107: (select SUBT.SEARCH_ID, SUBT.LANGUAGE
108: from CS_SR_SAVED_SEARCHES_TL SUBB,
109: CS_SR_SAVED_SEARCHES_TL SUBT
110: where SUBB.SEARCH_ID = SUBT.SEARCH_ID
111: and SUBB.LANGUAGE = SUBT.SOURCE_LANG
112: and (SUBB.NAME <> SUBT.NAME or
113: (SUBB.NAME is null and SUBT.NAME is not null)
112: and (SUBB.NAME <> SUBT.NAME or
113: (SUBB.NAME is null and SUBT.NAME is not null)
114: or (SUBB.NAME is not null and SUBT.NAME is null) ));
115:
116: insert into CS_SR_SAVED_SEARCHES_TL (
117: CREATION_DATE,
118: CREATED_BY,
119: LAST_UPDATE_LOGIN,
120: NAME,
133: B.LAST_UPDATE_DATE,
134: B.LAST_UPDATED_BY,
135: L.LANGUAGE_CODE,
136: B.SOURCE_LANG
137: from CS_SR_SAVED_SEARCHES_TL B, FND_LANGUAGES L
138: where L.INSTALLED_FLAG in ('I', 'B') and B.LANGUAGE = userenv('LANG')
139: and not exists (select NULL from CS_SR_SAVED_SEARCHES_TL T
140: where T.SEARCH_ID = B.SEARCH_ID
141: and T.LANGUAGE =L.LANGUAGE_CODE);
135: L.LANGUAGE_CODE,
136: B.SOURCE_LANG
137: from CS_SR_SAVED_SEARCHES_TL B, FND_LANGUAGES L
138: where L.INSTALLED_FLAG in ('I', 'B') and B.LANGUAGE = userenv('LANG')
139: and not exists (select NULL from CS_SR_SAVED_SEARCHES_TL T
140: where T.SEARCH_ID = B.SEARCH_ID
141: and T.LANGUAGE =L.LANGUAGE_CODE);
142: end ADD_LANGUAGE;
143: end CS_SR_SAVED_SEARCHES_PKG;