Subject | SET GENERATOR in a stored procedure |
---|---|
Author | Tim Ledgerwood |
Post date | 2003-05-13T08:15:33Z |
I suppose I'd better explain the situation :-)
I write software in Delphi that does EFT transfers to banks from retail
outlets. I am busy converting the software from DBase III + files to
Interbase / Firebird.
Transactions are sent through to the bank in batches. At the end of each
batch, a batch cut off message is sent. It is a bank requirement that each
transaction in the batch is individually numbered within that batch, and
that the transaction sequence numbers in a batch start at 1 in each new batch.
So I have a INITBATCH procedure which creates a new batch record and
returns a set of default values. What I wanted to do was to use the
generator to generate the values automatically.
Also, how do I select the value in a generator? Can I use the following SQL
in a stored procedure - and if not, how would I get the present value
without incrementing the generator value?
SELECT * FROM GEN_ID (GEN_MYGENERATOR, 0);
[Non-text portions of this message have been removed]
I write software in Delphi that does EFT transfers to banks from retail
outlets. I am busy converting the software from DBase III + files to
Interbase / Firebird.
Transactions are sent through to the bank in batches. At the end of each
batch, a batch cut off message is sent. It is a bank requirement that each
transaction in the batch is individually numbered within that batch, and
that the transaction sequence numbers in a batch start at 1 in each new batch.
So I have a INITBATCH procedure which creates a new batch record and
returns a set of default values. What I wanted to do was to use the
generator to generate the values automatically.
Also, how do I select the value in a generator? Can I use the following SQL
in a stored procedure - and if not, how would I get the present value
without incrementing the generator value?
SELECT * FROM GEN_ID (GEN_MYGENERATOR, 0);
[Non-text portions of this message have been removed]