You can use conditional parsing in configuration files to specify the utilities that can use the file. Conditional directives allow command parameters to be included or excluded depending on the utility using the file. The File Hiding utility (dbfhide) can still be used to hide the contents of a configuration file when conditional parsing is used in the file.
configuration-file= text...
text : comment | conditional | command-line-option
comment : line starting with # that is not a conditional
conditional :
#if condition text [ #elif condition text ] ... [ #else text ] ... #endif
condition : { tool=utility-name[,utility-name]... | utility-name }
The following values are supported for utility-name:
dbbackup | dbinfo | dbmlsync | dbstop | dbxtract |
dbdsn | dbinit | dbping | dbsupport | mlsrvX |
dbengX | dblic | dbremote | dbsvc | mluser |
dberase | dblocate | dbspawn | dbunload | qaagent |
dbfhide | dblog | dbsrvX | dbupgrad | |
dbhist | dblsn | dbstats | dbvalid |
X is the version number of the executable you want to use. For example, 12 in dbeng12.
To be treated as a directive, the first non-whitespace character on a line must be #. When a utility is encountered in an #if or #elif directive, the lines that follow the directive are included until another conditional directive is encountered. The #else directive handles the condition where the utility has not been found in the preceding blocks. The #endif directive completes the conditional directive structure.
Blank spaces are not permitted anywhere within the list of tool names specified by tool=. You can nest conditional directives. If an error occurs while parsing the configuration file, the utility reports that the configuration file cannot be opened.
The dbspawn utility allows you to specify a configuration file reference in the command to be spawned, but you cannot specify a configuration file with options for the dbspawn utility. For example, the first command below is supported, but the second command is not supported:
dbspawn dbeng12 @myconfig.ini dbspawn @spawnopts.ini dbeng12 demo.db |
The following configuration file can be used by dbping, dbstop, and dbvalid.
#if tool=dbping,dbstop,dbvalid #always make tools quiet -q -c "UID=DBA;PWD=sql;Host=myhost;DBN=mydb" #if dbping #make a database connection -d #elif tool=dbstop #don't ask -y #else #must be dbvalid #use WITH EXPRESS CHECK -fx #endif #endif |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |