You can create a numeric sequence but convert the first two characters to a hex value on the fly. If you create your sequence as:
create sequence s42 start with 1000000000 maxvalue 1599999999;
... then have a function to simplify, though you don't strictly need it:
create function alpha_seq return varchar2 as
begin
return to_char(trunc(s42.nextval / 100000000), 'FMXX')
|| substr(to_char(s42.currval, 'FM0000000000'), 3);
end;
/
The sequence value is always 10 digits. The first two are pulled off and converted to their hex equivalent, and then the rest are appended.
As a demo:
select alpha_seq from dual
connect by level < 5;
ALPHA_SEQ
----------
A00000000
A00000001
A00000002
A00000003
-- skip a load of numbers
alter sequence s42 increment by 99999994;
select alpha_seq from dual;
ALPHA_SEQ
----------
A99999997
alter sequence s42 increment by 1;
select alpha_seq from dual
connect by level < 5;
ALPHA_SEQ
----------
A99999998
A99999999
B00000000
B00000001
-- skip a load of numbers
alter sequence s42 increment by 99999996;
select alpha_seq from dual;
ALPHA_SEQ
----------
B99999997
alter sequence s42 increment by 1;
select alpha_seq from dual
connect by level < 5;
ALPHA_SEQ
----------
B99999998
B99999999
C00000000
C00000001
The max value on the sequence means it will go up to F99999999, and then error if you call nextval again. I'm assuming the first digit is supposed to be hexadecimal; if you want A-Z then you can make the sequence start as 6500000000 and convert the first two digits to a character with chr()
instead as 65 is converted to A, etc.