Recent

Author Topic: Firebird - field uniqueness and continuity- HELP ME  (Read 14587 times)

abmservice

  • Jr. Member
  • **
  • Posts: 69
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #15 on: April 22, 2010, 10:31:59 am »
table has a primary key and the tables are related, this field is "licznik" is an additional number of the document

abmservice

  • Jr. Member
  • **
  • Posts: 69
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #16 on: April 22, 2010, 10:36:40 am »
I'll do a test - will use the test data generator and at the same time, I'll put your details - we'll see what the reaction will be.

I know that somehow it can do because there are many applications a client - server and documents are numbered

Zoran

  • Hero Member
  • *****
  • Posts: 1464
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #17 on: April 22, 2010, 11:01:50 am »
table has a primary key and the tables are related, this field is "licznik" is an additional number of the document

Yes, but you want it to be unique and without gaps, don't you? So it does not matter if it is PK or not.

Zoran

  • Hero Member
  • *****
  • Posts: 1464
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #18 on: April 22, 2010, 11:09:00 am »
I'll do a test - will use the test data generator and at the same time, I'll put your details - we'll see what the reaction will be.

I know that somehow it can do because there are many applications a client - server and documents are numbered

I beleive that most of those applications actually allow gaps in numbering, but they can do work for a long time without gaps to actually happen, esspecially if they don't serve many concurent connections working on same data.

JD

  • Hero Member
  • *****
  • Posts: 1758
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #19 on: April 22, 2010, 01:06:40 pm »
@Zelkjo
I'm still waiting to see your serialized transactions example. I've never tried it that way & I'm keen to see how it works.
Windows (10, 7) - Lazarus 2.0RC3/FPC 3.2, NewPascal, Delphi

Indy 10.6 series; mORMot; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

zeljko

  • Hero Member
  • *****
  • Posts: 1081
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #20 on: April 22, 2010, 06:34:13 pm »
@Zelkjo
I'm still waiting to see your serialized transactions example. I've never tried it that way & I'm keen to see how it works.

@JD http://www.postgresql.org/docs/8.2/interactive/transaction-iso.html

guidoaerts

  • New Member
  • *
  • Posts: 12
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #21 on: April 22, 2010, 08:32:39 pm »
taking a glance at this thread, I want to make this remark
you can use a trigger and generator to have a unique identifier for your record, but not at the same time for your document.
for your record, you will have to accept gaps.
for your document, define another generator specific to your document, and coherent with your new record; that will garantuee you consistent documentnumbers
grts,
guido

abmservice

  • Jr. Member
  • **
  • Posts: 69
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #22 on: April 23, 2010, 05:39:51 pm »
I went in the basket of solutions: (
I read the suggestion test.
Option 2 is a record in a transaction if it is approved by downloading the update number generator.

fred_55

  • Newbie
  • Posts: 1
Re: Firebird - field uniqueness and continuity- HELP ME
« Reply #23 on: April 26, 2010, 09:41:38 am »
You can read the article on the IBObjects - An Auditable Series of Numbers:

http://www.ibobjects.com/TechInfo.html#ti_AuditableSeries