on 09-25-2013 9:20 PM
Where can I look for the rules that PD uses in generating these 3 things for an FK relationship.
Name
Code
Constraint Name
Right now, when I add a relationship between two tables in PD(16.1), it generates the Name and Code as "Reference_NNNN" and the Constraint Name as "FK_parent tablename + child table name"
I want to edit the rules so that all 3 are generated as FK_table_name_NN with NN being increased sequentially as FKs are added to that table.
When creating a new object, you do not have control of the naming template. Therefore, for "Reference_NNNN", you can not create a template. There is an open enhancement request for this functionality.
For the Constraint Name, this change can be made in the DBMS file.
In your PDM, select the Database\Edit Current DBMS menu
navigate to :Script\Objects\Reference\ConstName
The following template should meet your needs:
FK_%TABLE%_%REFRNO%
Or replace %TABLE% with any of the following enclosed by % %
"PARENT" // generated code of the parent table
"PNAME" // name of the parent table
"PCODE" // code of the parent table
"CHILD" // generated code of the reference
"CNAME" // name of the child table
"CCODE" // code of the child table
Anthony
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Anthony that works.
There is a little quirk, but we can live with that. Where the relationship is single digit, our standard is to generate it as FK_TableName_01, FK_TableName_02
But that will be difficult to achieve with the template, so will ask the DBAs to change the standard.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The templates are defined in the DBMS resource file (.xdb file).
In PDM, select Database > Edit Current DBMS. In the DBMS properties window, select ::Script\Objects\Reference\ConstName.
This is where you find the template for the constraint name.
During intermodel generation, you can specifiy your own FK column name template.
For exmaple, from CDM, select TOols > Generate Physical Data Model and click the Details tab.
HTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.