The following query can be used to migrate the existing variable configurations to work with the new interface
update vardesc v2 set scadatag= ('LIMS:' || ud1 || ':' || (select "LOCATION" from location inner join vardesc v1 on location.locid = v1.locid where v1.varid = v2.varid))
where not (ud1 is null or ud2 is null or ud3 is null) and ud6 is null;
update vardesc set statistic = ud3
where not (ud1 is null or ud2 is null or ud3 is null) and ud6 is null;
update vardesc v2 set scadatag= ('PROC:' || ud1 || ':' || (select "LOCATION" from location inner join vardesc v1 on location.locid = v1.locid where v1.varid = v2.varid))
where not (ud1 is null or ud2 is null or ud3 is null) and ud6 = 'P';
update vardesc set statistic = ud3
where not (ud1 is null or ud2 is null or ud3 is null) and ud6 = 'P';
update vardesc set scadatag = 'TRUCKIN:' || ud3 where ud6 = 'TRUCKIN';
update vardesc set statistic = ud7 where ud6 = 'TRUCKIN';
update vardesc set scadatag = 'MANUAL:' || ud3 || ':' || ud4 where ud6 = 'MANUAL';
update vardesc set statistic = ud7 where ud6 = 'MANUAL';
update vardesc set g2_enabled = -1, g2_interface_id = (select interface_id from OPSROOT.g2_server where "NAME" = 'StarLims')
where substr(scadatag,1,4) = 'LIMS' or substr(scadatag,1,4) = 'PROC'
or substr(scadatag,1,6) = 'MANUAL'
or substr(scadatag,1,7) = 'TRUCKIN';
commit;
Note that the highlighted field might need to be changed if the interface name is different.
To migrate TRUCKIN variables to v1.1.2:
update vardesc set scadatag = (scadatag || ':' || UD4 || ':' || UD5) where scadatag like 'TRUCKIN%'