The client library and the database server need to locate files for two main purposes:
DLLs and initialization files are required to run SQL Anywhere. If an incorrect DLL is located, there is the possibility of version mismatch errors.
Some files are specified in SQL statements and need to be located at run time, such as INSTALL JAVA or LOAD TABLE.
Examples of SQL statements that use file names include the following:
INSTALL JAVA statement The name of the file that holds Java classes.
LOAD TABLE and UNLOAD TABLE statements The name of the file from which data should be loaded or to which the data should be unloaded.
CREATE DATABASE statement A file name is needed for this statement and similar statements that can create files.
In some cases, SQL Anywhere uses a simple algorithm to locate files. In other cases, a more extensive search is performed.
In many SQL statements (such as LOAD TABLE, or CREATE DATABASE), the file name is interpreted as relative to the current working directory of the database server.
Also, when a database server is started and a database file name (DatabaseFile (DBF) parameter) is supplied, the path is interpreted as relative to the current working directory.
On Windows, except Windows CE, SQL Anywhere programs, including the database server and administration utilities, perform a more extensive search for required files, such as DLLs or shared libraries. In these cases, SQL Anywhere programs look for files in the following order:
The executable directory (the directory where the program executable file is located).
Related directories. Directories with the following paths relative to the program executable directory:
Parent of the executable directory.
A child of the parent directory named scripts.
The current working directory. When a program is started, it has a current working directory (the directory from which it is started). This directory is searched for required files.
The Location registry entry. When installing onto Windows, SQL Anywhere adds a Location registry entry. The indicated directory is searched, followed by:
A child named scripts
A child with the operating system name (win32, x64, and so on)
System-specific directories. This includes directories where common operating system files are held, such as the Windows directory and the Windows\system32 directory on Windows operating systems.
The CLASSPATH directories. For Java files, directories listed in the CLASSPATH environment variable are searched to locate files.
The PATH directories. Directories in the system path and the user's path are searched to locate files.
On Windows CE, SQL Anywhere programs, including the database server and administration utilities, perform a more extensive search for required files, such as DLLs. In these cases, SQL Anywhere programs look for files in the following order:
The executable directory (the directory where the program executable file is located).
\ (the root directory).
The Location registry entry (the directory specified by the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\SQL Anywhere\10.0\Location).
The \Windows directory.
On Unix, SQL Anywhere programs, including the database server and administration utilities, perform a more extensive search for required files, such as DLLs or shared libraries. In these cases, SQL Anywhere programs look for files in the following order:
Paths relative to server current working directory (./):
./res
./scripts
./tix
./bin
./lib
./java
./shared
./../shared
NoteAll of these subdirectories are searched in all steps, except step 6. |
The executable path.
The SYBASE environment variable.
The PATH environment variable.
The LIBPATH environment variable:
One of the following:
install-dir/scripts (for files of type .sql)
install-dir/java (for files of type .zip)
install-dir/charsets/unicode (for files of type .uct)
The SQL Anywhere installation directory (install-dir), where install-dir is a single directory specified by the SQLANYx environment variable if it has been defined.
On NetWare, SQL Anywhere programs, including the database server and administration utilities, perform a more extensive search for required files. In these cases, SQL Anywhere programs look for files in the following order:
The executable directory (the directory where the program executable file is located).
The current working directory.
The sibling directory of the executable directory named scripts (for .sql files).
The sibling directory of the executable directory named java (for .zip or .jar files).
The parent directory of the executable directory.
The SYS:SYSTEM directory.
The SYS:SYSTEM\scripts directory (for .sql files).
The SYS:SYSTEM\java directory (for .zip or .jar files).