Re: How to name inline constraints using Designer 2000
Date: 1996/11/26
Message-ID: <329B21C4.4835_at_dmdcwest.fmp.osd.mil>#1/1
Thank you for your thoughts on this matter. Please allow me to delve a bit deeper...
>Instead of specifying check constraints, you can try using allowable value
>constraint at the column level.The constraints generated in the DDL ARE at the column level (aka
"inline" vs table level constraints)
>This will essentially replace all the
>sys_c0000 constraints with a value constraint name which can be specified.
>But it does not include the NOT NULL constraint.All constraints (column and table level, even NULL/NOT NULL constraints)
can be named in the DDL. What I am looking for is a way to force the
naming of column level constraints from within Designer 2000 generated
DDL -- I do not want to hand "tweak" the DDL. This would result in me
having to update the repository to make it in synch with the changes.
Further I need to set these naming preferences at the entity/attribute
level in the ER diagram (allowing this model to generate the correct
candidate tables/columns with named constraints)
>I am not sure what is your problem in leaving the check constraint as it is.
The problem comes when you need to modify the data model. Suppose that
you have a table "THING" that had a column called "STATUS". STATUS is a
coded value that may be either "G" or "B" (for example). Later you
decide that STATUS should have another allowable value -- perhaps "X".
Ideally, you go back to the ER diagram and add this information to the
"THING" entity, "STATUS" attribute. You generate this forward using the
database design wizard to update the "THING" table/column definitions.
Finally, you need to generate the alter table scripts for this
modification, however the repository has no way of knowing the name of
the original inline constraint -- it was assigned by the database when
the DDL was run, not modeled in the repository...
>Please remember that NOT NULL fields in a table has got a
>corresponding SYS_C00 constraint.See above... you CAN name NOT NULL constraints in the create table DDL...
In another reply to my original question (below)Sridhar Subramaniam
suggests:
>I don't think there are constraint-prefix/naming preferences. What you
>might need to do is write a pl/sql script using the API - doing bulk
>updates on the meta-objects. Thought i haven't done this very thing, i
>am very positive this can be done. Let me know if you are interested in
>knowing more.
I agree -- I think that an extension to the repository could handle this. However, this seems like something that should be built directly into the tool. Let me continue to pursue "off the shelf" alternatives before following this route...
What I REALLY need is a way to get the tool (Designer 2000) to force all "allowable values" constraints that are defined at the attribute level in the ER stage to be generated as named TABLE level check constraints (vs inline column check constraints). The only exception would be NULL/NOT NULL column constraints. With the NULL/NOT NULL column constraints, I would like to be able to have Designer 2000 generate names for these (perhaps subject to my preferences). Surely this can be done!
Your help is very much appreciated.
John Elliott
elliotjs_at_dmdcwest.fmp.osd.mil
Received on Tue Nov 26 1996 - 00:00:00 CET