Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

left padding a sequence

Roger25Sep 24 2013 — edited Sep 24 2013

Hello,

I want to generate a string 'ABC', concatenated with a sequence my_seq

CREATE SEQUENCE CONTURI_EXTERNE_SEQ

  START WITH 1

  MINVALUE 1

  MAXVALUE 9999999999

  NOCYCLE

  CACHE 20

  NOORDER;

, and to pad the resulting string from left to right, until the length of the sequence.. e.g. the max. sequence length here is 9, so first I should generate ABC000000001, and after 99 numbers, ABC000000100.

Is it possible to do this in a single expression, and with sequences?

If I have had a simple number, that was simple, but using a sequence?

Oracle Database 11.2.0.2.

Thank you!

This post has been answered by kendenny on Sep 24 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2013
Added on Sep 24 2013
4 comments
1,009 views