Home : Migrating existing variable configurations
Q13459 - HOWTO: Migrating existing variable configurations

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%'

 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 6/14/2011 3:55 PM.
Last Modified on 1/18/2012 1:03 PM.
Last Modified by No Author Name Available!.
Article has been viewed 2405 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article