tools for graphical constructing
SQL query to AnyLogic Database.
Query is the general SQL operation of retrieving data from database
you can feed
up a model with data returned by
the specified query. Query result represents a set of rows. Each
contains a set of values from the table's columns you have specified in
the query. You can use the query result to construct:
- Replicated object. Each row
of the query result will be used to add one more element to a
replicated object. Values
will be used to setup the parameters of the created object. Thirs
option is very useful in agent based modeling
when you want to populate your model with agents, who have characteristics
defined by parameters stored in some database.
- Collection. Each row of the query result will be used to
add one more element to a
collection. Values will be stored in the fields of the collection
Creating a query
define a query
- Drag the Query element
from the Professional
section of the Connectivity palette
to the graphical editor.
- Open the Properties
view and modify the Name
of the element. This name will be used to identify and access
- In the Database edit box, specify the database
this query will access .
- If you need to retrieve all data from some table of the
specified database, just select the Select
all from the table option in the Query section and specify the name
table in the edit box to the right.
If you are
working with Access 2007 database. specify the name of the table in the
square brackets, e.g.: [Table]
- Otherwise, if you need to retrieve some specific data only,
select the SQL
option and type your custom query in the edit box below.
Previewing the query results
You can preview the query result any time.
preview query results
Using the preview, you check the query. Table fields should
match the ones defined in the query.
- Select the Query
object you want to examine.
- Go to the Properties
view, Data feeding
- You will see the table listing the result this query will
The table contains columns you have specified in the query.