Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: naming conventions for constraints
Some thoughts:
From the leverage one, if you have a table/view or other naming convention, you are 1/2 way or more to your goal.
From the last, I've always tended to look at my objects using DBA_OBJECTS. I've always found it useful to start the constraint name with the supported object (table) name to make lists easier to generate. Therefore I use suffix notation. My convention has been
'table name or table abbrev' || "_"
< || col name or abbrev || "_" > < || segment || "_" > < || count >
where
segment an int useful in partitioning count is the increment
(some like to use FK2, I prefer 2FK - always known spot) type is a 2 char constraint type
My other standards include
- a table/view naming
Some of my standards are actually very old and some might be downright stupid , but they work - for me.
Bottom line - it really doesn't matter what you use as long as it is consistent, easy to learn/remember and not stagnant. Whatever you decide, ***document the reasons*** because someone will come along and challenge it. Then if the challenge is strong enough, you can document the reason for change. <g> Received on Wed Apr 30 2003 - 09:23:08 CDT
![]() |
![]() |