Use Iguana to create database tables from a VMD

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:

  1. Locate your VMD file in Project Files > other:
  2. Hover the cursor over the arrow to right of your file name and click on select Create DB Tables:
    create DB tables
  3. 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”.

    export tables

    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.

  4. In the Database field, type the name of the database.
  5. In the Username field, type the username to use when accessing the database.
  6. In the Password field, type the password to use when accessing the database (if needed).
  7. Click Preview Create Statements. The SQL statements that will be executed are displayed in the Preview Results/SQL Statements panel:
    1. If the tables do not exist yet you will see a script like this:
      create db tables
    2. 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.

      creating db tables

  8. Examine these statements. If they are correct, click Execute Statements.
    The results of the executed statements are displayed in the Execute Results panel:
    execute results
  9. Click Close to close this window.

More Information [top]

 

Leave A Comment?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.