Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to create a 6 byte alphanumeric sequence?

Re: How to create a 6 byte alphanumeric sequence?

From: raoul <raoul_aranha_at_hotmail.com>
Date: 26 Oct 2002 06:47:13 -0700
Message-ID: <96973576.0210260547.6b8c0383@posting.google.com>


Thanks a million Martin...I can certainly use this code. I just have to figure out how to limit the generated sequence to a 6 byte sequence. And yes the string was as you wrote: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ. I will post the final product...

Raoul.

Martin Doherty <martin.doherty_at_oracle.nospam.com> wrote in message news:<i2mu9.14$Im4.287_at_news.oracle.com>...
> http://www.marston-home.demon.co.uk/Tony/tip32.html
> has a conversion algorithm for all bases up to 36, written in a 3GL
> language called Uniface.
>
> Courtesy of Google. Approximate search time = 30 seconds.
>
> Martin Doherty wrote:
>
> > Sorry I meant base 36. You did not specify your character sequence
> > either ... is it 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ?
> >
> > 36^6 = 2176782336 so a sequence object would need to be defined to go
> > at least this high.
> >
> > I'd google around to look for a decimal/hexadecimal converter, and
> > adapt that code to your alphabexadecimal system.
> >
> > I love how google has become a verb.
> >
> > Martin
> >
> > Martin Doherty wrote:
> >
> >> Can this key sequence tolerate gaps? If so, a solution might be built
> >> by applying a function to <sequence_name>.nextval to convert a base
> >> 10 number into a base 26 number. If not, then you will need to make
> >> the sequence transactional e.g. next_available_key is stored in a row
> >> of a table, and becomes a source of contention (it will serialize
> >> your transactions).
> >>
> >> For performance, I would go with the first approach if possible.
> >>
> >> Martin
> >>
> >> raoul wrote:
> >>
> >>> I am looking for a code snippet or any suggestions on creating a 6
> >>> byte alphanumeric sequence in PL/SQL or SQL*Plus. Example: 123DE5 I
> >>> will be using this program to generate and populate a table with these
> >>> 6 byte alphanumeric sequences to be used by my applications. So the
> >>> sequence must increment by one.
> >>>
> >>> Any help will be greatly appreciated.
> >>>
> >>> Thanks,
> >>> R.
> >>>
> >>>
> >>
> >
Received on Sat Oct 26 2002 - 08:47:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US