96: raise no_data_found;
97: end if;
98: close c;
99:
100: insert into AK_FLOWS_TL (
101: FLOW_APPLICATION_ID,
102: FLOW_CODE,
103: LANGUAGE,
104: NAME,
124: from FND_LANGUAGES L
125: where L.INSTALLED_FLAG in ('I', 'B')
126: and not exists
127: (select NULL
128: from AK_FLOWS_TL T
129: where T.FLOW_APPLICATION_ID = X_FLOW_APPLICATION_ID
130: and T.FLOW_CODE = X_FLOW_CODE
131: and T.LANGUAGE = L.LANGUAGE_CODE);
132: end INSERT_ROW;
183:
184: cursor c1 is select
185: NAME,
186: DESCRIPTION
187: from AK_FLOWS_TL
188: where FLOW_APPLICATION_ID = X_FLOW_APPLICATION_ID
189: and FLOW_CODE = X_FLOW_CODE
190: and LANGUAGE = userenv('LANG')
191: for update of FLOW_CODE nowait;
336: if (sql%notfound) then
337: raise no_data_found;
338: end if;
339:
340: update AK_FLOWS_TL set
341: NAME = X_NAME,
342: DESCRIPTION = X_DESCRIPTION,
343: LAST_UPDATE_DATE = X_LAST_UPDATE_DATE,
344: LAST_UPDATED_BY = X_LAST_UPDATED_BY,
366: if (sql%notfound) then
367: raise no_data_found;
368: end if;
369:
370: delete from AK_FLOWS_TL
371: where FLOW_APPLICATION_ID = X_FLOW_APPLICATION_ID
372: and FLOW_CODE = X_FLOW_CODE;
373: if (sql%notfound) then
374: raise no_data_found;
378:
379: procedure ADD_LANGUAGE
380: is
381: begin
382: delete from AK_FLOWS_TL T
383: where not exists
384: (select NULL
385: from AK_FLOWS B
386: where B.FLOW_CODE = T.FLOW_CODE
386: where B.FLOW_CODE = T.FLOW_CODE
387: and B.FLOW_APPLICATION_ID = T.FLOW_APPLICATION_ID
388: );
389:
390: update AK_FLOWS_TL T set (
391: NAME,
392: DESCRIPTION
393: ) = (select
394: B.NAME,
392: DESCRIPTION
393: ) = (select
394: B.NAME,
395: B.DESCRIPTION
396: from AK_FLOWS_TL B
397: where B.FLOW_CODE = T.FLOW_CODE
398: and B.FLOW_APPLICATION_ID = T.FLOW_APPLICATION_ID
399: and B.LANGUAGE = T.SOURCE_LANG)
400: where (
404: ) in (select
405: SUBT.FLOW_CODE,
406: SUBT.FLOW_APPLICATION_ID,
407: SUBT.LANGUAGE
408: from AK_FLOWS_TL SUBB, AK_FLOWS_TL SUBT
409: where SUBB.FLOW_CODE = SUBT.FLOW_CODE
410: and SUBB.FLOW_APPLICATION_ID = SUBT.FLOW_APPLICATION_ID
411: and SUBB.LANGUAGE = SUBT.SOURCE_LANG
412: and (SUBB.NAME <> SUBT.NAME
414: or (SUBB.DESCRIPTION is null and SUBT.DESCRIPTION is not null)
415: or (SUBB.DESCRIPTION is not null and SUBT.DESCRIPTION is null)
416: ));
417:
418: insert into AK_FLOWS_TL (
419: FLOW_APPLICATION_ID,
420: FLOW_CODE,
421: NAME,
422: DESCRIPTION,
438: B.LAST_UPDATE_DATE,
439: B.LAST_UPDATE_LOGIN,
440: L.LANGUAGE_CODE,
441: B.SOURCE_LANG
442: from AK_FLOWS_TL B, FND_LANGUAGES L
443: where L.INSTALLED_FLAG in ('I', 'B')
444: and B.LANGUAGE = userenv('LANG')
445: and not exists
446: (select NULL
443: where L.INSTALLED_FLAG in ('I', 'B')
444: and B.LANGUAGE = userenv('LANG')
445: and not exists
446: (select NULL
447: from AK_FLOWS_TL T
448: where T.FLOW_CODE = B.FLOW_CODE
449: and T.FLOW_APPLICATION_ID = B.FLOW_APPLICATION_ID
450: and T.LANGUAGE = L.LANGUAGE_CODE);
451: end ADD_LANGUAGE;
466: where flow_code = p_csr_code
467: and flow_application_id = p_csr_id;
468: cursor ft_csr (p_csr_code IN VARCHAR2, p_csr_id IN NUMBER) is
469: select *
470: from ak_flows_tl
471: where flow_code = p_csr_code
472: and flow_application_id = p_csr_id;
473: cursor fp_csr (p_csr_code IN VARCHAR2, p_csr_id IN NUMBER) is
474: select *
569: FOR ft_rec IN ft_csr( p_o_code, p_o_id) LOOP
570: -- Put new code and id into record and insert into appropriate table
571: ft_rec.flow_code := p_n_code;
572: ft_rec.flow_application_id := p_n_id;
573: insert into AK_FLOWS_TL (
574: FLOW_APPLICATION_ID,
575: FLOW_CODE,
576: LANGUAGE,
577: NAME,