Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2007
    Posts
    17

    Unanswered: Alphanumeric Sequence

    Hi,
    How can I prefix a string to a sequence? If not, what is the alternative? My requirement is to generate a sequence of alphanumeric IDs.
    Eg: The id could be CCR1111, CCR1112 etc. The string 'CCR' is constant

    Thanks.

    -Sajita...

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Simply concatenate those two values:
    Code:
    SQL> create sequence seq_1 start with 1111;
    
    Sequence created.
    
    SQL> select 'CCR' || to_char(seq_1.nextval) my_seq_no
      2  from dual;
    
    MY_SEQ_NO
    -------------------------------------------
    CCR1111
    
    SQL>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •