Toad World® Forums

customize DDL generated by TDM

I’m wondering if there is a way to specify the desired format for the DDL generated by Toad Data Modeler. For example, it is putting primary key constraints, unique constraints and foreign key constraints in ALTER TABLE statements rather than including them in the CREATE TABLE statement. It is putting check constraints in the CREATE TABLE statement–this is how I’d like the others to appear as well. Please advise.
Thanks, knot22


you can change setting in Order of Generated Objects dialog.



This is better. Changing the Keys so they appear inside the CREATE TABLE statement moves the primary keys and unique constraints into the CREATE TABLE statement but the foreign key constraints still appear separately in ALTER TABLE statements. Is there a way to move those into the CREATE TABLE statements as well?

I guess the reason why this is not done, is that it would require to create the tables in the correct order (child tables first, then the parent tables).

It’s probably too complicated to resolve during DDL generation (and it wouldn’t be able to cope with circular references).


currently it is not possible to move the code to CREATE TABLE statement (only in some databases this is available, e.g. SQLite). I created new change request for this requirement: CR#99049.

BTW the response from “a valued customer” is correct. It’s easier to generate it after code that crates all entities. :slight_smile:

Please feel free to add the suggestion to ideapond: