Naming Conventions for Sequences and Triggers
Posted: Thu 22 Jan 2015 07:26
Hi.
I'm struggling with the SQL code Generation that is more or less inpredictable.
It generates Sequences and Triggers for Identity columns, which is what I want, but their names differ slightly.
Sometimes the sequence is called AI${SHORTENED_TABLENAME}_{Fieldname}_seq{someHash}, sometimes it's {TABLENAME}_seq instead.
It Looks like what's chosen might depend on the tables Name length and it's a strategy to keep the name short enough to be valid in an Oracle database context.
That's fine in General, but for some naming conventions defined by our customer we have predefined namings for database objects to comply on. With this, the Fieldname of the Primary key somehow replicates a short form of the table Name, thus a Sequence Name {Fieldname}_seq would be sufficient to be unique.
Of course due to that the length constraints are not met in my table namings.
How to achieve custom naming conventions for the SQL scripts?
A similar case are the Auto-Increment Triggers using those sequences.
For Triggers I get either the name AI${tablename} or {tablename}_INS_TRG, and I don't have any idea when each of those is chosen.
Is there any way to control how names are generated?
Kind regards
Peter
I'm struggling with the SQL code Generation that is more or less inpredictable.
It generates Sequences and Triggers for Identity columns, which is what I want, but their names differ slightly.
Sometimes the sequence is called AI${SHORTENED_TABLENAME}_{Fieldname}_seq{someHash}, sometimes it's {TABLENAME}_seq instead.
It Looks like what's chosen might depend on the tables Name length and it's a strategy to keep the name short enough to be valid in an Oracle database context.
That's fine in General, but for some naming conventions defined by our customer we have predefined namings for database objects to comply on. With this, the Fieldname of the Primary key somehow replicates a short form of the table Name, thus a Sequence Name {Fieldname}_seq would be sufficient to be unique.
Of course due to that the length constraints are not met in my table namings.
How to achieve custom naming conventions for the SQL scripts?
A similar case are the Auto-Increment Triggers using those sequences.
For Triggers I get either the name AI${tablename} or {tablename}_INS_TRG, and I don't have any idea when each of those is chosen.
Is there any way to control how names are generated?
Kind regards
Peter