75: X_LAST_UPDATED_BY,
76: X_LAST_UPDATE_LOGIN
77: );
78:
79: insert into QPR_PRICE_PLANS_TL (
80: NAME,
81: DESCRIPTION,
82: CREATION_DATE,
83: CREATED_BY,
109: from FND_LANGUAGES L
110: where L.INSTALLED_FLAG in ('I', 'B')
111: and not exists
112: (select NULL
113: from QPR_PRICE_PLANS_TL T
114: where T.PRICE_PLAN_ID = X_PRICE_PLAN_ID
115: and T.LANGUAGE = L.LANGUAGE_CODE);
116:
117: open c;
168: cursor c1 is select
169: NAME,
170: DESCRIPTION,
171: decode(LANGUAGE, userenv('LANG'), 'Y', 'N') BASELANG
172: from QPR_PRICE_PLANS_TL
173: where PRICE_PLAN_ID = X_PRICE_PLAN_ID
174: and userenv('LANG') in (LANGUAGE, SOURCE_LANG)
175: for update of PRICE_PLAN_ID nowait;
176: begin
280: if (sql%notfound) then
281: raise no_data_found;
282: end if;
283:
284: update QPR_PRICE_PLANS_TL set
285: NAME = X_NAME,
286: DESCRIPTION = X_DESCRIPTION,
287: LAST_UPDATE_DATE = X_LAST_UPDATE_DATE,
288: LAST_UPDATED_BY = X_LAST_UPDATED_BY,
299: procedure DELETE_ROW (
300: X_PRICE_PLAN_ID in NUMBER
301: ) is
302: begin
303: delete from QPR_PRICE_PLANS_TL
304: where PRICE_PLAN_ID = X_PRICE_PLAN_ID;
305:
306: if (sql%notfound) then
307: raise no_data_found;
317:
318: procedure ADD_LANGUAGE
319: is
320: begin
321: delete from QPR_PRICE_PLANS_TL T
322: where not exists
323: (select NULL
324: from QPR_PRICE_PLANS_B B
325: where B.PRICE_PLAN_ID = T.PRICE_PLAN_ID
324: from QPR_PRICE_PLANS_B B
325: where B.PRICE_PLAN_ID = T.PRICE_PLAN_ID
326: );
327:
328: update QPR_PRICE_PLANS_TL T set (
329: NAME,
330: DESCRIPTION
331: ) = (select
332: B.NAME,
330: DESCRIPTION
331: ) = (select
332: B.NAME,
333: B.DESCRIPTION
334: from QPR_PRICE_PLANS_TL B
335: where B.PRICE_PLAN_ID = T.PRICE_PLAN_ID
336: and B.LANGUAGE = T.SOURCE_LANG)
337: where (
338: T.PRICE_PLAN_ID,
339: T.LANGUAGE
340: ) in (select
341: SUBT.PRICE_PLAN_ID,
342: SUBT.LANGUAGE
343: from QPR_PRICE_PLANS_TL SUBB, QPR_PRICE_PLANS_TL SUBT
344: where SUBB.PRICE_PLAN_ID = SUBT.PRICE_PLAN_ID
345: and SUBB.LANGUAGE = SUBT.SOURCE_LANG
346: and (SUBB.NAME <> SUBT.NAME
347: or SUBB.DESCRIPTION <> SUBT.DESCRIPTION
348: or (SUBB.DESCRIPTION is null and SUBT.DESCRIPTION is not null)
349: or (SUBB.DESCRIPTION is not null and SUBT.DESCRIPTION is null)
350: ));
351:
352: insert into QPR_PRICE_PLANS_TL (
353: NAME,
354: DESCRIPTION,
355: CREATION_DATE,
356: CREATED_BY,
378: B.PROGRAM_LOGIN_ID,
379: B.PROGRAM_APPLICATION_ID,
380: L.LANGUAGE_CODE,
381: B.SOURCE_LANG
382: from QPR_PRICE_PLANS_TL B, FND_LANGUAGES L
383: where L.INSTALLED_FLAG in ('I', 'B')
384: and B.LANGUAGE = userenv('LANG')
385: and not exists
386: (select NULL
383: where L.INSTALLED_FLAG in ('I', 'B')
384: and B.LANGUAGE = userenv('LANG')
385: and not exists
386: (select NULL
387: from QPR_PRICE_PLANS_TL T
388: where T.PRICE_PLAN_ID = B.PRICE_PLAN_ID
389: and T.LANGUAGE = L.LANGUAGE_CODE);
390: end ADD_LANGUAGE;
391: