Hi Steve,
could you please share the SQL code you used to use in the past.
Thank you,
Peter
Hi Peter
The next number for a handling unit comes from the HANDLING_UNIT_SEQ database sequence.
To change the next value in Oracle you would need to calculate how much you want to change the value by and then update the sequence accordingly using
alter sequence HANDLING_UNIT_SEQ increment by xx
You then need to cause the next value to be generated by using
select HANDLING_UNIT_SEQ .NEXTVAL from dual
You must then reset the increment back to 1
alter sequence HANDLING_UNIT_SEQ . increment by 1
I have never done this for IFS, this approach is purely the way to achieve a sequence reset in Oracle, but hopefully it may help you.
@sbarker @pr-upa the way IFS is handling these is by using Oracle DB sequences. Basically in the DB you have the HANDLING_UNIT_SEQ where you can check the current value or next value.
Please note that when you query nextval, it increases the seq.
So, if you have some custom logic built (maybe an event action with PL/SQL code) invoking the sequence could tell you what’s the next number.
select handling_unit_seq.currval from dual;
select handling_unit_seq.nextval from dual;
If you wanna change what the next number would be you could use an alter sequence statement, altough I would advise against going this route:
ALTER SEQUENCE sequence_name RESTART START WITH new_value;
Many thanks for your help guys!