Update tbllistresponsecode set resend ='T' where response_code in ('1326','1329','1331','2326','2329','2331','3326','3329','3331','4326','4329','4331','5326','5329','5331','6326','6329','6331','ZZZZ');
delete from TBLMENU_LIST where  menu_id = 82;
insert into TBLMENU_LIST values(82,66,N'G. Thông tin chứng thư số','G. Cert Info',0,'VIEW','C','1','TraCuuDuLieu/frmCertInfo.aspx',7);
delete from TBLMENU_GROUP where menu_id = 82;
insert into TBLMENU_GROUP select 82,group_id,'VIEW','1' from TBLGROUP;
update tblmenu_group set used = '0' where menu_id = 82 and group_id = (select group_id from tblgroup where group_name = 'ADMINISTRATORS');

update TBLFILES_DEFINE_DETAIL set fieldlength = 70 WHERE     (FILEID = 2) AND (FIELDID IN (426, 429));
update TBLFILES_DEFINE_DETAIL set fieldlength = 100 WHERE     (FILEID = 4) AND (FIELDID IN (14, 17)); 

alter table  TBLHV_COMPARE_COLLECT alter COLUMN AMOUNT VARCHAR(30);
alter table TBLLV_COMPARE_COLLECT alter COLUMN AMOUNT VARCHAR(30);
alter table TBLHLV_COMPARE_COLLECT alter COLUMN AMOUNT VARCHAR(30);
alter table TBLHHV_COMPARE_COLLECT alter COLUMN AMOUNT VARCHAR(30);
update tblfiles_define_detail set fieldlength = 0 where fileid = 3;
update tblmenu_list set action_right = 'VIEW' where menu_id in (8,9,62);

delete From tblFile_Info Where FILE_NAME='VERTAD' and TRX_TYPE='900001';
insert into tblFile_Info(FILE_NAME,FILE_TYPE,TRX_TYPE,TABLE_NAME,SR,DESCRIPTION_V,DESCRIPTION_E,COMMENTS) VALUES ('VERTAD','09','900001',NULL,'R',N'File phiên bản',N'File Version',N'File phiên bản');
delete From tblFile_Info Where FILE_NAME='RHL_CS' and TRX_TYPE='601001';
insert into tblFile_Info(FILE_NAME,FILE_TYPE,TRX_TYPE,TABLE_NAME,SR,DESCRIPTION_V,DESCRIPTION_E,COMMENTS) VALUES ('RHL_CS','04','601001','tblHV_Compare_Collect','R',N'File tổng hợp giao dịch thành công cho CI (Đối chiếu)',N'File  collective of success transaction  for CI (Inquiry)',N'File tổng hợp giao dịch thành công cho CI (Đối chiếu)');
delete From tblFile_Info Where FILE_NAME='RHL_HS' and TRX_TYPE='601002';
insert into tblFile_Info(FILE_NAME,FILE_TYPE,TRX_TYPE,TABLE_NAME,SR,DESCRIPTION_V,DESCRIPTION_E,COMMENTS) VALUES ('RHL_HS','06','601002','tblHHV_Compare_Collect','R',N'File tổng hợp giao dịch thành công cho CIHO (Đối chiếu)',N'File  collective of success transaction  for CIHO (Inquiry)',N'File tổng hợp giao dịch thành công cho CIHO (Đối chiếu)');

delete from TBLLISTRESPONSECODE where RESPONSE_CODE in ('4700','7102','7603','7604','7605','7518','7502','7210','7202','8603','8604','8605','8518','8502','8210','8202','2519');
insert into TBLLISTRESPONSECODE values('4700','Create successful list of requested file',N'Tạo thành công danh sách file được yêu cầu',null,null);
insert into TBLLISTRESPONSECODE values('7102','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('7603','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('7604','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('7605','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('7518','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('7502','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('7210','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('7202','Canceled at end of day',N'Ðã bị hủy cuối ngày',null,null);
insert into TBLLISTRESPONSECODE values('8603','Payment was canceled',N'Lệnh chuyển tiền đã bị hủy',null,null);
insert into TBLLISTRESPONSECODE values('8604','Payment was canceled',N'Lệnh chuyển tiền đã bị hủy',null,null);
insert into TBLLISTRESPONSECODE values('8605','Payment was canceled',N'Lệnh chuyển tiền đã bị hủy',null,null);
insert into TBLLISTRESPONSECODE values('8518','Payment was canceled',N'Lệnh chuyển tiền đã bị hủy',null,null);
insert into TBLLISTRESPONSECODE values('8502','Payment was canceled',N'Lệnh chuyển tiền đã bị hủy',null,null);
insert into TBLLISTRESPONSECODE values('8210','Payment was canceled',N'Lệnh chuyển tiền đã bị hủy',null,null);
insert into TBLLISTRESPONSECODE values('8202','Payment was canceled',N'Lệnh chuyển tiền đã bị hủy',null,null);
insert into TBLLISTRESPONSECODE values('2519', 'Same Relation No',N'Trùng số bút toán', null, null);

delete tblfiles_define_detail where fileid=3;
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('513','3','RELATION_NO','110','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('514','3','TRX_TYPE','003','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('515','3','O_INDIRECT_CODE','007','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('516','3','TRX_DATE','012','1','8','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('517','3','R_INDIRECT_CODE','019','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('518','3','O_CI_CODE','021','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('519','3','R_CI_CODE','022','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('520','3','Other1','025','0','0','AN','','','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('521','3','CURRENCY','026','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('522','3','AMOUNT','027','0','0','N','0','L','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('523','3','SD_NAME','028','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('524','3','SD_ADDR','029','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('525','3','SD_ACCNT','030','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('526','3','RV_NAME','031','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('527','3','RV_ADDR','032','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('528','3','RV_ACCNT','033','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('529','3','CONTENT','034','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('530','3','OPERT1','036','0','0','AN','','','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('531','3','OPERT2','037','0','0','AN','','','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('532','3','SERIAL_NO','011','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('533','3','SD_TIME','006','0','0','AN','','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('534','3','RESPONSE_CODE','010','0','0','AN','','','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('535','3','FEE_CI_CODE','175','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('536','3','SD_IDENTIFY','176','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('537','3','RV_IDENTIFY','177','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('538','3','FEE_FLAG','178','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('539','3','REFERENCE','179','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('540','3','TAX_CODE','180','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('541','3','SD_CODE','181','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('542','3','RV_CODE','182','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('543','3','EX_E_SIGN','017','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('544','3','APPR_ID','015','0','0','AN','','','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('545','3','CREATE_TIME','185','0','0','AN',' ','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('546','3','E_SIGN','200','0','0','AN','','R','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('547','3','MAC','187','0','0','AN',' ','R','0','',' ');

delete tblfiles_define_detail where fileid=2 and fieldcode='015';
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('547','2','OTHER2','015','0','0','AN','','R','16','',' ');
delete tblfiles_define where fileid=15;                 
insert into tblfiles_define(FILEID,FILECODE,FILEDIRECTION,FILENAMEFORMAT,FILETYPE,MSGLENGTH,FILESPLITER,LINESPLITER,READINGMETHOD,READINGMETHODLENGTH,HEADER,FOOTER,FILEENCODE,ROWENCODE,LINECOUNT,TABLENAME,CONDITION,PREFIX,SURFIX,FILEMAC,MACFORMAT,DESCRIPTION,UFLAG) VALUES(15,'03CIINC','1','N6#Ddd#V.#DMMy','1','0','','#','0','3','','','0','55','1','TBLTRANSACTIONMSG_GTW','','','','','','','1');
delete tblfiles_define_detail where fileid=15;
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('513','15','RELATION_NO','110','3','6','AN',' ','R','8','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('514','15','TRX_TYPE','003','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('515','15','O_INDIRECT_CODE','007','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('516','15','TRX_DATE','012','1','14','AN','0','R','14','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('517','15','R_INDIRECT_CODE','019','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('518','15','O_CI_CODE','021','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('519','15','R_CI_CODE','022','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('520','15','Other1','025','0','0','AN','','','0','',' ');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('521','15','CURRENCY','026','0','0','AN',' ','R','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('522','15','AMOUNT','027','0','0','N','0','L','0','','1');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('523','15','SD_NAME','028','0','0','AN',' ','R','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('524','15','SD_ADDR','029','0','0','AN',' ','R','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('525','15','SD_ACCNT','030','0','0','AN',' ','R','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('526','15','RV_NAME','031','0','0','AN',' ','R','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('527','15','RV_ADDR','032','0','0','AN',' ','R','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('528','15','RV_ACCNT','033','0','0','AN',' ','R','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('529','15','CONTENT','034','0','0','AN',' ','R','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('530','15','OPERT1','036','0','0','AN','','','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('531','15','OPERT2','037','0','0','AN','','','0','','');
insert into tblfiles_define_detail(fieldid,fileid,fieldname,fieldcode,valuepos,valuelength,datatype,padstring,padside,fieldlength,defaultvalue,checknull) values ('532','15','SERIAL_NO','011','0','0','AN',' ','R','0','','');

update  tblfiles_define_detail set fieldid=fieldcode where fileid in (select fileid from tblfiles_define where filecode like '01%');
update  tblfiles_define_detail set fieldid=fieldcode where fileid in (select fileid from tblfiles_define where filecode in ('02HLV11','02HHV11','02LV11','02HV11'));

update TBLFILES_DEFINE set FILENAMEFORMAT = 'N6#Ddd#V.#DMMy' where FILEID in (2,3);
update TBLFILES_DEFINE set FILEENCODE ='5', ROWENCODE='55';
update TBLFILES_DEFINE set  FILEENCODE= '0' where FILEDIRECTION ='0';

delete from TBLFILES_DEFINE_DETAIL where fileid=6;
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (9, 6, 'F105', '009', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (11, 6, 'F69', '011', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (23, 6, 'FILE_NAME', '023', 0, 0, 'AN', ' ', 'R', 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (43, 6, 'F94', '043', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (63, 6, 'F95', '063', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (83, 6, 'TRX_TYPE', '083', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (89, 6, 'O_CI_CODE', '089', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (97, 6, 'F20', '097', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (99, 6, 'RESPONSE_CODE', '099', 0, 0, 'AN', ' ', 'R', 4, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (1, 6, 'Other1', '001', 0, 0, 'AN', null, null, 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (106, 6, 'SERIAL_NO', '106', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (114, 6, 'TRX_DATE', '114', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (122, 6, 'F117', '122', 0, 0, 'AN', null, null, 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (128, 6, 'INPUT_TYPE', '128', 0, 0, 'AN', null, null, 1, 'H', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (129, 6, 'TAD_ID', '129', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (134, 6, 'APPR_ID', '134', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (142, 6, 'TRX_PASSWORD', '142', 0, 0, 'AN', null, null, 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (148, 6, 'E_SIGN_OLD', '148', 0, 0, 'AN', ' ', 'R', 10, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (158, 6, 'INTER_INTRA', '158', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (159, 6, 'R_CI_CODE', '159', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (167, 6, 'F20', '167', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (172, 6, 'O_INDIRECT_CODE', '172', 0, 0, 'AN', null, null, 8, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (180, 6, 'R_INDIRECT_CODE', '180', 0, 0, 'AN', null, null, 8, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (188, 6, 'TRX_STYPE', '188', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (204, 6, 'FEE_AMT', '204', 0, 0, 'AN', null, null, 12, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (190, 6, 'R_CI_PROCESS', '190', 0, 0, 'AN', null, null, 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (216, 6, 'CURRENCY', '216', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (219, 6, 'AMOUNT', '219', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (241, 6, 'SD_NAME', '241', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (311, 6, 'SD_ADDR', '311', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (381, 6, 'SD_ACCNT', '381', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (406, 6, 'RV_NAME', '406', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (476, 6, 'RV_ADDR', '476', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (546, 6, 'RV_ACCNT', '546', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (571, 6, 'CONTENT', '571', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (781, 6, 'EIS_NO', '781', 0, 0, 'AN', null, null, 7, 'O200111', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (788, 6, 'OPERT1', '788', 0, 0, 'AN', null, null, 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (790, 6, 'OPERT2', '790', 0, 0, 'AN', null, null, 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (793, 6, 'VALIDATION', '793', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (13, 6, 'Other2', '013', 0, 0, 'AN', null, null, 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (15, 6, 'Other3', '015', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (16, 6, 'Other4', '016', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (17, 6, 'Other5', '017', 0, 0, 'AN', null, null, 4, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (21, 6, 'Other6', '021', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (22, 6, 'Other7', '022', 0, 0, 'AN', null, null, 1, null, ' ');

delete from TBLFILES_DEFINE_DETAIL where fileid=7;
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (9, 7, 'F105', '009', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (11, 7, 'F69', '011', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (46, 7, 'F94', '046', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (66, 7, 'F95', '066', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (19, 7, 'TRX_TYPE', '019', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (86, 7, 'O_CI_CODE', '086', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (97, 7, 'F20', '097', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (1, 7, 'Other1', '001', 0, 0, 'AN', null, null, 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (103, 7, 'SERIAL_NO', '103', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (111, 7, 'TRX_DATE', '111', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (119, 7, 'F117', '119', 0, 0, 'AN', null, null, 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (125, 7, 'INPUT_TYPE', '125', 0, 0, 'AN', null, null, 1, 'H', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (126, 7, 'TAD_ID', '126', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (131, 7, 'APPR_ID', '131', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (139, 7, 'TRX_PASSWORD', '139', 0, 0, 'AN', null, null, 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (145, 7, 'E_SIGN_OLD', '145', 0, 0, 'AN', null, null, 10, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (155, 7, 'INTER_INTRA', '155', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (156, 7, 'R_CI_CODE', '156', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (164, 7, 'F20', '164', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (99, 7, 'RESPONSE_CODE', '099', 0, 0, 'AN', null, null, 4, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (201, 7, 'FEE_AMT', '201', 0, 0, 'AN', null, null, 12, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (187, 7, 'R_CI_PROCESS', '187', 0, 0, 'AN', null, null, 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (213, 7, 'CURRENCY', '213', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (216, 7, 'AMOUNT', '216', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (238, 7, 'SD_NAME', '238', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (308, 7, 'SD_ADDR', '308', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (378, 7, 'SD_ACCNT', '378', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (403, 7, 'RV_NAME', '403', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (473, 7, 'RV_ADDR', '473', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (543, 7, 'RV_ACCNT', '543', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (568, 7, 'CONTENT', '568', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (778, 7, 'EIS_NO', '778', 0, 0, 'AN', null, null, 7, 'O200111', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (785, 7, 'OPERT1', '785', 0, 0, 'AN', null, null, 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (787, 7, 'OPERT2', '787', 0, 0, 'AN', null, null, 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (790, 7, 'ALIDATION', '790', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (13, 7, 'Other2', '013', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (14, 7, 'Other3', '014', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (15, 7, 'Other4', '015', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (16, 7, 'Other5', '016', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (17, 7, 'F90', '017', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (18, 7, 'Other7', '018', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (169, 7, 'O_INDIRECT_CODE', '169', 0, 0, 'AN', null, null, 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (177, 7, 'R_INDIRECT_CODE', '177', 0, 0, 'AN', null, null, 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (188, 7, 'TRX_STYPE', '188', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (25, 7, 'Other10', '025', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (26, 7, 'FILE_NAME', '026', 0, 0, 'AN', ' ', 'R', 20, null, ' ');

delete from TBLFILES_DEFINE_DETAIL where fileid=8;
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (9, 8, 'F105', '009', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (11, 8, 'F69', '011', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (23, 8, 'FILE_NAME', '023', 0, 0, 'AN', ' ', 'R', 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (43, 8, 'F94', '043', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (63, 8, 'F95', '063', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (83, 8, 'TRX_TYPE', '083', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (89, 8, 'O_CI_CODE', '089', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (97, 8, 'F20', '097', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (102, 8, 'RESPONSE_CODE', '102', 0, 0, 'AN', ' ', 'R', 4, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (106, 8, 'SERIAL_NO', '106', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (114, 8, 'TRX_DATE', '114', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (122, 8, 'F85', '122', 0, 0, 'AN', null, null, 6, 'H', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (128, 8, 'INPUT_TYPE', '128', 0, 0, 'AN', ' ', 'R', 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (129, 8, 'TAD_ID', '129', 0, 0, 'N', '0', 'L', 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (134, 8, 'APPR_ID', '134', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (142, 8, 'TRX_PASSWORD', '142', 0, 0, 'AN', null, null, 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (148, 8, 'E_sign_old', '148', 0, 0, 'AN', null, null, 10, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (158, 8, 'INTER_INTRA', '158', 0, 0, 'AN', ' ', 'R', 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (159, 8, 'R_CI_CODE', '159', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (167, 8, 'R_PPC_Code', '167', 0, 0, 'AN', null, null, 5, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (180, 8, 'R_INDIRECT_CODE', '180', 0, 0, 'AN', null, null, 8, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (172, 8, 'O_INDIRECT_CODE', '172', 0, 0, 'AN', null, null, 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (188, 8, 'TRX_STYPE', '188', 0, 0, 'AN', ' ', 'R', 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (190, 8, 'R_CI_PROCESS', '190', 0, 0, 'AN', null, null, 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (204, 8, 'FEE_AMT', '204', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (216, 8, 'CURRENCY', '216', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (219, 8, 'AMOUNT', '219', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (241, 8, 'SD_NAME', '241', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (311, 8, 'SD_ADDR', '311', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (381, 8, 'SD_ACCNT', '381', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (406, 8, 'RV_NAME', '406', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (476, 8, 'RV_ADDR', '476', 0, 0, 'AN', ' ', 'R', 70, 'O200111', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (546, 8, 'RV_ACCNT', '546', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (571, 8, 'CONTENT', '571', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (781, 8, 'EIS_NO', '781', 0, 0, 'AN', ' ', 'R', 7, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (13, 8, 'Other2', '013', 0, 0, 'AN', null, null, 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (15, 8, 'Other3', '015', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (16, 8, 'Other4', '016', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (17, 8, 'Other5', '017', 0, 0, 'AN', null, null, 4, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (21, 8, 'Other6', '021', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (22, 8, 'Other7', '022', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (788, 8, 'Opert1', '788', 0, 0, 'AN', null, null, 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (790, 8, 'OPERT2', '790', 0, 0, 'AN', null, null, 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (793, 8, 'Validation', '793', 0, 0, 'AN', null, null, 20, null, ' ');

delete from TBLFILES_DEFINE_DETAIL where fileid=9;
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (9, 9, 'F105', '009', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (11, 9, 'F69', '011', 0, 0, 'AN', null, null, 2, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (46, 9, 'F94', '046', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (66, 9, 'F95', '066', 0, 0, 'AN', null, null, 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (19, 9, 'TRX_TYPE', '019', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (86, 9, 'O_CI_CODE', '086', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (94, 9, 'F20', '094', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (103, 9, 'SERIAL_NO', '103', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (111, 9, 'TRX_DATE', '111', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (119, 9, 'F117', '119', 0, 0, 'AN', null, null, 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (125, 9, 'INPUT_TYPE', '125', 0, 0, 'AN', ' ', 'R', 1, 'H', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (126, 9, 'TAD_ID', '126', 0, 0, 'N', '0', 'L', 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (131, 9, 'APPR_ID', '131', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (139, 9, 'TRX_PASSWORD', '139', 0, 0, 'AN', null, null, 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (145, 9, 'E_SIGN_OLD', '145', 0, 0, 'AN', null, null, 10, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (155, 9, 'INTER_INTRA', '155', 0, 0, 'AN', ' ', 'R', 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (156, 9, 'R_CI_CODE', '156', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (164, 9, 'PPC_CODE', '164', 0, 0, 'AN', null, null, 5, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (99, 9, 'RESPONSE_CODE', '099', 0, 0, 'AN', ' ', 'R', 4, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (187, 9, 'R_CI_PROCESS', '187', 0, 0, 'AN', null, null, 14, '0', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (185, 9, 'TRX_STYPE', '185', 0, 0, 'AN', ' ', 'R', 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (201, 9, 'FEE_AMT', '201', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (213, 9, 'CURRENCY', '213', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (216, 9, 'AMOUNT', '216', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (238, 9, 'SD_NAME', '238', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (308, 9, 'SD_ADDR', '308', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (378, 9, 'SD_ACCNT', '378', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (403, 9, 'RV_NAME', '403', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (473, 9, 'RV_ADDR', '473', 0, 0, 'AN', ' ', 'R', 70, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (543, 9, 'RV_ACCNT', '543', 0, 0, 'AN', ' ', 'R', 25, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (568, 9, 'CONTENT', '568', 0, 0, 'AN', ' ', 'R', 210, 'O200111', ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (778, 9, 'EIS_NO', '778', 0, 0, 'AN', ' ', 'R', 7, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (785, 9, 'OPERT1', '785', 0, 0, 'AN', null, null, 2, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (787, 9, 'OPERT2', '787', 0, 0, 'AN', null, null, 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (13, 9, 'Other2', '013', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (14, 9, 'Other3', '014', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (15, 9, 'Other4', '015', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (16, 9, 'Other5', '016', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (17, 9, 'F90', '017', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (18, 9, 'Other7', '018', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (169, 9, 'O_INDIRECT_CODE', '169', 0, 0, 'AN', null, null, 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (177, 9, 'R_INDIRECT_CODE', '177', 0, 0, 'AN', null, null, 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (25, 9, 'Other10', '025', 0, 0, 'AN', null, null, 1, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (26, 9, 'FILE_NAME', '026', 0, 0, 'AN', ' ', 'R', 20, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL) values (790, 9, 'VALIDATION', '790', 0, 0, 'AN', null, null, 20, null, ' ');

update TBLFILES_DEFINE set FILENAMEFORMAT = 'VPLV11#DMMddyy', FOOTER = 'VTT#V99999999#F8#F20#N8#F768' where FILEID=8;
update TBLFILES_DEFINE set FILENAMEFORMAT = 'VPHV11#DMMddyy', FOOTER = 'VTT#V99999999#F8#F20#N8#F765' where FILEID=9;

ALTER TABLE TBLRESTORE ALTER COLUMN FILE_NAME nvarchar (50);
ALTER TABLE TBLBACKUP_FILE ALTER COLUMN FILE_NAME nvarchar (50);
DELETE FROM TBLBACKUP_DEFINE WHERE BACKUP_DEF_CODE LIKE '9%';

INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('90TRXOUT',N'Dữ liệu giao dịch đi', N'Data transaction outgoing');
INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('91TRXIN',N'Dữ liệu giao dịch đến', N'Data transaction incoming');
INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('92MRCD',N'Dữ liệu tra soát, hoàn chuyển, hủy, trả lời chuyển nợ, trả lời tra soát, trả lời hoàn chuyển.',N'verification data, returning, cancel, debit transaction response, verification response, returning response');
INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('93CCIOUT',N'Dữ liệu đối chiếu giao dịch đi của chi nhánh (CI)',N'outgoing transaction comparing data of branch (CI)');
INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('94CCIIN',N'Dữ liệu đối chiếu giao dịch đến của chi nhánh (CI)',N'incoming transaction comparing data of branch');
INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('95CHOOUT',N'Dữ liệu đối chiếu giao dịch đi của hội sở (HO)', N'Outgoing transaction comparing data of Head Office(HO)');
INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('96CHOIN',N'Dữ liệu đối chiếu giao dịch đến của hội sở (HO)', N'Incoming transaction comparing data of Head office(HO)');
INSERT INTO TBLBACKUP_DEFINE (BACKUP_DEF_CODE,NAME_V,NAME_E) VALUES ('97AUDIT',N'Dữ liệu thao tác chương trình', N'Data action access of application');

DELETE FROM TBLBACKUP_DEFINE_DETAIL  WHERE BACKUP_DEF_CODE LIKE '9%';

INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('90TRXOUT','TBLTRANSACTIONMSG_ORG','TRX_DATE','1','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('91TRXIN','TBLTRANSACTIONMSG_ORG','TRX_DATE','1','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('92MRCD','TBLCANCEL_TRX','TRX_DATE','1','TRX_DATE,SERIAL_NO');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('92MRCD','TBLFUND_RETURN','TRX_DATE','1','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('92MRCD','TBLFUND_RETURNX','TRX_DATE','1','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('92MRCD','TBLLETTER_MSG','TRX_DATE','1','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('92MRCD','TBLLETTER_MSGX','TRX_DATE','1','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('92MRCD','TBLPRE_AUTH_DEBITX','TRX_DATE','1','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('93CCIOUT','TBLHV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('93CCIOUT','TBLHV_COMPARE_COLLECT','TRX_DATE','2','TRX_TYPE,TRX_DATE,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('93CCIOUT','TBLLV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('93CCIOUT','TBLLV_COMPARE_COLLECT','TRX_DATE','2','TRX_TYPE,TRX_DATE,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('94CCIIN','TBLHV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('94CCIIN','TBLHV_COMPARE_COLLECT','TRX_DATE','2','TRX_TYPE,TRX_DATE,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('94CCIIN','TBLLV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('94CCIIN','TBLLV_COMPARE_COLLECT','TRX_DATE','2','TRX_TYPE,TRX_DATE,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('95CHOOUT','TBLHHV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('95CHOOUT','TBLHHV_COMPARE_COLLECT','TRX_DATE','2','TRX_DATE,TRX_TYPE,CI_ID,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('95CHOOUT','TBLHLV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('95CHOOUT','TBLHLV_COMPARE_COLLECT','TRX_DATE','2','TRX_TYPE,TRX_DATE,CI_ID,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('96CHOIN','TBLHHV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('96CHOIN','TBLHHV_COMPARE_COLLECT','TRX_DATE','2','TRX_DATE,TRX_TYPE,CI_ID,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('96CHOIN','TBLHLV_COMPARE','TRX_DATE','2','SERIAL_NO,TRX_DATE,O_CI_ID');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('96CHOIN','TBLHLV_COMPARE_COLLECT','TRX_DATE','2','TRX_TYPE,TRX_DATE,CI_ID,SD_RV');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('97AUDIT','TBLTRANSACTIONMSG_AUDIT','TRX_DATE','0','ACTION_TIME,TRX_DATE,SERIAL_NO,O_CI_ID');

INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('97AUDIT','TBLUSER_LOG','ACTION_TIME','0','MENU_ID,USER_ID,ACTION_TIME');
INSERT INTO TBLBACKUP_DEFINE_DETAIL (BACKUP_DEF_CODE,TABLE_NAME,DATE_FIELD,IS_MSG_KEY,KEY_LIST) VALUES ('97AUDIT','TBLFILE_LIST','TRX_DATE','2','TRX_DATE,TRX_FILE_NAME');

DELETE TBLMENU_LIST WHERE MENU_ID IN (18,19,83,84);
delete tblmenu_group where menu_id in (83,84) and group_id in (select group_id from tblgroup_right where group_id in(SELECT GROUP_ID FROM TBLMENU_GROUP where menu_id in (18,19) and used = '1') and used = '1' group by group_id);

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBLCURRENCY]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[TBLCURRENCY];

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBLTRX_TYPE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[TBLTRX_TYPE];

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBLVALUABLE_PAPERS]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[TBLVALUABLE_PAPERS];

create table TBLCURRENCY( ID nvarchar(4) not null, CURRENCY nvarchar(3), NAME_V nvarchar(200) not null,NAME_E nvarchar(200) not null,COUNTRYNAME_V nvarchar(150),COUNTRYNAME_E nvarchar(150)) ;
ALTER TABLE TBLCURRENCY ADD PRIMARY KEY (ID) ;

create table TBLVALUABLE_PAPERS (ID nvarchar(4) not null,NAME_V   nvarchar(200) not null,  NAME_E   nvarchar(200) not null,  COMMENTS nvarchar(200));
ALTER TABLE TBLVALUABLE_PAPERS ADD PRIMARY KEY (ID) ;

create table TBLTRX_TYPE(ID nvarchar(4) not null,NAME_V   nvarchar(200) not null,NAME_E   nvarchar(200) not null,COMMENTS nvarchar(200));
ALTER TABLE TBLTRX_TYPE ADD PRIMARY KEY (ID) ;

insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'00', N'VND', N'Việt Nam', N'Dong', N'Việt Nam', N'VietNam');
insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'01', N'EUR', N'Đồng tiền chung Châu Âu', N'Euro', N'Đồng tiền chung Châu Âu', N'Euro');
insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'02', N'USD', N'Mỹ', N'Dollar/Cents ', N'Mỹ', N'American');
insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'03', N'JPY', N'Nhật bản', N'Yen/Sen ', N'Nhật bản', N'Japanesse');
insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'04', N'CNY', N'Trung Quốc', N'Yuan/Jiao/Fen ', N'Trung Quốc', N'China');
insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'05', N'LAK', N'Lào', N'Kip/At ', N'Lào', N'Lao');
insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'06', N'KHR', N'Cam-pu-chia', N'Riel/Sen ', N'Cam-pu-chia', N'Campuchia');
insert into TBLCURRENCY (ID, CURRENCY, NAME_V, NAME_E, COUNTRYNAME_V, COUNTRYNAME_E) values (N'09', N'OTH', N'Các đồng tiền khác', N'Other', N'Các nước khác', N'Other');

insert into TBLTRX_TYPE (ID, NAME_V, NAME_E, COMMENTS) values (N'901', N'Cho vay', N'Cho vay', N'Đối tác, lãi suất, kỳ hạn, loại tiền');
insert into TBLTRX_TYPE (ID, NAME_V, NAME_E, COMMENTS) values (N'902', N'Mua có kỳ hạn GTCG', N'Mua có kỳ hạn GTCG', N'Đối tác, lãi suất, kỳ hạn, loại tiền, loại GTCG');

insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'1011', N'Kỳ phiếu kỳ hạn dưới 6 tháng', N'Kỳ phiếu kỳ hạn dưới 6 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'1012', N'Kỳ phiếu kỳ hạn từ 6 tháng đến 12 tháng', N'Kỳ phiếu kỳ hạn từ 6 tháng đến 12 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'2011', N'Tín phiếu NHNN kỳ hạn dưới 6 tháng', N'Tín phiếu NHNN kỳ hạn dưới 6 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'2012', N'Tín phiếu NHNN kỳ hạn từ 6 tháng đến 12 tháng', N'Tín phiếu NHNN kỳ hạn từ 6 tháng đến 12 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'2021', N'Tín phiếu KBNN kỳ hạn dưới 6 tháng', N'Tín phiếu KBNN kỳ hạn dưới 6 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'2022', N'Tín phiếu KBNN kỳ hạn từ 6 tháng đến 12 tháng', N'Tín phiếu KBNN kỳ hạn từ 6 tháng đến 12 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'2031', N'Tín phiếu NHTM loại dưới 6 tháng', N'Tín phiếu NHTM loại dưới 6 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'2032', N'Tín phiếu NHTM loại từ 6 tháng đến 12 tháng', N'Tín phiếu NHTM loại từ 6 tháng đến 12 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3011', N'Trái phiếu NHNN loại từ trên 12 tháng đến 24 tháng', N'Trái phiếu NHNN loại từ trên 12 tháng đến 24 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3012', N'Trái phiếu NHNN loại từ trên 24 tháng đến 60 tháng', N'Trái phiếu NHNN loại từ trên 24 tháng đến 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3013', N'Trái phiếu NHNN loại trên 60 tháng', N'Trái phiếu NHNN loại trên 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3021', N'Trái phiếu KBNN loại từ trên 12 tháng đến 24 tháng', N'Trái phiếu KBNN loại từ trên 12 tháng đến 24 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3022', N'Trái phiếu KBNN loại từ trên 24 tháng đến 60 tháng', N'Trái phiếu KBNN loại từ trên 24 tháng đến 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3023', N'Trái phiếu KBNN loại trên 60 tháng', N'Trái phiếu KBNN loại trên 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3031', N'Trái phiếu NHTM loại từ trên 12 tháng đến 24 tháng', N'Trái phiếu NHTM loại từ trên 12 tháng đến 24 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3032', N'Trái phiếu NHTM loại từ trên 24 tháng đến 60 tháng', N'Trái phiếu NHTM loại từ trên 24 tháng đến 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'3033', N'Trái phiếu NHTM loại trên 60 tháng', N'Trái phiếu NHTM loại trên 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'4011', N'Chứng chỉ tiền gửi dưới 6 tháng', N'Chứng chỉ tiền gửi dưới 6 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'4012', N'Chứng chỉ tiền gửi từ 6 tháng đến 12 tháng', N'Chứng chỉ tiền gửi từ 6 tháng đến 12 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'4021', N'Chứng chỉ tiền gửi trên 12 tháng đến 24 tháng', N'Chứng chỉ tiền gửi trên 12 tháng đến 24 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'4022', N'Chứng chỉ tiền gửi trên 24 tháng đến 60 tháng', N'Chứng chỉ tiền gửi trên 24 tháng đến 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'4023', N'Chứng chỉ tiền gửi trên 60 tháng', N'Chứng chỉ tiền gửi trên 60 tháng', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'8000', N'Các loại giấy tờ có giá ngắn hạn khác', N'Các loại giấy tờ có giá ngắn hạn khác', null);
insert into TBLVALUABLE_PAPERS (ID, NAME_V, NAME_E, COMMENTS) values (N'9000', N'Các loại giấy tờ có giá dài hạn khác', N'Các loại giấy tờ có giá dài hạn khác', null);

DELETE  TBLFILE_INFO where trx_type in('800006','800007','800008');
insert into TBLFILE_INFO (FILE_NAME, FILE_TYPE, TRX_TYPE, TABLE_NAME, SR, DESCRIPTION_V, DESCRIPTION_E, COMMENTS) values ('RPAP11',N'08',N'800008',N'TBLVALUABLE_PAPERS',N'R',N'File danh sách Giấy tờ có gía cập nhật',N'File list of Valuable papers updated',N'File danh sách Giấy tờ có gía cập nhật');
insert into TBLFILE_INFO (FILE_NAME, FILE_TYPE, TRX_TYPE, TABLE_NAME, SR, DESCRIPTION_V, DESCRIPTION_E, COMMENTS) values ('RPAP12',N'08',N'800008',N'TBLVALUABLE_PAPERS',N'R',N'File danh sách Giấy tờ có gía đầy đủ',N'File list of Valuable papers full',N'File danh sách Giấy tờ có gía đầy đủ');
insert into TBLFILE_INFO (FILE_NAME, FILE_TYPE, TRX_TYPE, TABLE_NAME, SR, DESCRIPTION_V, DESCRIPTION_E, COMMENTS) values ('RCUR11',N'08',N'800007',N'TBLCURRENCY',N'R',N'File danh sách Loại tiền tệ cập nhật',N'File list of Currency updated',N'File danh sách Loại tiền tệ cập nhật');
insert into TBLFILE_INFO (FILE_NAME, FILE_TYPE, TRX_TYPE, TABLE_NAME, SR, DESCRIPTION_V, DESCRIPTION_E, COMMENTS) values ('RCUR12',N'08',N'800007',N'TBLCURRENCY',N'R',N'File danh sách Loại tiền tệ đầy đủ',N'File list of full currency',N'File danh sách Loại tiền tệ đầy đủ');
insert into TBLFILE_INFO (FILE_NAME, FILE_TYPE, TRX_TYPE, TABLE_NAME, SR, DESCRIPTION_V, DESCRIPTION_E, COMMENTS) values ('RTRX11',N'08',N'800006',N'TBLTRX_TYPE',N'R',N'File danh sách Loại giao dịch thị trường LNH cập nhật',N'File list of transactions interbank market update',N'File danh sách Loại giao dịch thị trường LNH cập nhật');
insert into TBLFILE_INFO (FILE_NAME, FILE_TYPE, TRX_TYPE, TABLE_NAME, SR, DESCRIPTION_V, DESCRIPTION_E, COMMENTS) values ('RTRX12',N'08',N'800006',N'TBLTRX_TYPE',N'R',N'File danh sách Loại giao dịch thị trường LNH đầy đủ',N'File list of transactions interbank market fully',N'File danh sách Loại giao dịch thị trường LNH đầy đủ');

DELETE  TBLSERVICE_LIST  where trx_type in('800006','800007','800008');
insert into TBLSERVICE_LIST (SERV_CODE, TRX_TYPE, NAME_E, NAME_V, TUX_SERV, CAT_ID, TABLE_NAME) values ('RT',N'800006',N'Transactions interbank market',N'Loại giao dịch thị trường LNH ',N'RM_SFN_0506006', null,N'TBLTRX_TYPE');
insert into TBLSERVICE_LIST (SERV_CODE, TRX_TYPE, NAME_E, NAME_V, TUX_SERV, CAT_ID, TABLE_NAME) values ('RY',N'800007',N'Currency',N'Loại tiền tệ',N'RM_SFN_0506006', null,N'TBLCURRENCY');
insert into TBLSERVICE_LIST (SERV_CODE, TRX_TYPE, NAME_E, NAME_V, TUX_SERV, CAT_ID, TABLE_NAME) values ('RV',N'800008',N'Valuable papers',N'Giấy tờ có gía',N'RM_SFN_0506006', null,N'TBLVALUABLE_PAPERS');

IF EXISTS (SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tbltransactionmessageformat' AND COLUMN_NAME in ('tbltrx_type','tblcurrency','tblvaluable_papers','rt','ry','rv')) alter table tbltransactionmessageformat drop COLUMN tbltrx_type,tblcurrency,tblvaluable_papers,rt,ry,rv;

alter table tbltransactionmessageformat add tbltrx_type bigint, tblcurrency bigint, tblvaluable_papers bigint,  rt bigint,  ry bigint, rv bigint;

delete from tbltransactionmessageformat where (field_no>139) or (field_code='CURRENCY');
insert into TBLTRANSACTIONMESSAGEFORMAT (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, NFIELD_CODE, HEADERFILE, TRAILERFILE, TBLHHV_COMPARE, TBLHLV_COMPARE, TBLHV_COMPARE, TBLLV_COMPARE, TBLHV_COMPARE_COLLECT, TBLLV_COMPARE_COLLECT, TBLHHV_COMPARE_COLLECT, TBLHLV_COMPARE_COLLECT, TBLCI_LIST, TBLCI_SYSTEM, TBLPROVINCE_LIST, TBLSERVER_LIST, TBLTRANSACTIONMSG_ORG, TBLPRE_AUTH_DEBITX, TBLFUND_RETURN, TBLFUND_RETURNX, TBLLETTER_MSG, TBLLETTER_MSGX, TBLCANCEL_TRX, TBLWARNING_BALANCE, TBLWARNING_OVERALL_LIMIT, TBLCERT_INFO, LF, PA, LI, HF, HI, BI, HP, HD, HN, LN, PN, WR, WN, OI, OW, LM, HM, LR, HR, LC, HC, LA, LU, LS, LE, LT, FF, HA, HU, HS, HE, HT, RC, MA, SY, RS, RP, CC, CH, RA, IMPORT, EXPORT, MONEYFIELD, MESSAGE_NOTIFY, MESSAGE_RESPONSE, TBLTRX_TYPE, TBLCURRENCY, TBLVALUABLE_PAPERS, RT, RY, RV) values (140, null, 'ID', 'AN', 4, 'ID', null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'F', 0, 0, 1, 1, 1, 1, 1, 1);
insert into TBLTRANSACTIONMESSAGEFORMAT (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, NFIELD_CODE, HEADERFILE, TRAILERFILE, TBLHHV_COMPARE, TBLHLV_COMPARE, TBLHV_COMPARE, TBLLV_COMPARE, TBLHV_COMPARE_COLLECT, TBLLV_COMPARE_COLLECT, TBLHHV_COMPARE_COLLECT, TBLHLV_COMPARE_COLLECT, TBLCI_LIST, TBLCI_SYSTEM, TBLPROVINCE_LIST, TBLSERVER_LIST, TBLTRANSACTIONMSG_ORG, TBLPRE_AUTH_DEBITX, TBLFUND_RETURN, TBLFUND_RETURNX, TBLLETTER_MSG, TBLLETTER_MSGX, TBLCANCEL_TRX, TBLWARNING_BALANCE, TBLWARNING_OVERALL_LIMIT, TBLCERT_INFO, LF, PA, LI, HF, HI, BI, HP, HD, HN, LN, PN, WR, WN, OI, OW, LM, HM, LR, HR, LC, HC, LA, LU, LS, LE, LT, FF, HA, HU, HS, HE, HT, RC, MA, SY, RS, RP, CC, CH, RA, IMPORT, EXPORT, MONEYFIELD, MESSAGE_NOTIFY, MESSAGE_RESPONSE, TBLTRX_TYPE, TBLCURRENCY, TBLVALUABLE_PAPERS, RT, RY, RV) values (141, null,N'Tên tiếng Việt', 'AN', 200, 'NAME_V', null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'F', 0, 0, 2, 3, 2, 2, 3, 2);
insert into TBLTRANSACTIONMESSAGEFORMAT (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, NFIELD_CODE, HEADERFILE, TRAILERFILE, TBLHHV_COMPARE, TBLHLV_COMPARE, TBLHV_COMPARE, TBLLV_COMPARE, TBLHV_COMPARE_COLLECT, TBLLV_COMPARE_COLLECT, TBLHHV_COMPARE_COLLECT, TBLHLV_COMPARE_COLLECT, TBLCI_LIST, TBLCI_SYSTEM, TBLPROVINCE_LIST, TBLSERVER_LIST, TBLTRANSACTIONMSG_ORG, TBLPRE_AUTH_DEBITX, TBLFUND_RETURN, TBLFUND_RETURNX, TBLLETTER_MSG, TBLLETTER_MSGX, TBLCANCEL_TRX, TBLWARNING_BALANCE, TBLWARNING_OVERALL_LIMIT, TBLCERT_INFO, LF, PA, LI, HF, HI, BI, HP, HD, HN, LN, PN, WR, WN, OI, OW, LM, HM, LR, HR, LC, HC, LA, LU, LS, LE, LT, FF, HA, HU, HS, HE, HT, RC, MA, SY, RS, RP, CC, CH, RA, IMPORT, EXPORT, MONEYFIELD, MESSAGE_NOTIFY, MESSAGE_RESPONSE, TBLTRX_TYPE, TBLCURRENCY, TBLVALUABLE_PAPERS, RT, RY, RV) values (142, null,N'Tên tiếng Anh', 'AN', 200, 'NAME_E', null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'F', 0, 0, 3, 4, 3, 3, 4, 3);
insert into TBLTRANSACTIONMESSAGEFORMAT (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, NFIELD_CODE, HEADERFILE, TRAILERFILE, TBLHHV_COMPARE, TBLHLV_COMPARE, TBLHV_COMPARE, TBLLV_COMPARE, TBLHV_COMPARE_COLLECT, TBLLV_COMPARE_COLLECT, TBLHHV_COMPARE_COLLECT, TBLHLV_COMPARE_COLLECT, TBLCI_LIST, TBLCI_SYSTEM, TBLPROVINCE_LIST, TBLSERVER_LIST, TBLTRANSACTIONMSG_ORG, TBLPRE_AUTH_DEBITX, TBLFUND_RETURN, TBLFUND_RETURNX, TBLLETTER_MSG, TBLLETTER_MSGX, TBLCANCEL_TRX, TBLWARNING_BALANCE, TBLWARNING_OVERALL_LIMIT, TBLCERT_INFO, LF, PA, LI, HF, HI, BI, HP, HD, HN, LN, PN, WR, WN, OI, OW, LM, HM, LR, HR, LC, HC, LA, LU, LS, LE, LT, FF, HA, HU, HS, HE, HT, RC, MA, SY, RS, RP, CC, CH, RA, IMPORT, EXPORT, MONEYFIELD, MESSAGE_NOTIFY, MESSAGE_RESPONSE, TBLTRX_TYPE, TBLCURRENCY, TBLVALUABLE_PAPERS, RT, RY, RV) values (143, null,N'Tên Quốc gia tiếng Việt', 'AN', 150, 'COUNTRYNAME_V', null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'F', 0, 0, 0, 5, 0, 0, 5, 0);
insert into TBLTRANSACTIONMESSAGEFORMAT (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, NFIELD_CODE, HEADERFILE, TRAILERFILE, TBLHHV_COMPARE, TBLHLV_COMPARE, TBLHV_COMPARE, TBLLV_COMPARE, TBLHV_COMPARE_COLLECT, TBLLV_COMPARE_COLLECT, TBLHHV_COMPARE_COLLECT, TBLHLV_COMPARE_COLLECT, TBLCI_LIST, TBLCI_SYSTEM, TBLPROVINCE_LIST, TBLSERVER_LIST, TBLTRANSACTIONMSG_ORG, TBLPRE_AUTH_DEBITX, TBLFUND_RETURN, TBLFUND_RETURNX, TBLLETTER_MSG, TBLLETTER_MSGX, TBLCANCEL_TRX, TBLWARNING_BALANCE, TBLWARNING_OVERALL_LIMIT, TBLCERT_INFO, LF, PA, LI, HF, HI, BI, HP, HD, HN, LN, PN, WR, WN, OI, OW, LM, HM, LR, HR, LC, HC, LA, LU, LS, LE, LT, FF, HA, HU, HS, HE, HT, RC, MA, SY, RS, RP, CC, CH, RA, IMPORT, EXPORT, MONEYFIELD, MESSAGE_NOTIFY, MESSAGE_RESPONSE, TBLTRX_TYPE, TBLCURRENCY, TBLVALUABLE_PAPERS, RT, RY, RV) values (144, null,N'Tên Quốc gia tiếng Anh', 'AN', 150, 'COUNTRYNAME_E', null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'F', 0, 0, 0, 6, 0, 0, 6, 0);
insert into TBLTRANSACTIONMESSAGEFORMAT (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, NFIELD_CODE, HEADERFILE, TRAILERFILE, TBLHHV_COMPARE, TBLHLV_COMPARE, TBLHV_COMPARE, TBLLV_COMPARE, TBLHV_COMPARE_COLLECT, TBLLV_COMPARE_COLLECT, TBLHHV_COMPARE_COLLECT, TBLHLV_COMPARE_COLLECT, TBLCI_LIST, TBLCI_SYSTEM, TBLPROVINCE_LIST, TBLSERVER_LIST, TBLTRANSACTIONMSG_ORG, TBLPRE_AUTH_DEBITX, TBLFUND_RETURN, TBLFUND_RETURNX, TBLLETTER_MSG, TBLLETTER_MSGX, TBLCANCEL_TRX, TBLWARNING_BALANCE, TBLWARNING_OVERALL_LIMIT, TBLCERT_INFO, LF, PA, LI, HF, HI, BI, HP, HD, HN, LN, PN, WR, WN, OI, OW, LM, HM, LR, HR, LC, HC, LA, LU, LS, LE, LT, FF, HA, HU, HS, HE, HT, RC, MA, SY, RS, RP, CC, CH, RA, IMPORT, EXPORT, MONEYFIELD, MESSAGE_NOTIFY, MESSAGE_RESPONSE, TBLTRX_TYPE, TBLCURRENCY, TBLVALUABLE_PAPERS, RT, RY, RV) values (145, null,N'Ghi chú', 'AN', 200, 'COMMENTS', null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'F', 0, 0, 4, 0, 4, 4, 0, 4);
insert into TBLTRANSACTIONMESSAGEFORMAT (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, NFIELD_CODE, HEADERFILE, TRAILERFILE, TBLHHV_COMPARE, TBLHLV_COMPARE, TBLHV_COMPARE, TBLLV_COMPARE, TBLHV_COMPARE_COLLECT, TBLLV_COMPARE_COLLECT, TBLHHV_COMPARE_COLLECT, TBLHLV_COMPARE_COLLECT, TBLCI_LIST, TBLCI_SYSTEM, TBLPROVINCE_LIST, TBLSERVER_LIST, TBLTRANSACTIONMSG_ORG, TBLPRE_AUTH_DEBITX, TBLFUND_RETURN, TBLFUND_RETURNX, TBLLETTER_MSG, TBLLETTER_MSGX, TBLCANCEL_TRX, TBLWARNING_BALANCE, TBLWARNING_OVERALL_LIMIT, TBLCERT_INFO, LF, PA, LI, HF, HI, BI, HP, HD, HN, LN, PN, WR, WN, OI, OW, LM, HM, LR, HR, LC, HC, LA, LU, LS, LE, LT, FF, HA, HU, HS, HE, HT, RC, MA, SY, RS, RP, CC, CH, RA, IMPORT, EXPORT, MONEYFIELD, MESSAGE_NOTIFY, MESSAGE_RESPONSE, TBLTRX_TYPE, TBLCURRENCY, TBLVALUABLE_PAPERS, RT, RY, RV) values (15, null,N'Mã Loại tiền', 'AN', 3, 'CURRENCY', 'CURRENCY_CODE', 0, 0, 12, 12, 12, 12, 3, 3, 3, 3, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 22, 0, 23, 0, 0, 23, 0, 23, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'F', 0, 0, null, 2, null, null, 2, null);


delete from TBLMENU_GROUP where menu_id = 83;
delete from TBLMENU_LIST where  menu_id = 83;

insert into TBLMENU_GROUP (MENU_ID, GROUP_ID, ACTION_RIGHT, USED) values (83, 6, 'PRINT|QUERY|VIEW|', '1');
insert into TBLMENU_GROUP (MENU_ID, GROUP_ID, ACTION_RIGHT, USED) values (83, 7, 'PRINT|QUERY|VIEW|', '1');
insert into TBLMENU_GROUP (MENU_ID, GROUP_ID, ACTION_RIGHT, USED) values (83, 8, 'PRINT|QUERY|VIEW|', '1');
insert into TBLMENU_GROUP (MENU_ID, GROUP_ID, ACTION_RIGHT, USED) values (83, 9, null, '0');
insert into TBLMENU_GROUP (MENU_ID, GROUP_ID, ACTION_RIGHT, USED) values (83, 11, null, '0');

insert into TBLMENU_LIST (MENU_ID, PARENT_ID, MENU_NAME_V, MENU_NAME_E, MENU_TYPE, ACTION_RIGHT, RUN_AT, VISIBLE, PATH, SQ) values (83, 59, N'B.Theo dõi tra soát xử lý qua CI-Gateway', 'B.Letter CI-Gateway Monitoring', 0, 'VIEW|DETAIL|QUERY|PRINT', 'C', '1', 'CIGATEWAY_Monitoring/frmLetterGWMonitoring.aspx', 2);

delete from TBLLISTRESPONSECODE where RESPONSE_CODE='1423';
insert into TBLLISTRESPONSECODE (RESPONSE_CODE, DESCRIPTION_E, DESCRIPTION_V, RESEND, AUTO_IQ) values ('1423', 'Not found original verify', N'Không tìm thấy lệnh tra soát gốc', null, null);

IF EXISTS (SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tblletter_msg' AND COLUMN_NAME = 'INPUT_TYPE') alter table tblletter_msg drop COLUMN INPUT_TYPE;
IF EXISTS (SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tblletter_msg' AND COLUMN_NAME = 'GTW_FLAG') alter table tblletter_msg drop COLUMN GTW_FLAG;
alter table tblletter_msg add INPUT_TYPE VARCHAR(1), GTW_FLAG CHAR(1);

IF EXISTS (SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tblletter_msgx' AND COLUMN_NAME = 'INPUT_TYPE') alter table tblletter_msgx drop COLUMN INPUT_TYPE;
IF EXISTS (SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tblletter_msgx' AND COLUMN_NAME = 'GTW_FLAG') alter table tblletter_msgx drop COLUMN GTW_FLAG;
alter table tblletter_msgx add INPUT_TYPE VARCHAR(1), GTW_FLAG CHAR(1);

delete tblenv_control where type in('APPR_AUTO', 'IMP_LETTER', 'APPR_NUM');
insert into TBLENV_CONTROL (TYPE, VALUE, UNIT, DESCRIPTION, DISPLAY) values ('APPR_AUTO', '0', null, null, null);
insert into TBLENV_CONTROL (TYPE, VALUE, UNIT, DESCRIPTION, DISPLAY) values ('IMP_LETTER', '0', null, null, null);
insert into TBLENV_CONTROL (TYPE, VALUE, UNIT, DESCRIPTION, DISPLAY) values ('APPR_NUM', '50', null, null, null);

update TBLSERVICE_LIST set NAME_V=N'Trả lời yêu cầu tra soát giá trị cao' where SERV_CODE='HS' and TRX_TYPE='206002';

delete from tblfiles_define where fileid in (16,17,18,19);
insert into TBLFILES_DEFINE (FILEID, FILECODE, FILEDIRECTION, FILENAMEFORMAT, FILETYPE, MSGLENGTH, FILESPLITER, LINESPLITER, READINGMETHOD, READINGMETHODLENGTH, HEADER, FOOTER, FILEENCODE, ROWENCODE, LINECOUNT, TABLENAME, CONDITION, PREFIX, SURFIX, FILEMAC, MACFORMAT, DESCRIPTION, UFLAG) values (16, '05CIOLM', '0', 'VGTW#VOLM#DyyyyMMdd#V.#Dhhmmss', '1', 1237, '' + char(13) + '' + char(10) + '', null, '1', 0, 'VHH#F12#F25#DyyyyMMdd#N8', 'VTT#F12#F25#DyyyyMMdd#N8', '0', '55', 20, null, null, 'VDD', null, '1', 'F28', null, '1');
insert into TBLFILES_DEFINE (FILEID, FILECODE, FILEDIRECTION, FILENAMEFORMAT, FILETYPE, MSGLENGTH, FILESPLITER, LINESPLITER, READINGMETHOD, READINGMETHODLENGTH, HEADER, FOOTER, FILEENCODE, ROWENCODE, LINECOUNT, TABLENAME, CONDITION, PREFIX, SURFIX, FILEMAC, MACFORMAT, DESCRIPTION, UFLAG) values (18, '05CIORM', '0', 'VGTW#VORM#DyyyyMMdd#V.#Dhhmmss', '1', 1487, '' + char(13) + '' + char(10) + '', null, '1', 0, 'VHH#F12#F25#DyyyyMMdd#N8', 'VTT#F12#F25#DyyyyMMdd#N8', '0', '55', 20, null, null, 'VDD', null, '1', 'F28', null, '1');
insert into TBLFILES_DEFINE (FILEID, FILECODE, FILEDIRECTION, FILENAMEFORMAT, FILETYPE, MSGLENGTH, FILESPLITER, LINESPLITER, READINGMETHOD, READINGMETHODLENGTH, HEADER, FOOTER, FILEENCODE, ROWENCODE, LINECOUNT, TABLENAME, CONDITION, PREFIX, SURFIX, FILEMAC, MACFORMAT, DESCRIPTION, UFLAG) values (17, '06GWILM', '1', 'VGTW#VILM#DyyyyMMdd#V.#Dhhmmss', '1', 0, '' + char(13) + '' + char(10) + '', null, '1', 0, 'VHH#F12#F25#DyyyyMMdd#N8', 'VTT#F12#F25#DyyyyMMdd#N8', '5', '55', 20, 'tbllettermsg_gtw', null, 'VDD', null, '1', 'F28', null, '1');
insert into TBLFILES_DEFINE (FILEID, FILECODE, FILEDIRECTION, FILENAMEFORMAT, FILETYPE, MSGLENGTH, FILESPLITER, LINESPLITER, READINGMETHOD, READINGMETHODLENGTH, HEADER, FOOTER, FILEENCODE, ROWENCODE, LINECOUNT, TABLENAME, CONDITION, PREFIX, SURFIX, FILEMAC, MACFORMAT, DESCRIPTION, UFLAG) values (19, '06GWIRM', '1', 'VGTW#VIRM#DyyyyMMdd#V.#Dhhmmss', '1', 0, '' + char(13) + '' + char(10) + '', null, '1', 0, 'VHH#F12#F25#DyyyyMMdd#N8', 'VTT#F12#F25#DyyyyMMdd#N8', '5', '55', 20, 'tbllettermsgx_gtw', null, 'VDD', null, '1', 'F28', null, '1');

delete from tblfiles_define_detail where fileid in (16,17,18,19);
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (1, 16, 'TRX_TYPE', '001', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (2, 16, 'SD_TIME', '002', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (3, 16, 'SERIAL_NO', '003', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (4, 16, 'RESPONSE_CODE', '004', 0, 0, 'AN', ' ', 'R', 4, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (5, 16, 'O_CI_CODE', '005', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (6, 16, 'R_CI_CODE', '006', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (7, 16, 'TRX_DATE', '007', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (8, 16, 'LETTER_CONTENT', '008', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (9, 16, 'RELATION_NO_ORG', '009', 0, 0, 'AN', ' ', 'R', 40, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (10, 16, 'O_CI_CODE_ORG', '010', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (11, 16, 'R_CI_CODE_ORG', '011', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (12, 16, 'TRX_DATE_ORG', '012', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (13, 16, 'SERIAL_NO_ORG', '013', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (14, 16, 'TRX_TYPE_ORG', '014', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (15, 16, 'CURRENCY_ORG', '015', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (16, 16, 'AMOUNT_ORG', '016', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (17, 16, 'EX_E_SIGN', '017', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (18, 16, 'APPR_ID', '018', 0, 0, 'AN', ' ', 'R', 16, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (19, 16, 'CREATE_TIME', '019', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (20, 16, 'E_SIGN', '020', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (21, 16, 'MAC', '021', 0, 0, 'AN', null, 'R', 28, null, ' ');

insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (1, 17, 'TRX_TYPE', '001', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (2, 17, 'SD_TIME', '002', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (3, 17, 'SERIAL_NO', '003', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (4, 17, 'RESPONSE_CODE', '004', 0, 0, 'AN', ' ', 'R', 4, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (5, 17, 'O_CI_CODE', '005', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (6, 17, 'R_CI_CODE', '006', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (7, 17, 'TRX_DATE', '007', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (8, 17, 'LETTER_CONTENT', '008', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (9, 17, 'RELATION_NO_ORG', '009', 0, 0, 'AN', ' ', 'R', 40, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (10, 17, 'O_CI_CODE_ORG', '010', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (11, 17, 'R_CI_CODE_ORG', '011', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (12, 17, 'TRX_DATE_ORG', '012', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (13, 17, 'SERIAL_NO_ORG', '013', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (14, 17, 'TRX_TYPE_ORG', '014', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (15, 17, 'CURRENCY_ORG', '015', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (16, 17, 'AMOUNT_ORG', '016', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (17, 17, 'EX_E_SIGN', '017', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (18, 17, 'APPR_ID', '018', 0, 0, 'AN', ' ', 'R', 16, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (19, 17, 'CREATE_TIME', '019', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (20, 17, 'E_SIGN', '020', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (21, 17, 'MAC', '021', 0, 0, 'AN', null, 'R', 28, null, ' ');

insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (1, 18, 'TRX_TYPE', '001', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (2, 18, 'SD_TIME', '002', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (3, 18, 'SERIAL_NO', '003', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (4, 18, 'RESPONSE_CODE', '004', 0, 0, 'AN', ' ', 'R', 4, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (5, 18, 'O_CI_CODE', '005', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (6, 18, 'R_CI_CODE', '006', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (7, 18, 'TRX_DATE', '007', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (8, 18, 'LETTER_CONTENT', '008', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (9, 18, 'REPLY_CONTENT', '009', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (10, 18, 'RELATION_NO_ORG', '010', 0, 0, 'AN', ' ', 'R', 40, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (11, 18, 'O_CI_CODE_ORG', '011', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (12, 18, 'R_CI_CODE_ORG', '012', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (13, 18, 'TRX_DATE_ORG', '013', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (14, 18, 'SERIAL_NO_ORG', '014', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (15, 18, 'CURRENCY_ORG', '015', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (16, 18, 'AMOUNT_ORG', '016', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (17, 18, 'O_CI_CODE_LET', '017', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (18, 18, 'R_CI_CODE_LET', '018', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (19, 18, 'TRX_DATE_LET', '019', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (20, 18, 'SERIAL_NO_LET', '020', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (21, 18, 'TRX_TYPE_LET', '021', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (22, 18, 'EX_E_SIGN', '022', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (23, 18, 'APPR_ID', '023', 0, 0, 'AN', ' ', 'R', 16, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (24, 18, 'CREATE_TIME', '024', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (25, 18, 'E_SIGN', '025', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (26, 18, 'MAC', '026', 0, 0, 'AN', null, 'R', 28, null, ' ');

insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (1, 19, 'TRX_TYPE', '001', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (2, 19, 'SD_TIME', '002', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (3, 19, 'SERIAL_NO', '003', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (4, 19, 'RESPONSE_CODE', '004', 0, 0, 'AN', ' ', 'R', 4, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (5, 19, 'O_CI_CODE', '005', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (6, 19, 'R_CI_CODE', '006', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (7, 19, 'TRX_DATE', '007', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (8, 19, 'LETTER_CONTENT', '008', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (9, 19, 'REPLY_CONTENT', '009', 0, 0, 'AN', ' ', 'R', 210, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (10, 19, 'RELATION_NO_ORG', '010', 0, 0, 'AN', ' ', 'R', 40, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (11, 19, 'O_CI_CODE_ORG', '011', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (12, 19, 'R_CI_CODE_ORG', '012', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (13, 19, 'TRX_DATE_ORG', '013', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (14, 19, 'SERIAL_NO_ORG', '014', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (15, 19, 'CURRENCY_ORG', '015', 0, 0, 'AN', ' ', 'R', 3, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (16, 19, 'AMOUNT_ORG', '016', 0, 0, 'N', '0', 'L', 22, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (17, 19, 'O_CI_CODE_LET', '017', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (18, 19, 'R_CI_CODE_LET', '018', 0, 0, 'AN', ' ', 'R', 12, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (19, 19, 'TRX_DATE_LET', '019', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (20, 19, 'SERIAL_NO_LET', '020', 0, 0, 'AN', ' ', 'R', 8, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (21, 19, 'TRX_TYPE_LET', '021', 0, 0, 'AN', ' ', 'R', 6, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (22, 19, 'EX_E_SIGN', '022', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (23, 19, 'APPR_ID', '023', 0, 0, 'AN', ' ', 'R', 16, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (24, 19, 'CREATE_TIME', '024', 0, 0, 'AN', ' ', 'R', 14, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (25, 19, 'E_SIGN', '025', 0, 0, 'AN', ' ', 'R', 400, null, ' ');
insert into TBLFILES_DEFINE_DETAIL (FIELDID, FILEID, FIELDNAME, FIELDCODE, VALUEPOS, VALUELENGTH, DATATYPE, PADSTRING, PADSIDE, FIELDLENGTH, DEFAULTVALUE, CHECKNULL)values (26, 19, 'MAC', '026', 0, 0, 'AN', null, 'R', 28, null, ' ');

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBLLETTERFORMAT_GTW]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[TBLLETTERFORMAT_GTW];
create table TBLLETTERFORMAT_GTW( FIELD_NO bigint,FIELD_HEADING NVARCHAR(150), FIELD_HEADINGVN NVARCHAR(150), FIELD_TYPE NVARCHAR(5), FIELD_SIZE bigint, FIELD_CODE  NVARCHAR(50) not null, TBLFILES bigint, TBLLETTER_MSG bigint, TBLLETTERMSG_GTW bigint, REQUIRED CHAR(1) not null);

insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (1, null, N'Số tiền chuyển', 'N', 20, 'AMOUNT_ORG', 17, 0, 17, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (2, null, N'Khóa tin điện', 'N', 8, 'MSG_KEY', 0, 1, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (3, null, N'Mã Người ký duyệt giao dịch', 'AN', 16, 'APPR_ID', 19, 24, 20, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (4, null, N'Thời gian người phê duyệt tiến hành phê duyệt giao', 'AN', 14, 'APPR_TIME', 21, 27, 24, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (5, null, N'ID Ngân hàng gửi lệnh', 'N', 8, 'O_CI_ID', 0, 3, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (6, null, N'Thời điểm gửi tin điện', 'AN', 14, 'SD_TIME', 3, 7, 4, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (6, null, N'ID Ngân hàng nhận lệnh', 'N', 8, 'R_CI_ID', 0, 4, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (7, N'Mã trạng thái kiểm tra giao dịch', N'Mã trạng thái kiểm tra giao dịch', 'AN', 2, 'CHECK_CODE', 0, 0, 1, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (8, null, N'Ngày giao dịch', 'AN', 8, 'TRX_DATE', 8, 0, 9, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (9, null, N'Ngày làm việc của hệ thống', 'AN', 8, 'TRX_DATE', 8, 10, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (10, null, N'Tên file đi / đến', 'AN', 100, 'FILE_NAME', 0, 0, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (11, null, N'Tên file', 'AN', 25, 'FILE_NAME', 0, 0, 3, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (12, null, N'Cờ chuyển sang Core Banking', 'N', 1, 'GTW_FLAG', 0, 31, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (13, null, N'Nội dung lệnh tra soát', 'AN', 210, 'LETTER_CONTENT', 9, 12, 10, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (14, null, N'Tên file', 'AN', 25, 'FILE_NAME', 0, 0, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (15, null, N'Thời điểm tạo giao dịch', 'AN', 14, 'CREATE_TIME', 20, 26, 21, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (16, null, N'Mã Loại tiền', 'AN', 3, 'CURRENCY_ORG', 16, 0, 16, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (17, null, N'Loại tin điện', 'AN', 4, 'MSG_TYPE', 0, 2, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (18, null, N'Loại cập nhật', 'AN', 1, 'INPUT_TYPE', 0, 30, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (19, null, N'Chữ ký của hệ thống ngoài', 'AN', 200, 'EX_E_SIGN', 18, 0, 18, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (20, null, N'Mã trạng thái lỗi', 'N', 4, 'ERR_STATUS', 0, 6, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (21, null, N'Định danh ngân hành gửi lệnh', 'AN', 12, 'O_CI_CODE', 6, 0, 7, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (22, null, N'Trạng thái xử lý', 'AN', 15, 'TRX_STATUS', 0, 13, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (23, N'Tình trạng tạo file, kết quả file đến', N'Tình trạng tạo file, kết quả file đến', 'AN', 1, 'CREATE_FILE_RESULT_FLAG', 0, 0, 2, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (24, null, N'Định danh ngân hàng nhận lệnh', 'AN', 12, 'R_CI_CODE', 7, 0, 8, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (25, null, N'Số bút toán', 'AN', 10, 'RELATION_NO_ORG', 10, 0, 11, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (26, null, N'Chữ ký', 'AN', 200, 'E_SIGN', 0, 11, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (27, null, N'Mã trả lời xử lý', 'N', 4, 'RESPONSE_CODE', 5, 8, 5, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (28, null, N'Số hiệu giao dịch', 'N', 8, 'SERIAL_NO', 4, 9, 6, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (29, null, N'Tiến trình', 'AN', 2, 'PROCESS', 0, 15, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (30, null, 'MAC', 'AN', 28, 'MAC', 0, 14, 19, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (31, null, N'Loại giao dịch', 'AN', 6, 'TRX_TYPE', 2, 5, 27, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (32, null, N'ID của người tạo lệnh chuyển tiền', 'AN', 16, 'ORIG_ID', 0, 23, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (33, 'Content From File', N'Nội dung lệnh chuyển tiền từ file', 'AN', 4000, 'CONTENTFROMFILE', 0, 0, 22, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (34, null, N'File giao dich', 'AN', 25, 'TRX_FILE_NAME', 0, 16, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (35, null, N'ID Ngân hàng gửi lệnh gốc', 'N', 8, 'O_CI_ID_ORG', 0, 20, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (36, null, N'Loại giao dịch của lệnh chuyển tiền gốc', 'AN', 6, 'TRX_TYPE_ORG', 15, 17, 23, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (37, null, N'Số hiệu giao dịch của lệnh gốc', 'N', 8, 'SERIAL_NO_ORG', 14, 19, 15, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (38, null, N'Ngày giao dịch của lệnh gốc', 'AN', 8, 'TRX_DATE_ORG', 13, 18, 14, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (39, null, N'Lý do thoái lệnh', 'AN', 210, 'MSG_REASON', 0, 25, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (40, null, N'ID ngân hàng gửi lệnh gián tiếp', 'N', 12, 'O_INDIRECT_ORG', 0, 0, 25, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (41, null, N'ID Ngân hàng nhận lệnh gián tiếp', 'N', 12, 'R_INDIRECT_ORG', 0, 0, 26, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (42, null, N'Định danh Ngân hàng gửi lệnh gián tiếp', 'AN', 22, 'O_INDIRECT_ORG', 0, 21, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (43, null, N'Định danh Ngân hàng nhận lệnh gián tiếp', 'AN', 22, 'R_INDIRECT_ORG', 0, 22, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (44, null, N'Định danh ngân hành gửi lệnh gốc', 'AN', 12, 'O_CI_CODE_ORG', 11, 0, 12, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (45, null, N'Định danh ngân hàng nhận lệnh gốc', 'AN', 12, 'R_CI_CODE_ORG', 12, 0, 13, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (46, null, N'Mã Người ký duyệt giao dịch', 'AN', 16, 'APPR_IN_ID', 0, 29, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (47, null, N'Thời gian người phê duyệt tiến hành phê duyệt giao', 'AN', 14, 'APPR_IN_TIME', 0, 28, 0, '0');
insert into TBLLETTERFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSG, TBLLETTERMSG_GTW, REQUIRED)values (48, null, N'Loại bản ghi', 'AN', 2, 'REC_TYPE', 1, 0, 0, '0');

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBLREPLYFORMAT_GTW]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[TBLREPLYFORMAT_GTW];
create table TBLREPLYFORMAT_GTW(FIELD_NO bigint,  FIELD_HEADING NVARCHAR(150),  FIELD_HEADINGVN NVARCHAR(150),  FIELD_TYPE NVARCHAR(5),  FIELD_SIZE bigint,  FIELD_CODE NVARCHAR(50) not null,  TBLFILES bigint,  TBLLETTER_MSGX bigint,  TBLLETTERMSGX_GTW bigint,  REQUIRED CHAR(1) not null)

insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (1, null, N'Số tiền chuyển', 'N', 20, 'AMOUNT_ORG', 17, 0, 18, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (2, null, N'Khóa tin điện', 'N', 8, 'MSG_KEY', 0, 1, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (3, null, N'Mã Người ký duyệt giao dịch', 'AN', 16, 'APPR_ID', 24, 17, 25, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (4, null, N'Thời gian người phê duyệt tiến hành phê duyệt giao', 'AN', 14, 'APPR_TIME', 26, 20, 30, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (5, null, N'ID Ngân hàng gửi lệnh', 'N', 8, 'O_CI_ID', 0, 25, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (6, null, N'Thời điểm gửi tin điện', 'AN', 14, 'SD_TIME', 3, 5, 4, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (6, null, N'ID Ngân hàng nhận lệnh', 'N', 8, 'R_CI_ID', 0, 26, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (7, N'Mã trạng thái kiểm tra giao dịch', N'Mã trạng thái kiểm tra giao dịch', 'AN', 2, 'CHECK_CODE', 0, 0, 1, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (8, null, N'Ngày giao dịch', 'AN', 8, 'TRX_DATE', 0, 0, 9, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (9, null, N'Ngày làm việc của hệ thống', 'AN', 8, 'TRX_DATE', 8, 8, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (10, null, N'Tên file đi / đến', 'AN', 100, 'FILE_NAME', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (11, null, N'Tên file', 'AN', 25, 'FILE_NAME', 0, 0, 3, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (12, null, N'Cờ chuyển sang Core Banking', 'N', 1, 'GTW_FLAG', 0, 30, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (13, null, N'Nội dung lệnh tra soát', 'AN', 210, 'LETTER_CONTENT', 9, 14, 10, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (14, null, N'Tên file', 'AN', 25, 'FILE_NAME', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (15, null, N'Thời điểm tạo giao dịch', 'AN', 14, 'CREATE_TIME', 25, 19, 26, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (16, null, N'Mã Loại tiền', 'AN', 3, 'CURRENCY_ORG', 16, 0, 17, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (17, null, N'Loại tin điện', 'AN', 4, 'MSG_TYPE', 0, 2, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (18, null, N'Loại cập nhật', 'AN', 1, 'INPUT_TYPE', 0, 29, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (19, null, N'Chữ ký của hệ thống ngoài', 'AN', 200, 'EX_E_SIGN', 23, 0, 23, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (20, null, N'Mã trạng thái lỗi', 'N', 4, 'ERR_STATUS', 0, 4, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (21, null, N'Định danh ngân hành gửi lệnh', 'AN', 12, 'O_CI_CODE', 6, 0, 7, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (22, null, N'Trạng thái xử lý', 'AN', 15, 'TRX_STATUS', 0, 11, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (23, N'Tình trạng tạo file, kết quả file đến', N'Tình trạng tạo file, kết quả file đến', 'AN', 1, 'CREATE_FILE_RESULT_FLAG', 0, 0, 2, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (24, null, N'Định danh ngân hàng nhận lệnh', 'AN', 12, 'R_CI_CODE', 7, 0, 8, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (25, null, N'Số bút toán', 'AN', 10, 'RELATION_NO_ORG', 11, 0, 12, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (26, null, N'Chữ ký', 'AN', 200, 'E_SIGN', 0, 9, 27, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (27, null, N'Mã trả lời xử lý', 'N', 4, 'RESPONSE_CODE', 5, 6, 5, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (28, null, N'Số hiệu giao dịch', 'N', 8, 'SERIAL_NO', 4, 7, 6, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (29, null, N'Tiến trình', 'AN', 2, 'PROCESS', 0, 13, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (30, null, 'MAC', 'AN', 28, 'MAC', 0, 12, 24, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (31, null, N'Loại giao dịch', 'AN', 6, 'TRX_TYPE', 2, 3, 31, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (32, null, N'ID của người tạo lệnh chuyển tiền', 'AN', 16, 'ORIG_ID', 0, 16, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (33, 'Content From File', N'Nội dung lệnh chuyển tiền từ file', 'AN', 4000, 'CONTENTFROMFILE', 0, 0, 28, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (34, null, N'File giao dich', 'AN', 25, 'TRX_FILE_NAME', 0, 15, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (35, null, N'ID Ngân hàng gửi lệnh gốc', 'N', 8, 'O_CI_ID_ORG', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (36, null, N'Loại giao dịch của lệnh chuyển tiền gốc', 'AN', 6, 'TRX_TYPE_ORG', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (37, null, N'Số hiệu giao dịch của lệnh gốc', 'N', 8, 'SERIAL_NO_ORG', 15, 0, 16, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (38, null, N'Ngày giao dịch của lệnh gốc', 'AN', 8, 'TRX_DATE_ORG', 14, 0, 15, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (39, null, N'Lý do thoái lệnh', 'AN', 210, 'MSG_REASON', 0, 18, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (40, null, N'ID ngân hàng gửi lệnh gián tiếp', 'N', 8, 'O_INDIRECT_ORG', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (41, null, N'ID Ngân hàng nhận lệnh gián tiếp', 'N', 8, 'R_INDIRECT_ORG', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (42, null, N'Định danh Ngân hàng gửi lệnh gián tiếp', 'AN', 22, 'O_INDIRECT_ORG', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (43, null, N'Định danh Ngân hàng nhận lệnh gián tiếp', 'AN', 22, 'R_INDIRECT_ORG', 0, 22, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (44, null, N'Định danh ngân hành gửi lệnh gốc', 'AN', 12, 'O_CI_CODE_ORG', 12, 0, 13, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (45, null, N'Định danh ngân hàng nhận lệnh gốc', 'AN', 12, 'R_CI_CODE_ORG', 13, 0, 14, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (46, null, N'Mã Người ký duyệt giao dịch', 'AN', 16, 'APPR_IN_ID', 0, 28, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (47, null, N'Thời gian người phê duyệt tiến hành phê duyệt giao', 'AN', 14, 'APPR_IN_TIME', 0, 27, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (48, null, N'ID Ngân hàng gửi lệnh gốc', 'N', 8, 'LET_O_CI_ID', 0, 0, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (49, null, N'Loại giao dịch của lệnh chuyển tiền gốc', 'AN', 6, 'LET_TRX_TYPE', 0, 24, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (50, null, N'Số hiệu giao dịch của lệnh gốc', 'N', 8, 'LET_SERIAL_NO', 0, 21, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (51, null, N'Ngày giao dịch của lệnh gốc', 'AN', 8, 'LET_TRX_DATE', 0, 23, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (52, null, N'ID Ngân hàng gửi lệnh gốc', 'N', 8, 'O_CI_CODE_LET', 18, 0, 19, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (53, null, N'Loại giao dịch của lệnh chuyển tiền gốc', 'AN', 6, 'TRX_TYPE_LET', 22, 0, 29, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (54, null, N'Số hiệu giao dịch của lệnh gốc', 'N', 8, 'SERIAL_NO_LET', 21, 0, 22, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (55, null, N'Ngày giao dịch của lệnh gốc', 'AN', 8, 'TRX_DATE_LET', 20, 0, 21, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (56, null, null, 'AN', 14, 'RCI_TIME', 0, 10, 0, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (57, null, N'Nội dung lệnh tra loi', 'AN', 210, 'REPLY_CONTENT', 10, 0, 11, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (58, null, N'ID Ngân hàng nhan lệnh gốc', 'N', 8, 'R_CI_CODE_LET', 19, 0, 20, '0');
insert into TBLREPLYFORMAT_GTW (FIELD_NO, FIELD_HEADING, FIELD_HEADINGVN, FIELD_TYPE, FIELD_SIZE, FIELD_CODE, TBLFILES, TBLLETTER_MSGX, TBLLETTERMSGX_GTW, REQUIRED)values (59, null, N'Loại bản ghi', 'AN', 2, 'REC_TYPE', 1, 0, 0, '0');

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBLGENKEY_LETTER]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[TBLGENKEY_LETTER];
CREATE TABLE [TBLGENKEY_LETTER] ([SERV_CODE] [nvarchar] (2) NOT NULL ,[CURRENTKEY] [bigint] NOT NULL ,[CURRENYEAR] [nvarchar] (2) NOT NULL ) ON [PRIMARY];
ALTER TABLE [TBLGENKEY_LETTER] ADD CONSTRAINT [PK_TBLGENKEY_LETTER] PRIMARY KEY CLUSTERED([SERV_CODE],[CURRENTKEY],[CURRENYEAR]) ON [PRIMARY] ;

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TBLGEN_LETTER]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[TBLGEN_LETTER];
CREATE TABLE [dbo].[TBLGEN_LETTER] ([TRX_DATE] [nvarchar] (8) NOT NULL ,[TRX_SERIAL] [bigint] NOT NULL ,[RELATION_B] [bigint] NOT NULL) ON [PRIMARY];
ALTER TABLE [dbo].[TBLGEN_LETTER] ADD CONSTRAINT [PK_TBLGEN_LETTER] PRIMARY KEY  CLUSTERED ([TRX_DATE],[TRX_SERIAL],[RELATION_B])  ON [PRIMARY] ;


