Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_oracle.sql =================================================================== diff -u -r34215 -r34236 --- ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_oracle.sql (.../4.9.93_4.9.94_oracle.sql) (revision 34215) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_oracle.sql (.../4.9.93_4.9.94_oracle.sql) (revision 34236) @@ -1,4 +1,4 @@ -insert into TousseDefinitionNote (id, note, tousseDefinitionId) select HIBERNATE_SEQUENCE.Nextval, note, id from TousseDefinition where forDisplay = 1 and note is not null; -update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id); +insert into TousseDefinitionNote (id, note, tousseDefinitionId) select HIBERNATE_SEQUENCE.Nextval, note, id from TousseDefinition where forDisplay = 1 and note is not null and id not in (select tousseDefinitionId from TousseDefinitionNote); +update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id) and note_id is null; update UseRecord set departCodeOfpatient = (select orgUnitCoding from OrgUnit where name = UseRecord.ascriptionDepartment and rownum =1) where departCodeOfpatient is null and ascriptionDepartment is not null; update UseRecord set departCodeOfpatient = (select orgUnitCoding from OrgUnit where orgUnitCoding = UseRecord.ascriptionDepartment and rownum =1) where departCodeOfpatient is null and ascriptionDepartment is not null; \ No newline at end of file Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_sqlserver.sql =================================================================== diff -u -r34215 -r34236 --- ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_sqlserver.sql (.../4.9.93_4.9.94_sqlserver.sql) (revision 34215) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.9.93_4.9.94_sqlserver.sql (.../4.9.93_4.9.94_sqlserver.sql) (revision 34236) @@ -1,4 +1,4 @@ -insert into TousseDefinitionNote (note, tousseDefinitionId) select note, id from TousseDefinition where forDisplay = 1 and len(note)>0; -update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id); +insert into TousseDefinitionNote (note, tousseDefinitionId) select note, id from TousseDefinition where forDisplay = 1 and len(note)>0 and id not in (select tousseDefinitionId from TousseDefinitionNote); +update TousseDefinition set note_id = (select id from TousseDefinitionNote where tousseDefinitionId = TousseDefinition.id) where note_id is null; update UseRecord set departCodeOfpatient = (select top 1 orgUnitCoding from OrgUnit where name = UseRecord.ascriptionDepartment) where (departCodeOfpatient is null or departCodeOfpatient = '') and ascriptionDepartment is not null and ascriptionDepartment <> ''; update UseRecord set departCodeOfpatient = (select top 1 orgUnitCoding from OrgUnit where orgUnitCoding = UseRecord.ascriptionDepartment) where (departCodeOfpatient is null or departCodeOfpatient = '') and ascriptionDepartment is not null and ascriptionDepartment <> ''; \ No newline at end of file