How can I create a Historic field that automatically increments its value, so that when there is a new record, it receives a sequential value?
Solution:
It is not possible to create this type of field in E3 Historics. However, you can create this field directly in the Database.
When using Access, you can add a field to the current table, as in the example below:
When using SQL Server, you can choose between two possibilities.
Via SQL Manager, create a field, access its properties, and set them up as Identity Column.
The other possibility, which also happens via SQL Manager, is to create the whole table via a Query, as seen in the example below:
ORACLE:
When using Oracle, you must create a trigger that increments the desired column at every new record.
In the example below, a new column called Column_ID is inserted into TestTable, and then the trigger is created:
ALTER TABLE
TESTTABLE
ADD
Column_ID number primary key;
create sequence seq_autonumber;
create trigger trg_autonumber
before insert on TESTTABLE
for each row
begin
select seq_autonumber.nextval into :new.Column_ID from dual;
end;