SQL

What Is SQL ?

Available as part of SIMUL8 Professional, SQL (Structured Query Language) is a language used to query data sources, normally databases such as Microsoft Access, but also including other SQL compatible packages, such as Microsoft Excel.

SIMUL8 adheres to the conventions set out in the SQL99 standards approved by the International Standards Organization (ISO).

SIMUL8 SQL is an extremely powerful way of reading and writing data to and from a data source. SIMUL8 can create new records, and update or delete existing ones.

Using an external data source reduces the memory overhead for SIMUL8, and allows access to huge volumes of “real” data, possibly stored on a separate machine or network drive.

Setting up the database source on your PC

SIMUL8 SQL requires a valid “alias” to exist in the machine running SIMUL8. An Alias is commonly known as a Data Source Name.

New Data Source Names can be created by using the ODBC Data Source Administrator supplied as part of Windows.

  • Open the Control Panel.
  • Open Administrative Tools / Data Sources (ODBC).
  • On the ODBC Data Source Administrator interface, click on “Add…”

Add User Data Source in ODBC Administrator

  • Select the database type, e.g. Microsoft Access Driver(*.mdb), and click on “Finish”.

Choose database type

  • In the Data Source Name box, give your Data Source a name that will later be used in SIMUL8 to establish the connection. Click on “Select…” to choose the database that you want this reference to point (use the folder list box).

Select database

  • Once the database has been selected, click “OK” on each of the dialog boxes to take you back to the main ODBC Data Source Administrator interface. You will now see that your new database source has been added to the list of available data sources. Click on “OK” and close the control panel.

You are now ready to activate the database import module in the simulation. See the Help file Setting Up a Database Input for instructions on how to set up the SQL Connection within SIMUL8.

Visual Logic Commands