DBPATH environment variable

Use the DBPATH environment variable to identify the database servers that contain databases. DBPATH can also specify a list of directories (in addition to the current directory) in which DB-Access looks for command scripts (.sql files).

The CONNECT DATABASE, START DATABASE, and DROP DATABASE statements use DBPATH to locate the database under two conditions:
  • If the location of a database is not explicitly stated
  • If the database cannot be located in the default server

The CREATE DATABASE statement does not use DBPATH.

To add a new DBPATH entry to existing entries, see Modifying an environment-variable setting.

1  setenv DBPATH
2.1+ : [16]
2.1 pathname
2.1  / / servername / full_pathname
2.1  / / servername
is the full path, from root, of a directory where .sql files are stored.
is the valid relative path of a directory where .sql files are stored.
is the name of a database server where databases are stored. You cannot reference database files with a servername.

DBPATH can contain up to 16 entries. Each entry must be less than 128 characters. In addition, the maximum length of DBPATH depends on the hardware platform on which you set DBPATH.

When you access a database with the CONNECT, DATABASE, START DATABASE, or DROP DATABASE statement, the search for the database is done first in the directory or database server specified in the statement. If no database server is specified, the default database server that was specified by the ONEDB_SERVER environment variable is used.

If the database is not located during the initial search, and if DBPATH is set, the database servers and directories in DBPATH are searched for in the specified database. These entries are searched in the same order in which they are listed in the DBPATH setting.