Using environment variables on UNIX

You can set, unset, modify, and view environment variables. If you already use any HCL OneDB™ products, some or all of the appropriate environment variables might be set.

You can set environment variables on UNIX™ in the following places:
  • At the system prompt on the command line

    When you set an environment variable at the system prompt, you must reassign it the next time you log in to the system.

  • In an environment-configuration file

    An environment-configuration file is a common or private file where you can set all the environment variables that HCL OneDB products use. The use of such files reduces the number of environment variables that you must set at the command line or in a shell file.

  • In a login file

    Values of environment variables set in your .login, .cshrc, or .profile file are assigned automatically every time you log in to the system.

  • In the SET ENVIRONMENT statement of SQL

    Values of some environment variables can reset by the SET ENVIRONMENT statement. The scope of the new settings is generally the routine that executed the SET ENVIRONMENT statement, but it is the current session for the OPTCOMPIND environment variable of HCL OneDB, as described in the section OPTCOMPIND environment variable. For more information about these routines and on the SET ENVIRONMENT statement, see the HCL OneDB Guide to SQL: Syntax.

In , you can set supported environment variables within an application with the putenv() system call and retrieve values with the getenv() system call, if your UNIX system supports these functions. For more information about putenv() and getenv(), see the HCL OneDB ESQL/C Programmer's Manual and your C documentation.