Subject RE: [firebird-support] Auditable Invoice Number
Author Nigel Weeks
Have an invoice table like so:

CREATE TABLE tbl_invoice (
int_invoiceid NUMERIC(18,0) NOT NULL, /* The hidden identifier - not null
*/
int_invoicenumber NUMERIC(18,0), /* The nice sequential
invoicenumber */
....,
PRIMARY KEY(int_invoiceid),
UNIQUE(int_invoicenumber)
);
CREATE GENERATOR GEN_TBL_INVOICEID;
CREATE GENERATOR GEN_TBL_INVOICENUM;


The invoiceid is sourced from the generator, is ALWAYS HIDDEN from the
users, and can have holes in the sequence all over the place from deletes,
etc.

The second invoice number might only be filled in once printed, accepted,
etc.

Nige.

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com]On Behalf Of chee hee
Sent: Tuesday, 28 November 2006 1:38 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Auditable Invoice Number


Hi All,

I am thinking to use a generator for invoice number in my application.
Any idea/code on how to generate auditable invoice number, meaning we
CANNOT have a break in invoice number in invoice table.
Thanks.

regards,
CM

Send instant messages to your online friends http://uk.messenger.yahoo.com

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]