Generating SQL for selected entities

Generating SQL

Select multiple entities on the diagram, right click on one of them and select Generate SQL... from the pop-up menu.

Generate SQL
Generate SQL

The Generate SQL dialog box shows the DDL and DML for the selected entities.

Generate SQL dialog
Generate SQL dialog box

DDL and DML

DDL stand for Data Definition Language, include create, drop and alter statements. DML stand for Data Manipulating Lanauge, include select, insert, update, delete statements.

The generated DDL statements can directly execute to database without any modification. Generate alter statement require connection to database, query the object from database and compare with the ERD. The alter statements are not generated by default, you can click the Generate button to generate on demand.

Generate alter statements
Generate alter statements

The generate DML is a template for select, insert, update, delete statements, you are required to modify the statement before execute.

Selecting database

Click the Database Configuration button to open the database configuration dialog.

Database configuration
Database configuration

If you selected multiple database, you can select one of the database from the database combo box.

After change the database, the SQL will re-generate for the selected database.

SQL updated
SQL updated

Generate SQL options

There are several option on the top of the Generate SQL dialog box.

Generate SQL options
Generate SQL options

Using toolbar

There is a toolbar above each group of statements.

Generate SQL toolbar
Generate SQL toolbar