create table zd2336480_list(itemno varchar(50));
insert into zd2336480_list values('40206-14-4W-070');
insert into zd2336480_list values('40206-14-4W-075');
insert into zd2336480_list values('40206-14-4W-080');
insert into zd2336480_list values('40206-14-4W-085');
insert into zd2336480_list values('40206-14-4W-090');
insert into zd2336480_list values('40206-14-4W-095');
insert into zd2336480_list values('40206-14-4W-100');
insert into zd2336480_list values('40206-14-4W-105');
insert into zd2336480_list values('40206-14-4W-110');
insert into zd2336480_list values('40206-14-4W-115');
insert into zd2336480_list values('40206-14-4W-120');
insert into zd2336480_list values('40206-14-4W-130');
insert into zd2336480_list values('40206-14-4W-140');
insert into zd2336480_list values('40206-14-4W-150');
insert into zd2336480_list values('40206-14-4W-160');
insert into zd2336480_list values('40206-64-4W-070');
insert into zd2336480_list values('40206-64-4W-075');
insert into zd2336480_list values('40206-64-4W-080');
insert into zd2336480_list values('40206-64-4W-085');
insert into zd2336480_list values('40206-64-4W-090');
insert into zd2336480_list values('40206-64-4W-095');
insert into zd2336480_list values('40206-64-4W-100');
insert into zd2336480_list values('40206-64-4W-105');
insert into zd2336480_list values('40206-64-4W-110');
insert into zd2336480_list values('40206-64-4W-115');
insert into zd2336480_list values('40206-64-4W-120');
insert into zd2336480_list values('40206-64-4W-130');
insert into zd2336480_list values('40206-64-4W-140');
insert into zd2336480_list values('40206-64-4W-150');
insert into zd2336480_list values('40206-64-4W-160');


select * from zd2336480_list

insert into MATRIX_ELEMENT_SELECTION values('40206','Width', '4W')



begin transaction 
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-070', '14', '4W', '070', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-075', '14', '4W', '075', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-080', '14', '4W', '080', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-085', '14', '4W', '085', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-090', '14', '4W', '090', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-095', '14', '4W', '095', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-100', '14', '4W', '100', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-105', '14', '4W', '105', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-110', '14', '4W', '110', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-115', '14', '4W', '115', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-120', '14', '4W', '120', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-130', '14', '4W', '130', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-140', '14', '4W', '140', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-150', '14', '4W', '150', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-14-4W-160', '14', '4W', '160', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-070', '64', '4W', '070', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-075', '64', '4W', '075', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-080', '64', '4W', '080', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-085', '64', '4W', '085', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-090', '64', '4W', '090', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-095', '64', '4W', '095', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-100', '64', '4W', '100', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-105', '64', '4W', '105', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-110', '64', '4W', '110', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-115', '64', '4W', '115', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-120', '64', '4W', '120', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-130', '64', '4W', '130', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-140', '64', '4W', '140', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-150', '64', '4W', '150', 'T');
insert into Matrix_items(matrix_group_code, item_code, element_code_1, element_code_2, Element_code_3, IS_selected) values ( '40206', '40206-64-4W-160', '64', '4W', '160', 'T');


commit transaction 


begin transaction 
update MATRIX_ITEMS set ELEMENT_CODE_4= '', ELEMENT_CODE_5 = ''  from zd2336480_list t where MATRIX_ITEMS.item_code = t.itemno and matrix_items.MATRIX_GROUP_CODE = '40206' 

commit transaction 

begin transaction
update items set matrix_item_type = 2 from zd2336480_list t where items.ITEMNO = t.itemno and matrix_item_type = 0 

commit transaction 
