on 03-12-2015 3:09 AM
Hi
I am using PD 16.5.3.3 and the database is set to DB2. I am generating the DDL for my tables. The syntax for primary key comes something like this:
"P_Identifier_1"
How do i change this to say <TABLE>_PK; as an example, if I have employee table, it should say EMPLOYEE_PK
thank you
krishna
Hi,
You can change it in the DBMS definition file (make a copy first).
Browse to <DBMSCode>::Script\Objects\PKey\ConstName
You can see the value "P_%.16:PKEY%"
which takes the 16 first characters of Primary Key code and prefix it with P_
You can change this value with
%.15:TABLE%_PK, taking the 15 first character of table code + adding suffix _PK
The size limitation is imposed by DB2 (18 characters), if I remember correctly.
Note that the keys for which you manually changed the constraint names will not take the new template, you will need to revisit them and click (pull ?) the user-defined button on the right of the constraint name field.
Marc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Mark.
My DBA wants the indexes to be generated as 'X_N<n>_TableName; so as an example, if I have an employee table with 3 indexes on it, they should appear like:
X_N1_EMPLOYEE
X_N2_EMPLOYEE
X_N3_EMPLOYEE
I have changed the format on the "PDM Generation Options" page on the Detail tab and set the index format as X_N_%TABLE%'; Now it is generating indexes as :
X_N_EMPLOYEE1
X_N_EMPLOYEE2
X_N_EMPLOYEE3
is there any way i change the format string to generate it the way I am looking for?
I'm not in a position to check at the moment, but if there's a property of an index that indicates its position in the collection of sequences, you could use that in the template - it'll probably start from 0, so you'll have to add 1 to it.
You can check the properties in the metamodel help for indexes.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.