What are some of the ways that preprocessing can be useful ?
The following example shows a couple practical applications of external and internal preprocessing variables. We first use preprocessing to find an external environmental variable name, WH_UTL_DIR, where the value of the name is a shared directory that contains a file of commonly-used Warehouse FUNCTIONS and DEFINEs. We then create two internal preprocessing variables, node and database, with which to open a database. Should the open fail, we trap the error and exit the script. * script cannot run if the environment variable is missing # if not defined(WH_UTL_DIR) # print ‘WH_UTL_DIR : environment variable missing’ # exit 1 # endif * include the common functions and defines xeq ${WH_UTL_DIR}\utllib.whs * set preprocessing variables for the data source # setvar node = & “remote sol22 ” & “user=qa ” & “pass=homer” # setvar database = & “oracle scott/tiger ” & “home=/b/u01/oradata/ora ” & “sid=ora816” * open the data source open db ${node} ${database} # if wherrno <> 0 # print “wherror”,