Data definition language (DDL) defines the structure of a database, including rows, columns, tables, indexes, and more. You can generate data definition language (DDL) for a database, database objects, or both using the Generate DDL wizard. The DDL is generated into a .sql file in an Eclipse project, or is executed directly on the specified Connection Profile. You can use this .sql file to create the same database object in a different database, or you can generate the DDL of a complete database to create a new database on a different server. You can edit the .sql file if you want to make changes.
- Display the Query Development perspective.
- In the Data Source Explorer, right-click a database, table, user-defined function, user-defined datatype, or a database view.
-
Select the model elements to include in the DDL script and click Next.
Option Description DROP statements Generates SQL drop statements. DROP statements remove an existing object from the database. CREATE statements Generates SQL CREATE statements. Comments Generates COMMENT statements. -
Select the model objects to include in the DDL script and click Next.
The object type determines which model object options are available.
Option Description Functions User-defined function Hash/Join Indexes Database, table Macros Database Databases Database Stored Procedures Stored procedure Tables Database, table Triggers Database, table User-Defined Types User-defined datatype Views database, view -
Select Save and run DDL options, then click Next.
Option Description Folder Name Project folder name. You can click Browse to select a folder. File Name File name Preview DDL Previews the generated DDL. Open DDL File for Editing Opens SQL file in the SQL Editor. - Click Finish.