New to Oracle programming. I have a table "Accidents" that has a primary key of AccidentID. AccidentsID is a char(6) and must start with 'A' followed by 5 numbers. I am trying to create a trigger and sequence to auto increment the AccidentsID field upon insert into that table. There are already existing rows in that table, so I want it to first find the max value and increment it by 1.
Do I add the logic to find the max value of AccidentID to my sequence or the trigger?
Can someone point me in the right direction?