Subject | Re: [firebird-support] Re: Feature request : Generator tables |
---|---|
Author | Jonathan Neve |
Post date | 2004-02-24T07:01:52Z |
Svein Erling a écrit :
generator periodically. This could rapidly get out of hand. In the
example I took for instance, you would have to create a new generator
every month. That means12 generators a year. Not only that, but in
practice, it's sometimes even worse. I have a customer that also wants
to have a separate counter for each distinct store (all using the same
database). Since they have about 5-6 stores, that's at least 60
generators a year! Also, I guess I would have to create them from within
my application, if it can't be done within a stored procedure.
Therefore, considering the work and upkeep that would be required by
this system, I would rather continue with the system I already have
(relying on the PK constraint to find the right value). It's more work
than I would like, but it's simpler than using a 5 new generators every
month!
So I still maintain that I think the "generator-hash-table" system I'm
proposing could be worthwhile, and very useful. Don't you think so?
Thanks!
Jonathan Neve.
>I still believe you with Fb 1.5 could create a stored procedure orCertainly, this is possible, but it would require that you create a new
>trigger with an EXECUTE STATEMENT that could fire the generator of
>your choice (although I must admit I have no experience). Creating a
>generator is DDL, so this would still have to be done separately, but
>provided the generators exists, one stored procedure should be enough
>to fire any of them.
>
generator periodically. This could rapidly get out of hand. In the
example I took for instance, you would have to create a new generator
every month. That means12 generators a year. Not only that, but in
practice, it's sometimes even worse. I have a customer that also wants
to have a separate counter for each distinct store (all using the same
database). Since they have about 5-6 stores, that's at least 60
generators a year! Also, I guess I would have to create them from within
my application, if it can't be done within a stored procedure.
Therefore, considering the work and upkeep that would be required by
this system, I would rather continue with the system I already have
(relying on the PK constraint to find the right value). It's more work
than I would like, but it's simpler than using a 5 new generators every
month!
So I still maintain that I think the "generator-hash-table" system I'm
proposing could be worthwhile, and very useful. Don't you think so?
Thanks!
Jonathan Neve.