Font size

Importing Data from Database

The scenario data that you plan to import needs to follow certain naming and formatting conventions. To ensure that naming and formatting are correct, you may want to create a scenario template and fill it with your own data.

The coordinates of the objects in the importing scenarios will be automatically filled, unless:

  • The coordinates are already specified in the file (values differ from zero).
  • The file contains more than 200 locations. In this case only local coordinates storage will be used (using an online provider will be too time-consuming). The search through local storage is available by either of the following:
    • Country and City (the Name column is considered if City is not specified)
    • Country and zip Code

To import scenario data from database

  1. You can import a scenario by doing either of the following:
    • Choose File > Import > Import Scenario from Database... from the main menu.
    • Click the Import Scenario from Database button in the projects tree.

    The Import dialog box will open:

  2. Database — specify the database to import from:
    • Custom — (selected by default) the user-defined database.
    • Default — the database anylogistix uses. All scenarios are stored here.
  3. DB type — specify one of the supported DB types: sqlite, sqlserver, postgresql, mysql.
  4. DB address — specify the location of the database.
  5. DB name — specify the name of the database.
  6. DB login — specify the login that can be used to access the database.
  7. DB password — specify the password that can be used to access the database.

    The type of role and access rules for a user are defined by the admin of the database. In other words, by using the provided credentials you are accessing the database with the user profile that has certain rights defined by the admin for you.

  8. Select scenarios to export from the Scenario(s) drop-down list
  9. Specify the desired name of the importing scenario in the New scenario name field if you want to change its default name.
  10. Click Advanced options if you need to modify the import parameters:

    • Tables to import — click the drop-down list to select the tables to import (partial import of the importing scenario). All other tables will not be imported.

      If no table is selected, all tables will be imported.

    • Create new scenario — (selected by default) a new scenario will be created for the importing file. If disabled, the Scenario name option becomes active.
    • Scenario name — (active only if the Create new scenario option is disabled) click the drop-down list of the currently opened scenarios to specify the scenario to import the data to.

      Prior to importing data into the existing scenario complete the action below:

      1. Explicitly specify the data to be imported in the Tables to import option, otherwise, all tables will be imported, resulting in data duplication.
      2. Remove the data from the existing scenario that is about to be updated by the imported scenario to avoid data duplication (e.g. when importing demand, clear the existing demand data).
    • Import experiments — (selected by default) if disabled the experiments contained in the database will not be imported.
    • Import initial states — (selected by default) if disabled the initial states contained in the database will not be imported. Learn more about importing/exporting initial state data.
    • Import external tables — (selected by default) if disabled the external tables contained in the database will not be imported.

      When you import a scenario that is using an external table, the info about the external table is stored as a connection settings (DB name, DB address, table name, login, password) in the database table named export_external_table. These settings will be used to add a new external table to the scenario.

  11. Click OK to close the dialog box and import the scenario data. The newly created scenario will be located in the tab that corresponds to the type of the imported scenario (GFA, NO, SIM, TO):

Please note the following possible issues:

  • If you are importing a scenario into the project that lacks certain units, a pop-up message will inform you about all the missing units (and their corresponding conversions in case of user-defined units) that must be created.
  • If you are importing from a database that has wrong structure or does not contain an anyLogistix scenario at all, an error message will pop-up notifying that the template is missing data.
  • If the importing file has duplicating objects, they will be skipped. The warning message will list such objects
How can we improve this article?