Names of workplaces and operations
From PlcWiki
Petr.zalabak (Talk | contribs) (Created page with 'The names of workplaces and operations are stored in SL tables '''workplace''' and '''operation'''. If workplaces and/or operations are being changed during time, it is possible …') |
Petr.zalabak (Talk | contribs) m |
||
Line 17: | Line 17: | ||
'''2. Create a new record with a new name''' | '''2. Create a new record with a new name''' | ||
- | insert into operation (place, project, id, name, orderid, validFrom, validTo) values ('vit', '', 'RO2', 'New name', 287, '2014-02-12 10:00' null); | + | <text>insert into operation (place, project, id, name, orderid, validFrom, validTo) values ('vit', '', 'RO2', 'New name', 287, '2014-02-12 10:00' null);</text> |
Of course, you can use an alternatives in your gui frontend. | Of course, you can use an alternatives in your gui frontend. | ||
You shouldn’t delete or change the current (or old) records, if they are (were) correct, because in case when old cockpits are searched and displayed, they should show the names of workplaces and operations valid in their time od an assembly. | You shouldn’t delete or change the current (or old) records, if they are (were) correct, because in case when old cockpits are searched and displayed, they should show the names of workplaces and operations valid in their time od an assembly. |
Revision as of 09:19, 12 February 2014
The names of workplaces and operations are stored in SL tables workplace and operation. If workplaces and/or operations are being changed during time, it is possible to define thair validity using fields validFrom and validTo.
Below there is an example whne you need to rename an operation. It is necessary to do it in a following way:
1. Change the validity of the current record
For example you have the following record:
mysql> select * from operation where id = 'RO2' order by validFrom; +-------+---------+------+------------------+---------+---------------------+---------+ | place | project | id | name | orderid | validFrom | validTo | +-------+---------+------+------------------+---------+---------------------+---------+ | vit | | RO2 | APRIETES ESPIRAL | 287 | 1990-01-01 00:00:00 | NULL | +-------+---------+------+------------------+---------+---------------------+---------+
So change its validity (validTo):
update operation set validTo = '2014-02-12 10:00' where id = 'RO2' and validTo is null;
2. Create a new record with a new name
insert into operation (place, project, id, name, orderid, validFrom, validTo) values ('vit', '', 'RO2', 'New name', 287, '2014-02-12 10:00' null);
Of course, you can use an alternatives in your gui frontend.
You shouldn’t delete or change the current (or old) records, if they are (were) correct, because in case when old cockpits are searched and displayed, they should show the names of workplaces and operations valid in their time od an assembly.