Data Source Definition Commands

These are commands to define the source from which data selection will be made. How data sources are opened and closed is very much interface-specific but generally fall into one of 2 categories: databases where various relational tables are available, or file-based where selection is made from data files (or tables within files).

Data selection and fetch commands cannot be issued until a data source has been defined.

When connected to a web service, a client specifying a data source in one session will revert to the default data source at the end of that session. It must be declared at startup to be available for all client sessions.

Typically in a web service deployment, one of the following commands will be executed in a startup script (or an equiivalent program switch can be supplied). Data will then be available to all clients who connect to the service:

cd

cd <directory>

Change directory. This enables subsequent data source file names to be specified as relative path names. When this command is present in a startup script it defines the current working directory for all client sessions. Any cd command used within a client session is valid only until the end of the session. The directory name <dir> may contain environment variables.

The program switch -cd=<dir> has the same effect as including this command in a startup script.

This command has no relevance for database interfaces.

connect

connect <connect_string>

For database interfaces, this specifies the connection to the database (e.g. Oracle, ODBC etc.). This command should only be used within a startup script. It is not permitted to change a database connection once a database interface has started.

The program switch -conn=<connect_string> has the same effect as including this command in a startup script.

The form of the connect string will be database dependent, and to hide any sensitive connection information from prying eyes an encoded string may be used. The utility fxencode is available for such encoding.

This command is a no-op for file-based interfaces.

Running example

Startup Script:

# Define the base directory as the arcinfo tree
cd g:/arcinfo