218: select * from ak_regions_vl
219: where region_code = source_region_code;
220:
221: cursor c_region_items is
222: select * from ak_region_items_vl
223: where region_code = source_region_code;
224:
225: l_rowid varchar2(200);
226: l_region_rec c_regions%rowtype;
298: -- dbms_output.put_line('Created Region');
299:
300: for l_rec in c_region_items
301: loop
302: jtfb_ak_region_items_pkg.insert_row (
303: x_rowid => l_rowid
304: , x_region_application_id => l_rec.region_application_id
305: , x_region_code => target_region_code
306: , x_attribute_application_id => l_rec.attribute_application_id
416: , rit.attribute9
417: , rit.lov_attribute_code
418: , rit.attribute10
419: , rit.flex_segment_list
420: from ak_region_items rit, ak_regions rgn
421: where rgn.attribute_category in
422: ('BIN', 'REPORT', 'GRAPH', 'GRAPH_REPORT')
423: and rit.region_code = rgn.region_code
424: and rit.region_application_id = rgn.region_application_id
424: and rit.region_application_id = rgn.region_application_id
425: and rit.attribute_category = 'PARAMETER'
426: for update nowait;
427:
428: l_flex_segment_list ak_region_items.flex_segment_list%type;
429: l_upgraded boolean := false;
430:
431: begin
432:
442: l_flex_segment_list := rec.flex_segment_list;
443: l_flex_segment_list := replace(l_flex_segment_list, 'lov_foreign_key_name', 'attribute9');
444: l_flex_segment_list := replace(l_flex_segment_list, 'lov_attribute_code', 'attribute10');
445:
446: update ak_region_items
447: set lov_region_application_id = null
448: , attribute7 = nvl(attribute7, rec.lov_region_application_id)
449: , lov_region_code = null
450: , attribute8 = nvl(attribute8, rec.lov_region_code)
492: , rit.region_code
493: , rit.attribute_code
494: , rit.lov_region_application_id
495: , rit.display_sequence
496: from ak_region_items rit, ak_regions rgn
497: where rgn.attribute_category in
498: ('GRAPH', 'GRAPH_REPORT')
499: and rit.region_code = rgn.region_code
500: and rit.region_application_id = rgn.region_application_id
504: for update nowait;
505:
506: cursor cur_sequence(c_region_code in varchar2) is
507: select nvl((max(display_sequence) + 1), l_min_sequence) new_sequence
508: from ak_region_items
509: where region_code = c_region_code
510: and attribute_category = l_attribute_category
511: and display_sequence between l_min_sequence and l_max_sequence;
512:
537:
538: -- dbms_output.put_line(rec.region_code || ', ' ||
539: -- rec.attribute_code || ' ... Done.');
540:
541: update ak_region_items
542: set display_sequence = sequence_rec.new_sequence
543: where rowid = rec.rowid;
544: l_upgraded := true;
545:
583: --
584: procedure Multiselect_Upgrade is
585:
586: l_attribute_category constant
587: ak_region_items.attribute_category%type := 'PARAMETER';
588: l_item_style constant ak_region_items.item_style%type := 'MULTI_SELECT';
589: l_new_item_style constant ak_region_items.item_style%type := 'DATA';
590: l_upgraded boolean := false;
591:
584: procedure Multiselect_Upgrade is
585:
586: l_attribute_category constant
587: ak_region_items.attribute_category%type := 'PARAMETER';
588: l_item_style constant ak_region_items.item_style%type := 'MULTI_SELECT';
589: l_new_item_style constant ak_region_items.item_style%type := 'DATA';
590: l_upgraded boolean := false;
591:
592: cursor cur_region_items is
585:
586: l_attribute_category constant
587: ak_region_items.attribute_category%type := 'PARAMETER';
588: l_item_style constant ak_region_items.item_style%type := 'MULTI_SELECT';
589: l_new_item_style constant ak_region_items.item_style%type := 'DATA';
590: l_upgraded boolean := false;
591:
592: cursor cur_region_items is
593: select rit.rowid
591:
592: cursor cur_region_items is
593: select rit.rowid
594: , rit.attribute_code
595: from ak_region_items rit, ak_regions rgn
596: where rgn.attribute_category in
597: ('BIN', 'REPORT', 'GRAPH', 'GRAPH_REPORT')
598: and rit.region_code = rgn.region_code
599: and rit.region_application_id = rgn.region_application_id
603:
604: cursor cur_attributes is
605: select att.rowid
606: , att.attribute_code
607: from ak_region_items rit, ak_regions rgn, ak_attributes att
608: where att.item_style = l_item_style
609: and rit.attribute_code = att.attribute_code
610: and rit.attribute_application_id = rit.attribute_application_id
611: and rit.attribute_category = l_attribute_category
622: savepoint Multiselect_Upgrade;
623:
624: for rit_rec in cur_region_items
625: loop
626: -- dbms_output.put_line('Ak_Region_Items: ' || rit_rec.attribute_code);
627: update ak_region_items
628: set item_style = l_new_item_style
629: where rowid = rit_rec.rowid;
630: l_upgraded := true;
623:
624: for rit_rec in cur_region_items
625: loop
626: -- dbms_output.put_line('Ak_Region_Items: ' || rit_rec.attribute_code);
627: update ak_region_items
628: set item_style = l_new_item_style
629: where rowid = rit_rec.rowid;
630: l_upgraded := true;
631: end loop;
694: cursor c_region_items is
695: select ara.created_by
696: , ara.last_updated_by
697: , ara.last_update_login
698: from ak_region_items ara
699: , ak_regions ar
700: where ar.attribute_category in ('BIN', 'REPORT', 'GRAPH'
701: , 'GRAPH_REPORT', 'POPLIST')
702: and ara.region_code = ar.region_code
710: cursor c_region_items_tl is
711: select arat.created_by
712: , arat.last_updated_by
713: , arat.last_update_login
714: from ak_region_items_tl arat
715: , ak_region_items ara
716: , ak_regions ar
717: where ar.attribute_category in ('BIN', 'REPORT', 'GRAPH'
718: , 'GRAPH_REPORT', 'POPLIST')
711: select arat.created_by
712: , arat.last_updated_by
713: , arat.last_update_login
714: from ak_region_items_tl arat
715: , ak_region_items ara
716: , ak_regions ar
717: where ar.attribute_category in ('BIN', 'REPORT', 'GRAPH'
718: , 'GRAPH_REPORT', 'POPLIST')
719: and ara.region_code = ar.region_code
770: l_patch_applied := true;
771: end loop;
772: commit;
773:
774: -- Updating ak_region_items
775: for rec in c_region_items
776: loop
777: update ak_region_items
778: set created_by = l_created_by
773:
774: -- Updating ak_region_items
775: for rec in c_region_items
776: loop
777: update ak_region_items
778: set created_by = l_created_by
779: , last_updated_by = l_last_updated_by
780: , last_update_login = l_last_update_login
781: where current of c_region_items;
783: l_patch_applied := true;
784: end loop;
785: commit;
786:
787: -- Updating ak_region_items_tl
788: for rec in c_region_items_tl
789: loop
790: update ak_region_items_tl
791: set created_by = l_created_by
786:
787: -- Updating ak_region_items_tl
788: for rec in c_region_items_tl
789: loop
790: update ak_region_items_tl
791: set created_by = l_created_by
792: , last_updated_by = l_last_updated_by
793: , last_update_login = l_last_update_login
794: where current of c_region_items_tl;