Differences

This shows you the differences between two versions of the page.

Link to this comparison view

appendix:reference:envvar:variables [2011/03/15 14:25]
els
appendix:reference:envvar:variables [2016/06/28 22:38]
Line 1: Line 1:
-{{page>:​top_add&​nofooter&​noeditbtn}} 
  
- 
-====== Appendix: Environment Variables ====== 
- 
-===== Topic ===== 
- 
-[[appendix:​reference:​envvar:​home|Overview]] |  
-**[[appendix:​reference:​envvar:​variables|Environment Variables]]** | 
-[[appendix:​reference:​envvar:​shell|Shell Scripts]] | 
-[[appendix:​reference:​envvar:​locations|Locations]] | 
-[[appendix:​reference:​envvar:​reserved|Reserved Variables]] 
- 
- 
----- 
- 
-==== Environment Variables ==== 
- 
-Omnidex allows environment variables to be used in several locations within the product. ​ The general syntax for environment variables differs between Microsoft Windows and Linux, and so Omnidex supports a common syntax that can be used on all platforms. 
- 
-=== Syntax === 
- 
-The syntax for using environment variables is to enclose the string in curly braces, and then prefix the environment variable with a dollar sign ($).  For example, given the following environment variables ... 
- 
-  MAIN_PATH="​d:/​class"​ 
-  LAB_PATH="​lab1"​ 
-  FILENAME="​simple.xml"​ 
-  FULL_FILENAME="​d:/​class/​lab1/​simple.xml"​ 
- 
-... any of the following strings will be equivalent: 
- 
-  d:/​class/​lab1/​simple.xml 
-  {$MAIN_PATH/​lab1/​simple.xml} 
-  {$MAIN_PATH/​$LAB_PATH/​simple.xml} 
-  ($MAIN_PATH/​$LAB_PATH/​$FILENAME} 
-  {$FULL_FILENAME} 
- 
-=== Multiple Filenames === 
- 
-In some locations within Omnidex, it is possible to submit a collection of filenames. ​ For example, the PHYSICAL clause of the [[dev:​sql:​statements:​create_table:​home|CREATE TABLE]] statement can reference multiple filenames when using [[integration:​rawdata:​home|Raw Data Files]]. ​ In this case, multiple filenames can be included, each of which is surrounded by curly braces. 
- 
-  "​{$MAIN_PATH/​$LAB_PATH/​individuals_01.dat},​ 
-   ​{$MAIN_PATH/​$LAB_PATH/​individuals_02.dat},​ 
-   ​{$MAIN_PATH/​$LAB_PATH/​individuals_03.dat}"​ 
- 
- 
-=== Setting Environment Variables === 
- 
-Omnidex will evaluate environment variables when the process is loaded or when they are first used.  It is important to set the environment variables before the process is initialized. ​ For Omnidex Network Services, it is important to set the environment variables prior to launching the OdxNet process. 
- 
-=== Retrieving the Value of an Environment Variable === 
- 
-The current value of an environment variable can be retrieved using the operating system commands. ​ For Microsoft Windows, the command is: 
- 
-  echo %MAIN_PATH% 
- 
-For Linux, the command is: 
- 
-  echo $MAIN_PATH 
- 
-The current value of an environment variable can also be retrieved using the [[dev:​sql:​functions:​getenv|$GETENV]] function of Omnidex SQL.  For example, the following statement will retrieve the value of the environment variable MAIN_PATH. ​ Note that this statement retrieves from the table $OMNIDEX, which is a virtual table that always contains one column and one row.  ​ 
- 
-  select $getenv('​MAIN_PATH'​) from $omnidex; 
- 
-The $GETENV fnction can also be used as criteria in queries, as shown in the following example: 
- 
-  select * from INDIVIDUALS where COUNTRY = $getenv('​LOCAL_COUNTRY'​);​ 
- 
- 
-=====  ===== 
- 
-**[[appendix:​reference:​envvar:​home|Prev]]** | 
-**[[appendix:​reference:​envvar:​shell|Next]]** 
- 
-====== Additional Resources ====== 
- 
-See also:  
- 
-{{page>:​appendix:​reference:​see_also&​nofooter&​noeditbtn}} 
- 
-{{page>:​bottom_add&​nofooter&​noeditbtn}} 
 
Back to top
appendix/reference/envvar/variables.txt ยท Last modified: 2016/06/28 22:38 (external edit)