Environment Name

Naming an environment is not only required, but also very important.

Environment name is used to resolve ambiguous database and table names when connected to multiple environments. If two different environments have databases or tables with the same name, they can be qualified using the environment name in select statements. For example, an application has open connections to both of the following environments:

Environment1 name: Prospects_env
Database: Contacts
Table: Company

Environment2 name: Customers_env
Database: Contacts
Table: Company

Specify which environment to retrieve data from using the environment name:

SELECT name, phone FROM Prospects_env.Contacts.Company

 

Environment names should be unique.

Assume there are two copies of an environment, each installed with a different set of Omnidex indexes:

Environment file: c:\omnidex\demo\orders.env
Environment1 name: Orders_env
Database: Orders
Table: Company

Environment file: c:\omnidex\demo\orders1.env
Environment2 name: Orders_env
Database: Orders
Table: Company

Your application connects to environment1, runs some tests then disconnects.

>connect orders.env
Connected to c:\omnidex\demo\orders.env

>select ...

>disconnect
Disconnected

It then tries to connect to environment2 but receives the following error:

>connect orders1.env
*E* An environment with this logical name has already been loaded (ORDERS_ENV)

This is because some of the environment information is stored in the environment cache. There are two ways to solve this problem.

1. Use unique environment names. Orders_env and Orders1_env

2. Pass the FLUSH option when disconnecting from the first environment. This will flush the cache.

>connect orders.env
Connected to c:\omnidex\demo\orders.env

>select ...

>disconnect with flush
Disconnected

>connect orders1.env
Connected to c:\omnidex\demo\orders1.env

 

See Also: Allowed Special Characters