How SQL Anywhere locates files
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.
Simple file searching
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.
Extensive file searching on Windows
On Windows, SQL Anywhere programs, including the database server and administration utilities, can 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 module's directory (the directory where the program executable file or library file is located).
- The executable directory (the directory where the program executable file or library is located).
- The installation path (the SQL Anywhere installation directory, install-dir). install-dir is a single directory specified by the SQLANY11 environment variable if it is defined.
- No path (the path provided by the user).
- The Location registry entry.
- 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 PATH directories. Directories in the system path and the user's path are searched.
Note
On Windows, SQL Anywhere searches the following paths relative to each location in the preceding list:
- .
- ..
- .\bin32 and ..\bin32 (32-bit programs only)
- .\bin64 and ..\bin64 (64-bit programs only)
- .\java (for Java-related files)
- ..\java (for Java-related files)
- .\scripts (for SQL script files)
- ..\scripts (for SQL script files)
Extensive file searching on Windows Mobile
On Windows Mobile, SQL Anywhere programs, including the database server and administration utilities, can 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 module's directory (the directory where the program executable file or library file is located).
- The executable directory (the directory where the program executable file or library is located).
- No path (the path provided by the user).
- The Location registry entry.
- System-specific directories. This includes directories where common operating system files are held, such as Windows.
Note
On Windows Mobile, SQL Anywhere searches the following paths relative to each location in the preceding list:
- .
- ..
- .\bin32
- ..\bin32
- .\java (for Java-related files)
- ..\java (for Java-related files)
- .\scripts (for SQL script files)
- ..\scripts (for SQL script files)
Extensive file searching on Unix
On Unix, SQL Anywhere programs, including the database server and administration utilities, can 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 path (if it can be determined).
- The installation path (the SQL Anywhere installation directory, install-dir). install-dir is a single directory specified by the SQLANY11 environment variable if it is defined.
- No path (the path provided by the user).
- The PATH environment variable.
- The LIBPATH environment variable:
- LD_LIBRARY_PATH on Linux and Solaris
- LD_LIBRARY_PATH and SHLIB_PATH on HP-UX
- LIBPATH on AIX
- DYLD_LIBRARY_PATH on Mac OS X
Note
On Unix, SQL Anywhere searches the following paths relative to each location in the preceding list:
- .
- ..
- ./bin32 and ../bin32 (32-bit programs only)
- ./bin64 and ../bin64 (64-bit programs only)
- ./lib32 and ../lib32 (library files for 32-bit programs only)
- ./lib64 and ../lib64 (library files for 64-bit programs only)
- ./java (for Java-related files)
- ../java (for Java-related files)
- ./scripts (for SQL script files)
- ../scripts (for SQL script files)
- ./res (for .res files)
- ../res (for .res files)
- ./tix (for .tix files)
- ../tix (for .tix files)