How bad is it to simulate IDENTITY/AUTOINCREMENT columns using triggers in Oracle? -
I maintain the application that was originally written SQL Server-specific (using the identification field). Thus, we had to define several triggers for the primary key of automatic incremental salary.
I have been told that it is considered to be a hackney work in the Oracle world, but it was told that "friend of friends" in the way. Instead of using the sequence, how big is the deal to use triggers to increase the primary key from the sequence?
This is a very common practice in my experience, and not very bad though, if you have Inserts are controlled (for example if all the inclusions are done through a PL / SQL API) then this sequence is more efficient to use directly in the INSERT statement - because it avoids the overhead to run a trigger is. But if I trigger, I really do not worry about it unnecessarily!
Comments
Post a Comment