DDL Script Previews in Oracle SQL Developer Data Modeler

thatjeffsmith SQL Developer 4 Comments

Tell Others About This Story:

Data Definition Language (DDL) is used to describe an object in SQL. When you model a table in your relational model using Oracle SQL Developer Data Modeler, you are probably very curious as to the code that is being generated to represent that object.

You can peek into this code using your mouse –

The Code behind the pretty picture

You can right-mouse-click on an object and choose ‘DDL Preview,’ or you can use the keyboard shortcut, Alt+Shift+I.

Here’s trick #1:

Mouse Over an object to get the DDL

Once the previewer is open, it’s dynamic. So click on another object in the model, and it will auto-refresh.

Auto-Generate DDL Text By Clicking on the Objects

And trick #2:

Change How the DDL is generated on the fly

Open the Preferences dialog under the Tools menu and proceed to the DDL page. There you can specify how to generate the DDL including:

  • Use Quoted Identifiers — this drives me nuts!
  • Generate Inline Column Constraints
  • Generate Comments in RDBMS

After you make this change, simply click back into the object and the DDL will auto-refresh based on your new setting. Here’s an example of how that looks with Quoted Identifiers.

The Options

DLL Generation Options

Previewing the Code

My object names are now case-sensitive, enjoy suckers!

You can expect more options and flexibility when it comes to generating the DDL in upcoming versions of SQL Developer Data Modeler. If you want to see something in particular be sure to add the request formally, or leave me a comment here.

Tell Others About This Story:

Comments 4

  1. Jeff thanks for this informative website. Do you know of a way to limit the line length when generating table data insert statements? We are setting up a code and data deployment system and one problem is when “insert statements” are generated from existing table, sqldev sometimes generate lines with >2499 char length, and of course sqlplus errors in running those (SP2-0027). Thanks in advance for your tips!!

    1. thatjeffsmith Post

      I didn’t know about it either until the developer showed us in a team meeting. I figured it was hard to explain in words or even screenshots, so I built the animated GIF using Camtasia.

Leave a Reply

Your email address will not be published. Required fields are marked *