Addicted
Addicted

Reputation: 1704

make a sequence in oracle database

How can I create a sequence, which has two parts one fixed characters part and another variable integer part like "LTR00001" and the next value in the sequence should be "LTR00002"

Upvotes: 0

Views: 228

Answers (1)

Thilo
Thilo

Reputation: 262474

You cannot. Sequences are just integers.

But you can select a formatted string from the sequence

SELECT 'LTR' || to_char('09999', the_sequence.nextval) FROM DUAL;

Upvotes: 3

Related Questions