Hi,
"what dbms do you use?"
SQL Server, most probably 2005
"Did you make sure you couldn't get the expected behaviour with identity/sequence like native features?"
The customers of the application made the requirement to work with number ranges in a couple of predefined contexts. For Example, they must have them with there products, because different areas are responsible for different, closed product groups and they want to recognise that within the product keys. Same for the customer (entity) and…
I know this is not normalized, not good Design…, but the customer insists on it
"I still think if you have to handle that pks table yourself, a specific trigger should be more robust than entities fetches/updates. "
"Now if you have to do it through llblgen, updating your pks table should be faster using an expression update query (look for "Expressions in entity updates" in the manual)"
My Problem is not the update of the pks table, that really could be done with an after insert trigger very well or with a expression update or …
My problem is to determine the pk value which should be used with the insert.
As I know I can’t have something like a return Parameter from a before insert trigger which can be included within the insert statement.
I can’t insert the pk during a before insert trigger, because afterwards I would have to do an update and not the posted insert
And I can’t leave the pk empty and post an after insert trigger to store the correct value, because of pk constrain violation during the insert itself
So for the moment, I don’t know any DB solution for that problem, but perhaps there is something I don’t know yet. For the moment it is in my mind, that I have to solve it in bl. But perhaps you have another good idea for me; I would appreciate it very, very much, if you have another tip for a method to solve the problem
thanks,
Ursula