Re: [ib-support] Idea for a new field type for FB 2,0 or IB 7?
Author
Paul Schmidt
Post date
2001-11-21T22:36:39Z
On 21 Nov 2001, at 16:48, Artur Anjos wrote:
As the guy who started this war last week....
>
> I think we are trying to complicate something that is simple.
>
> So, let's resume it:
>
> a) Why the newfield?
>
> - This newfield type will be just to help the tedious work to
> implement Keys based in Generators.
This is correct it's only because I have built 50 tables in the last
two weeks, and it's a real PITA to do the same copy/paste/hack
over and over ad nausium, especially when a good twenty times
you missed one of the hacks, so you have to go back, edit the
SQL, then run it again.
> b) It will be usefull?
>
> - Lot's of people use this kind of "generator related" fields, and
> this new field type will save lot's of time for this kind of people.
>
> c) How it should be implemented?
>
> The way people use it mostly, in the trigger Before Insert. So, I
> think this should be implemented as a system trigger. The priority
> should be Before any definned triggers, so the user can take control
> of the value.
Not sure I agree, it should be a user trigger with a priority of 100,
this way the programmer can create and fire other triggers both
before and after. They could even drop in a replacement trigger if
they want to do something fancy. Using the field as a quick way to
get something defined.
> d) And the people that 'hate' this kind of fields?
>
> I think we can put something on the manual that will explain to this
> users that they are free to use it or not.
>
> Notes:
>
> This is a very different approach of 'Autoincrement fields'. We don't
> need a autoincrement field. We are just looking for a way to unique
> identify the record. We don't care about the value it will have: we
> just want FB to use it as we are use to do. We will not loose the
> abbility to use the generator outside that trigger. And the trigger
> will check if we did something with it, or not. That's the main reason
> I propose the name changed from 'AUTOINC' to 'AUTOGEN'. It will be a
> reference to the generator, not to a 'increment' field.
Okay, how about we use IDENTITY instead, that would be more
self-documenting that it's used to identify records. I just said
AutoInc because some of the stuff I am working on uses Btrieve.
> This is a "Save Time" field, and time it's (one of) the most precious
> things that a programmer could save.
>
As for a true series type Auto incrementing field, that would be
nice, but should probably be implemented as a serial generator,
that is a generator that guarantees there are no holes in the series,
we could then use a similar mechanism.
Paul
Paul Schmidt
Tricat Technologies paul@...
www.tricattechnologies.com