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

Home -> Community -> Usenet -> c.d.o.server -> Re: Should/Can I use Sequence for this ?

Re: Should/Can I use Sequence for this ?

From: xtanto <krislioe_at_gmail.com>
Date: 27 Sep 2004 06:40:49 -0700
Message-ID: <e1c9bd55.0409270540.104601d3@posting.google.com>


Hi,
Each department has its own counter.
e.g :
0100001
0100002
0200001
0200002
How can I do it with sequence.

Thank you,
xtanto

Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1096226709.145021_at_yasure>...
> xtanto wrote:
>
> > Hi Gurus,
> >
> > I have to maintain computer generated document numbering where the
> > number format is :
> >
> > xx123456789
> >
> > xx : is the department code
> > 123456789 : document number counter per department
> >
> > How can I maintain this number ?
> > Can I use sequence for this ? or should I manually maintain(increment)
> > it in a document highest number table per dept code ?
> >
> > Thank you for your help,
> > xtanto
>
> As Jim says a sequence is perfect for it ... but with one caveat. Your
> design violates the most basic rules of data normalization. The 'xx'
> department code belongs in a column of its own.
>
> In addition to just adhering to the normalization rule you will find
> that every query you do doesn't include SUBSTR(doc_id, 1, 2) which
> will improve performance and scalability.
Received on Mon Sep 27 2004 - 08:40:49 CDT

Original text of this message

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