This discussion is archived
5 Replies Latest reply: Apr 2, 2013 8:58 AM by user11377561 RSS

Generating FK index, PK index and Unique constraint index

user11377561 Newbie
Currently Being Moderated
Under preferences, DDL, I have Automatic Index Generation setup for primary, foreign key and unique constraint. SDDM is generating these automatically in the DDL with the name of the FK having an X at the end of it. e.g., if the name of the fk is <aaaa>FK1, it is generating the index name as <aaaa>FK1X. Is this default behavior? Is there a way to specify a template for the automatic generation of this index (i.e., I would like to generate the index with the same name as the FK itself without the X at the end of the index name).

Please advise how this can be done.

Thanks!
  • 1. Re: Generating FK index, PK index and Unique constraint index
    Kent Graziano Oracle ACE Director
    Currently Being Moderated
    In the newest version (3.3) go to Tools -> Preferences -> Data Model -> Naming Standards - Templates. There is an option for Automatic Index. Default is <constraint>_IX. Just change that and drop/change the IX.                                                                                                                                                                                                                                                                                                                                                                                                                                   
  • 2. Re: Generating FK index, PK index and Unique constraint index
    user11377561 Newbie
    Currently Being Moderated
    Kent,

    Thanks for your response. The template you are referring to gets used when we explicitly define a regular index in the table properties window and we are OK with IX in this case.  However, in the case of automatically generating indexes in the DDL for primary key, foreign key, unique constraints (without having to explicitly define such indexes in the table properties window), we would like such indexes generated in the DDL with the same name as the foreign key, primary key or unique constraint without the X at the end of it (i.e., <aaa>FK foreign key should also automatically generate <aaa>_FK index in the DDL).  Currently, SSDm is generating these automatically with  the X at the end of the name of the corresponding unique constraint, primary key, foreign key.  Hope this helps clarify the question we have.

    Please advise if this is possible to be configured in SDDM.

    Thanks!
  • 3. Re: Generating FK index, PK index and Unique constraint index
    Kent Graziano Oracle ACE Director
    Currently Being Moderated
    What is the full version number that you are using?
  • 4. Re: Generating FK index, PK index and Unique constraint index
    Philip Stoyanov Guru
    Currently Being Moderated
    Hi,
    However, in the case of automatically generating indexes in the DDL for primary key, foreign key, unique constraints (without having to explicitly define such indexes in the table properties window), we would like such indexes generated in the DDL with the same name as the >foreign key, primary key or unique constraint without the X at the end of it (i.e., <aaa>FK foreign key should also automatically generate <aaa>FK index in the DDL)
    As Kent wrote you need the latest version of Data Modeler - 3.3.0.747 and there is a template called "Automatic Index" - it's default value is *{constraint}_IX* , you can change it to *{constraint}* and you'll get the job done. That template is used when such indexes are generated.

    Philip
  • 5. Re: Generating FK index, PK index and Unique constraint index
    user11377561 Newbie
    Currently Being Moderated
    Thanks, Kent and Philip.

    We will upgrade the version we use here currently.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points