RE: [firebird-support] Sequential auto incremental numbering

2018-09-03 Thread 'Christian Giesen' ch...@xt.co.za [firebird-support]
Good day Alan, Thanks for your response. As I mentioned the issue is not to generate unique ID values. This is taken care of by using generators (as you correctly mention) or, now with Firebird 3, I have implemented the IDENTITY method of generating unique ID values. The issue that I have

RE: [firebird-support] Re: Sequential auto incremental numbering

2018-09-03 Thread 'Christian Giesen' ch...@xt.co.za [firebird-support]
Good day Steve, Thanks for your response. As I mentioned the issue is not to generate unique ID values. This is taken care of by using generators (as you correctly mention) or, now with Firebird 3, I have implemented the IDENTITY method of generating unique ID values. The issue that I have

Re: [firebird-support] Re: Sequential auto incremental numbering

2018-09-03 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
I think the article Lester refers to may be the 'An auditable series of numbers' article which can be found on http://www.ibobjects.com/TechInfo.html. Den man. 3. sep. 2018 kl. 09:58 skrev Lester Caine les...@lsces.co.uk [firebird-support] : > On 03/09/18 07:29, 'Christian Giesen' ch...@xt.co.za

Re: [firebird-support] Re: Sequential auto incremental numbering

2018-09-03 Thread Lester Caine les...@lsces.co.uk [firebird-support]
On 03/09/18 10:36, Svein Erling Tysvær setys...@gmail.com [firebird-support] wrote: > I think the article Lester refers to may be the 'An auditable series of > numbers' article which can be found on > http://www.ibobjects.com/TechInfo.html. THAT is the one ... did not think t check IBObjects

Re: [firebird-support] Re: Sequential auto incremental numbering

2018-09-03 Thread Helen Borrie hele...@iinet.net.au [firebird-support]
Lester wrote: > On 03/09/18 07:29, 'Christian Giesen' ch...@xt.co.za [firebird-support] > wrote: >>   NextInvNo = (SELECT MAX(INVOICE_NO) FROM INVOICE) + 1; > Christian ... there was many years ago a very nice article on this very > problem. I think this is the article Lester was referring to:

RE: [firebird-support] Re: Sequential auto incremental numbering

2018-09-03 Thread 'Christian Giesen' ch...@xt.co.za [firebird-support]
Hi Helen, Thanks for the info and the sample Delphi source code. I will check it out in the next few days. Kind regards, Christian Giesen Managing Member Express Talent cc Mobile: +27 82 574 5566 E-Mail: ch...@xt.co.za Alt Email:

Re: [firebird-support] Sequential auto incremental numbering

2018-09-03 Thread 'River~~' river14ap...@gmail.com [firebird-support]
Two ideas that should work on any SQL database so long as you never delete invoices I amNot a guru for this dbms so if a more specific technique is posted it is likely to be faster Note however that while my method may be inefficient, it is more likely to be portable. You pays your money and you

Re: [firebird-support] Re: Sequential auto incremental numbering

2018-09-03 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
03.09.2018 8:29, 'Christian Giesen' ch...@xt.co.za [firebird-support] wrote: > 2.I have implemented an AFTER INSERT trigger on the INVOICE table as follows: You trigger can work in single user environment only. BTW, it is better to be BEFORE INSERT and avoid updating of just inserted record.

RE: [firebird-support] Sequential auto incremental numbering

2018-09-03 Thread 'Louis van Alphen' lo...@nucleo.co.za [firebird-support]
As previous responders have said, generator values are guaranteed to be unique. However when transactions fail, the generator will skip a value. Only relying on NewNo = select max(No) + 1 from Invoice is also a bad idea because in concurrent insert conditions you are for sure going to get

Re: [firebird-support] Sequential auto incremental numbering

2018-09-03 Thread Ann Harrison aharri...@ibphoenix.com [firebird-support]
> On Sep 3, 2018, at 6:00 AM, 'River~~' river14ap...@gmail.com > [firebird-support] wrote: > > Two ideas that should work on any SQL database so long as you never delete > invoices Remember that a transaction can roll back, so delete is not your only challenge. > > I amNot a guru for

[firebird-support] Re: Unable to connect to the employee database

2018-09-03 Thread karen_den...@ymail.com [firebird-support]
You probably saw, or will see, my response on another thread that for now I think I shall work with the LibreOffice embedded version of Firebird. I have to admit that much of what you wrote here is Greek to me. Yes, you are right, I had thought that working with databases through an office

Re: [firebird-support] Re: Sequential auto incremental numbering

2018-09-03 Thread Lester Caine les...@lsces.co.uk [firebird-support]
On 03/09/18 07:29, 'Christian Giesen' ch...@xt.co.za [firebird-support] wrote: >   NextInvNo = (SELECT MAX(INVOICE_NO) FROM INVOICE) + 1; Christian ... there was many years ago a very nice article on this very problem. The whole reason that will not work is when two or more people are adding

RE: [firebird-support] Sequential auto incremental numbering

2018-09-03 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi, "As far as I remember, aggregate functions also do not use indexes and will get progressively slower over time." for min/max index is used if you have ascending for MIN and descending for MAX. About topic itself. I always use numbering table and i raly on transaction conflicts.You know if