Got this question from a Oracle SQL Developer Data Modeler user recently –
How can we add INSERT statements for our LOOKUP tables when generating DDL from our Data Model?
– very nice person from Portugal
![](https://www.thatjeffsmith.com/wp-content/uploads/2023/11/model-image-pull-quote.png)
Example, include the data for my LOCATIONS table
This is pretty straightforward:
- Open the table in your relational model
- In the Scripts section, add the needed code
- In same area, specify WHERE to insert the code
- Generate the DDL
- In DDL options, enable/check the custom script
- Click OK, and Enjoy
Here’s what that looks like –
Model and diagram with DDL, no INSERTs 🙁
![](https://www.thatjeffsmith.com/wp-content/uploads/2023/11/image-5-1024x500.png)
Adding the script for my LOCATIONS table
![](https://www.thatjeffsmith.com/wp-content/uploads/2023/11/image-6-1024x580.png)
Generate!
![](https://www.thatjeffsmith.com/wp-content/uploads/2023/11/image-8-1024x640.png)
Enjoy
Since I opted to include the INSERTS at the end of the script, there they appear.
![](https://www.thatjeffsmith.com/wp-content/uploads/2023/11/image-9-1024x727.png)
But wait, why does it look different than what I put in the table properties? It’s almost like, SQL Developer is formatting my SQL…or something.
Yes, that’s controlled here, in the Modeler preferences –
![](https://www.thatjeffsmith.com/wp-content/uploads/2023/11/image-10.png)