Re: [SQL] Invoice number

2000-12-24 Thread D'Arcy J.M. Cain
Thus spake Oliver Elphick > >If so, why is no rollbackable an issue? All you should need is unique > >numbers. Not necessarily exactly sequential numbers. > > For invoice numbers, it matters. > > Numbers missing from such a sequence are likely to provoke questions from > auditors and taxme

Re: [SQL] Invoice number

2000-12-23 Thread Stephan Szabo
> I'm wondering how people creates guaranteed sequential numbers - in my case > for invoice numbers. > > - Sequences are not rollback'able. > - It seems overkill to have a table just for this. > - What else? You'll probably need a table (although you may be able to get away with only one for a

Re: [SQL] Invoice number

2000-12-21 Thread George Moga
Mike Castle wrote: > What do you do on the following scenario: > > Client 1 is placing an order, gets invoice #1. > Client 2 is simultaneously placing an order, and gets invoice #2. > > Client 1 changes mind and cancels order. Invoice #1 is not used. Invoice > #2 is. > > Client 3 comes along.

Re: [SQL] Invoice number

2000-12-21 Thread John Hasler
Mike Castle writes: > Client 3 comes along. Do they use invoice #1, out of order, or invoice > #3? It shouldn't matter, as long as every number is accounted for. Seems to me that a trigger could make a log entry every time the serial is incremented. Workable? > What happens in a paper world i

Re: [SQL] Invoice number

2000-12-21 Thread Kaare Rasmussen
> What do you do on the following scenario: I don't enter ! > Client 1 is placing an order, gets invoice #1. Wrong! He gets an order number > Client 1 changes mind and cancels order. Invoice #1 is not used. Invoice > #2 is. > Client 3 comes along. Do they use invoice #1, out of order, or in

Re: [SQL] Invoice number

2000-12-21 Thread Mike Castle
On Thu, Dec 21, 2000 at 05:50:43PM +, Oliver Elphick wrote: > Mike Castle wrote: > >On Thu, Dec 21, 2000 at 11:10:00AM +0100, Kaare Rasmussen wrote: > >> - Sequences are not rollback'able. > > > >Did you mean SERIAL instead of sequence here? > > > >If so, why is no rollbackable an

Re: [SQL] Invoice number

2000-12-21 Thread Oliver Elphick
Mike Castle wrote: >On Thu, Dec 21, 2000 at 11:10:00AM +0100, Kaare Rasmussen wrote: >> - Sequences are not rollback'able. > >Did you mean SERIAL instead of sequence here? > >If so, why is no rollbackable an issue? All you should need is unique >numbers. Not necessarily exactly seq

Re: [SQL] Invoice number

2000-12-21 Thread John Hasler
Mike Castle writes: > If so, why is no rollbackable an issue? All you should need is unique > numbers. Not necessarily exactly sequential numbers. Sometimes business rules require that every member of a sequence of such things as invoice numbers be accounted for. Speculation: Would it be possi

Re: [SQL] Invoice number

2000-12-21 Thread Josh Berkus
Kaare, > How many times have I tried this > mailing list with no > success :-( Hey! It's a peer-to-peer mailing list. You want guarenteed answers, pay for support (I do) > I'm wondering how people creates guaranteed sequential > numbers - in my case > for invoice numbers. > > - Sequences

Re: [SQL] Invoice number

2000-12-21 Thread Mike Castle
On Thu, Dec 21, 2000 at 11:10:00AM +0100, Kaare Rasmussen wrote: > - Sequences are not rollback'able. Did you mean SERIAL instead of sequence here? If so, why is no rollbackable an issue? All you should need is unique numbers. Not necessarily exactly sequential numbers. mrc -- Mike Ca

Re: [SQL] Invoice number

2000-12-21 Thread Volker Paul
Hi, > I'm wondering how people creates guaranteed sequential numbers - in my case > for invoice numbers. See the PostgreSQL book p. 85 and 250, and the online doc about serials: CREATE TABLE person ( id SERIAL, name TEXT ); Volker Paul

[SQL] Invoice number

2000-12-21 Thread Kaare Rasmussen
Hi My, my. It works. How many times have I tried this mailing list with no success :-( I'm wondering how people creates guaranteed sequential numbers - in my case for invoice numbers. - Sequences are not rollback'able. - It seems overkill to have a table just for this. - What else? tia