Subject | GENERATORS |
---|---|
Author | radevojvodic |
Post date | 2002-04-17T08:28:41Z |
Hi All,
I'm thinking about GeneratorLink usage and i find it unefficient. For
example if you set this property for a primary key and you put your
query in insert state generator is called imedietly. So you
incremented generator value. Then You cancel insert and your
generator value is still incremented.
For some tables in database i wrote trigger with
If (new.primary_id is null) then new.primary_id = Gen_ID(...).
Now if you set you Insert statement in IBO_query to
INSERT INTO *TABLE*( primary_id, ... ) Values (null,...);
then your generator will be incremented only when you actually post
your record to database and you are still able to enter your own
value for that field without incrementing generator. Of course if you
cancel transaction after you posted record generator will stay
incremented but how often do you cancel transaction after you posted
record.
The only problem with this kind of solution is with refreshing query
because new value is not shown until you refresh query.
I'm thinking about GeneratorLink usage and i find it unefficient. For
example if you set this property for a primary key and you put your
query in insert state generator is called imedietly. So you
incremented generator value. Then You cancel insert and your
generator value is still incremented.
For some tables in database i wrote trigger with
If (new.primary_id is null) then new.primary_id = Gen_ID(...).
Now if you set you Insert statement in IBO_query to
INSERT INTO *TABLE*( primary_id, ... ) Values (null,...);
then your generator will be incremented only when you actually post
your record to database and you are still able to enter your own
value for that field without incrementing generator. Of course if you
cancel transaction after you posted record generator will stay
incremented but how often do you cancel transaction after you posted
record.
The only problem with this kind of solution is with refreshing query
because new value is not shown until you refresh query.