|Subject||Re: [ib-support] Idea for a new field type for FB 2,0 or IB 7?|
> Aage Johansen wrote:Yes, and with this NewField the Generator will be even superior... The all
> Hear, hear.
> Consider the AUTOINC/AUTOGEN/whatever harmful, and don't waste any
> effort on implementing it as we already have a superior mechanism: the
thing here it's TO USE a generator in a way that developers could save time
and write fewer code.
Generators are used almost 90% of the time to have a unique identifier of a
row. Don't you use (the superior mechanism) generators on a "Before Insert'
trigger ? Everytime you define a generator don't you have to go and change
your 'Before Insert' (or create a new one just for this) and put the line
IF( new.blabla is null) then new.blabla=Gen_ID(....blablabla)?
What we are talking about here is just that:
When you create a field of 'ThisNewType', FB will create a generator for it
(or use a already created one), and create a system trigger that will run
before all other of your triggers with that line.