Introduction
This article explains how to use Iguana to create database tables from table definitions from a vmd file. For this to work you must use a VMD that contains table definitions.
You can also go the other way, and import table definitions directly into a vmd file.
If you have any questions about using Chameleon please contact us at support@interfaceware.com.
Note: The demo.vmd file supplied with different versions of Iguana has changed over the years — so yours may not exactly match the one used here (but it will be similar).
You can download this version of demo.vmd which is the one we use on this page.
Tutorial Instructions [top]
To create database tables, do the following:
- Locate your VMD file in Project Files > other:
- Hover the cursor over the arrow to right of your file name and click on select Create DB Tables:
- Choose the database server type you are using from Database API list in the Export Tables screen:
For this example we are using a MySQL database called “test”.
Note: If MySQL is not available in Windows you will need to add the MySQL install directory to the Windows PATH variable, see Making the MySQL Database Option Visible in Windows.
- In the Database field, type the name of the database.
- In the Username field, type the username to use when accessing the database.
- In the Password field, type the password to use when accessing the database (if needed).
- Click Preview Create Statements. The SQL statements that will be executed are displayed in the Preview Results/SQL Statements panel:
- If the tables do not exist yet you will see a script like this:
- If the tables already exist yet you will see a script like this:
Warning: Take extreme care when running this script! This script will DROP the existing tables — all data in the existing tables will be lost.
If you want to keep the data in the existing tables then you should copy it and reload it into the new tables that are created. One way to do this is to rename the old tables first and then copy the data back afterwards — the exact details are beyond the scope of this tutorial so please speak to your DBA (database administrator) for help with this.
- If the tables do not exist yet you will see a script like this:
- Examine these statements. If they are correct, click Execute Statements.
The results of the executed statements are displayed in the Execute Results panel:
- Click Close to close this window.
More Information [top]
- The Chameleon reference section
- The Chameleon FAQs section
- The Chameleon TIPs section
- Understanding VMD Files
- How to Create VMDs
- Features Disabled in Chameleon Toolkit after Chameleon 6.0
- Best Practice: Using Multiple VMD files